Getting rid of the spam folder

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
Right now I'm running MailScanner with ClamAV and have disabled SpamAssassin as well as the spam folder in tweak settings and exim configuration and all the email accounts still have the spam folder automatically created or recreated if you delete it. Any ideas on where should I look to get rid of this?

Thanks!
 

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
Not really. I do not mind the Archive and Junk folders being automatically created, since this will work automatically with most email clients such as Thunderbird and Mac Mail client. The problem is that in our server we have this new "spam" folder. Not Junk, not Archive, but "spam" and cannot be removed. I just checked both of these threads you have mentioned and they discuss Junk and Archive.

Hope that makes sense.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
Hello,

The spam folder isn't listed in those threads, but it's included as part of the folders that are created automatically per the following entry in /etc/dovecot/dovecot.conf:

Code:
  mailbox spam {
    special_use = \Junk
    auto = create
  }
Thank you.
 

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
I see. Is there a way to make that "spam" folder just take the place of "Junk" which is the actual folder already created that works with most regular email clients? From that code it seems like that's what the idea is, but it does not seem to be working that way, if I am understanding correctly.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,608
77
308
cPanel Access Level
Root Administrator
Ok after checking the dovecot config I see you guys have both Junk and spam by default. I guess I am going back to support that suggestion to let us unsubscribe it by default.
As a work around, for now, you should be able to modify the template file as described here Configure Dovecot - Documentation - cPanel Documentation

If you remove the configuration block from the main.local template, and rebuild the dovecot configuration, the result should not have the undesired "spam" special folder.
 
  • Like
Reactions: Lucas

dirkniblick

Member
Nov 15, 2016
7
0
1
Omaha
cPanel Access Level
Website Owner
If you remove the configuration block from the main.local template, and rebuild the dovecot configuration, the result should not have the undesired "spam" special folder.
Did this work for you, Lucas? My web host updated their cPanel a few months ago and now I have "Junk" and "spam" folders for every email account on my server. It's frustrating to me because they don't seem to care that these two folders are confusing. They claim that there's nothing they can do about it, but that seems incredibly sloppy. I'm trying figure out if this is either apathy on their part or poor software on cPanel's part.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
Did this work for you, Lucas? My web host updated their cPanel a few months ago and now I have "Junk" and "spam" folders for every email account on my server. It's frustrating to me because they don't seem to care that these two folders are confusing. They claim that there's nothing they can do about it, but that seems incredibly sloppy. I'm trying figure out if this is either apathy on their part or poor software on cPanel's part.
Hello,

You could provide your hosting provider a link to this thread to show them the instructions for disabling the SPAM folder auto-creation via the modification of the Dovecot configuration file.

Thank you.
 

dirkniblick

Member
Nov 15, 2016
7
0
1
Omaha
cPanel Access Level
Website Owner
Hello,

You could provide your hosting provider a link to this thread to show them the instructions for disabling the SPAM folder auto-creation via the modification of the Dovecot configuration file.

Thank you.
Michael, would what you're suggesting get rid of the "spam" folder and leave the "Junk" folder? Can you suggest what configuration they have to change to do that?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
Michael, would what you're suggesting get rid of the "spam" folder and leave the "Junk" folder? Can you suggest what configuration they have to change to do that?
Yes, you'd follow the instructions under "Add Dovecot Options" at:

Configure Dovecot - Documentation - cPanel Documentation

For example:

Code:
cp /var/cpanel/templates/dovecot2.2/main.default  /var/cpanel/templates/dovecot2.2/main.local
vi /var/cpanel/templates/dovecot2.2/main.local
When editing /var/cpanel/templates/dovecot2.2/main.local, remove the following entry:

Code:
  mailbox spam {
    special_use = \Junk
    auto = create
  }
Then, save the changes and run the following commands:

Code:
/usr/local/cpanel/scripts/builddovecotconf
/scripts/restartsrv_dovecot
Thank you.
 

dirkniblick

Member
Nov 15, 2016
7
0
1
Omaha
cPanel Access Level
Website Owner
Code:
  mailbox spam {
    special_use = \Junk
    auto = create
  }
Thank you for your reply!

Does that "special_use" attribute default to \spam? Is that why I'm getting the "spam" folder? If so, was there a change recently to cPanel making that happen? This is the reason I've heard for why I have that folder now when I hadn't for years.
 

dirkniblick

Member
Nov 15, 2016
7
0
1
Omaha
cPanel Access Level
Website Owner
I discussed this with my web host and they're concerned that making the configuration changes would negatively impact their customers. I'm assuming that making those changes would not delete the "spam" folder from each of the email account but just make it not auto create. Is that the correct assumption?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
I discussed this with my web host and they're concerned that making the configuration changes would negatively impact their customers. I'm assuming that making those changes would not delete the "spam" folder from each of the email account but just make it not auto create. Is that the correct assumption?
Hello,

Yes, that is correct. However, it is a global setting, so I can see why a shared hosting provider may not want to change it.

Thanks!
 

dirkniblick

Member
Nov 15, 2016
7
0
1
Omaha
cPanel Access Level
Website Owner
Hello,

Yes, that is correct. However, it is a global setting, so I can see why a shared hosting provider may not want to change it.

Thanks!
Oh, I understand that. However, as a system administrator myself, I would see it as my duty to eliminate a suboptimal configuration for my users, especially one they were unhappy with. I can't imagine any user or server admin anywhere who would want two spam folders with two different names.

The big confusion I have about all of this is that this folder or configuration was supposedly part of a cPanel update. Was there in fact an update that pushed this spam folder into place despite the fact there was already a Junk folder? ...or is this a local configuration thing? This seems a weird thing for cPanel to do across the board.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
Hello @dirkniblick,

The primary reason for this change was to allow for maximum compatibility with email clients. Some email applications, such as non-English versions of Outlook 2013, relay on this automatic mapping. Otherwise, users lose the ability to move or delete messages. There's some more information from Dovecot, including a link to RFC 6154 at:

MailboxSettings - Dovecot Wiki

I encourage you to vote and add feedback to the following feature request if you'd like to see a change in the default behavior:

Unsubscribe from default folders

Thank you.
 

dirkniblick

Member
Nov 15, 2016
7
0
1
Omaha
cPanel Access Level
Website Owner
@cPanelMichael, I looked at that wiki page, but it doesn't show where the "spam" folder is called out. I see "Junk", but not "spam". Where'a the "spam" folder configured to auto create?

And I completely agree with the mapping of folders to purpose, but why map two of them for the same thing? When I setup my account on my iPhone, it sets up those folders, but I can't unsubscribe from a "spam" folder in iOS. Sometimes I look at my mailbox and I see two "Junk" folders and other times I see "Junk" and "spam". Even my mail app is confused by this. And the real problem for me is iOS doesn't give me the option to unsubscribe from folders. It's the mere existence of the spam folder which is the problem and I don't believe that feature request (from a year ago) will address that.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
Hello @dirkniblick,

The Dovecot document doesn't match the exact Dovecot configuration file used on cPanel, but it's useful if you want to have a better understanding of how Dovecot configuration options such as "special_use" or "auto" work. Here are the specific entries in /var/cpanel/templates/dovecot2.2/main.default that results in the automatic creation of the spam and junk folders:

Code:
  mailbox Junk {
    special_use = \Junk
    auto = create
  }

  mailbox spam {
    special_use = \Junk
    auto = create
  }
I do understand your point about the confusion caused due to the existence of both the Junk and Spam folders. We actually have an internal case open (CPANEL-5993) to address an issue where the SpamAssassin Spam Box folder is not consistent with the Junk special-use folder in dovecot.conf. This wouldn't solve the specific issue you are referencing, but it's another reason the feature you are seeking would add value. I recommend opening a feature request with the specific changes you'd like to see via:

Submit A Feature Request

The following document explains how feature requests work, and why it's the best method of requesting a change in functionality:

How to use and what to expect from the cPanel features site | Guides

Than you.