The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SpamAssassin rewrite_header

Discussion in 'E-mail Discussions' started by Magotchi, May 4, 2007.

  1. Magotchi

    Magotchi Member

    Joined:
    Apr 16, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    In the cPanel SpamAssassin configuration, I see the following message near the bottom:

    I'm using:
    WHM 11.1.0 cPanel 11.2.1-C11600
    CENTOS Enterprise 4.4 x86_64 - WHM X v3.1.0

    Any ideas on how to make subject rewriting work? It's a great feature (and for less skilled clients, the only really good part about SpamAssassin).
     
  2. TeranceH

    TeranceH Registered

    Joined:
    Apr 22, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Same problem - want rewrite_header reenabled

    Trying to find out if I have the access I need or if it is solely at the discretion of the Hosting Company.

    What I have found so far...

    There is a user_prefs file to handle this for your domain. HOWEVER this file serves no purpose unless the allow_user_rules is set to permit that. The recommendation is to NOT allow that.

    So the next step is the local.cf file... It would seem that the following line could be added to it.
    rewrite_header Subject ****SPAM(_SCORE_)****

    But where is this local.cf located... DOES ANYONE KNOW? Is it beyond my reach as a WHM and cPanel user?
    Is it in some upper level etc/mail directory just out of my reach?

    (Please advise... having that turned on made it so much easier to first show which emails would disappear, and then once everyone felt good about what was getting hit, I could stop the delivery of the SPAM. Without that warm fuzzy transition - it is just too much of a leap of faith and no one wants to jump.)
     
  3. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider

    You'll have to enable the old style (slow) spamassasin in the exim config editor if you need subject rewrites.
     
  4. TeranceH

    TeranceH Registered

    Joined:
    Apr 22, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Is that something I can do at a WHM/cPanel User Level or must I be the SERVER owner? And if I was the server owner, I would have just made the edit to local.cf and been done wth this hours ago...

    These forums are somewhat confusing because of the crosstalk between server owners (who have power), resellers (who have limited power), and users who have none. I find myself in the middle once again discovering the limits. Ugh! It is good to have the information, but it still requires me to get the Server owner to make a change. And all too often, they have been riding along without really knowing everything they have control over either.

    Why does all of the documentation and entry screens for cPanel refer to a functions which are no longer readily available. I could understand a typo here or there, but everything I see tells me something should be there and it isn't. The problem I am experiencing should have come up before the 11 upgrade, but only started yesterday - I guess we were configured for an old version of SpamAssassin... and now we are not.
     
  5. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    Owner/root level.

    To the best of my knowledge, these forums are for dedicated server(s) owner(s), and somewhat resellers, but not end-users.

    Unless you are happy with your host, otherwise there are hundreds of them out there.

    Remember that there're four editions of the cPanel/WHM: Edge, Current, Release, and Stable. What functions are we talking about there?
     
  6. Magotchi

    Magotchi Member

    Joined:
    Apr 16, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the responses. I guess I'll just stick with good ol' old spamassassin, but doesn't that seem to you guys like the loss of a useful feature?
     
  7. binoy

    binoy Member

    Joined:
    Nov 18, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    so in cpanel 11, it is not possible for users to rewrite subject for spams ? and no user level configuration of required_score ?

    If yes, why dosent cpanel remove these options from x3?

    What is the procedure to rewrite subjects and change required_score at the global level ?

    Why is the spambar and spamscore disabled when you add a new filter.?
    sorry for all the questions
     
  8. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    You can't rewrite subject anymore, however you can still change the other directives in the spamassasin config file.

    If you need the old behavior (at the expense of cpu time -- not that it is any slower then cpanel 10), you can enable the old spam system in the exim config editor in whm.
     
  9. binoy

    binoy Member

    Joined:
    Nov 18, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    thanks, i think i will stick to cpanel 11.
    Why is the spambar and spamscore disabled when you add a new filter from cpanel.
     
  10. Dom.S

    Dom.S Registered

    Joined:
    May 7, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I've selected the 'Use the old transport based spamassassin system instead of the new acl style one. (not recommended, slow)' option on my server but I still receive the following error:

    Is there another setting somewhere that I'm missing? I really would like to have subject rewriting working on the user level - my server has relatively little email traffic so the performance issues aren't a great concern.
     
  11. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    The global ***SPAM*** only works with the new system. It should disappear as an option if you check the old spam system box.
     
  12. LP-Tim

    LP-Tim Active Member

    Joined:
    Apr 30, 2007
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Sorry to beat what might be a dead horse, but I need to be sure before I start checking/unchecking boxes. Are you guys saying that the checkbox that says "Rewrite messages SpamAssassin marks as spam with ***SPAM*** at the beginning of the subject line" does not work unless I also check "** Use the old transport based spamassassin system instead of the new acl style one. (not recommended, slow)"? Or do I just need to check the second one if I want users to be able to choose their own rewrite?

    All I need is the ***SPAM*** rewrite, and it's fine as a global setting. I don't really care if users have the ability to choose their own rewrite subject.

    Could somebody please clarify this behavior?

    p.s. - Although I'm all for better server performance, this is one of those usability things that outweighs the extra CPU cycles. Trying to explain how to filter email headers to some end users can be fairly painful...
     
  13. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    If you are running Cpanel 11, and nothing has gone wrong during the upgrade, the following should work for what you want to do:

    checkmark - Rewrite messages SpamAssassin marks as spam with ***SPAM*** at the beginning of the subject line.

    ** System filter file (leave blank to disable) - /etc/cpanel_exim_system_filter

    uncheckmark - ** Use the old transport based spamassassin system instead of the new acl style one. (not recommended, slow)

    NOTE: If you do NOT have the system filter enabled, I do not believe it will rewrite the subjects - so make sure you have that checked.

    If you want it to turn on Spamassassin for ALL accounts regardless of their individual setting of enable/disable - then checkmark Turn on SpamAssassin for all accounts (Global ON). If you DONT want it to do this globally for every email address on every account and domain, then do NOT checkmark this and instead enable/disable spamassassin on a per-account basis.

    With rewriting on - there is no ability to change how it rewrites the subject line on a per-domain basis - It will globally rewrite the Subject of spammy messages by prefixing them with ***SPAM***.

    In /etc/exim.conf you can actually change that by modifying a particular line:

    add_header = X-Spam-Subject: ***SPAM*** $h_Subject

    For instance, I prefer to have spam messages prefixed with [SPAM] instead of ***SPAM*** so I have modified mine to be:

    add_header = X-Spam-Subject: [SPAM] $h_Subject

    However - I do not believe these changes will persist with updates - which means that if somethign is updated in Exim, it may very well replace the existing exim.conf and remove that change.

    CAVEAT #1: When I upgraded mine, I had a custom exim.conf already - so the update did not complete properly. The Cpanel folk had to reset my exim.conf and then run a script to finish the update process.

    CAVEAT #2: As discussed in another thread, some people (including myself) found that our exim.conf's that were reset had the following line:

    add_header = X-Spam-Subject: ***SPAM*** $h_subject

    (not the lowercase s in $h_subject at the end) - This caused spamassassin to replace the subject with ***SPAM*** instead of prefixing the subject with ***SPAM***. I had to change $h_subject to $h_Subject (note the capital S) and then restart exim for it to properly rewrite.

    If I would NOT enable any of the filters that start with "Reject mail with a failure message...." - Doing so will just ask for trouble when your system starts to backscatter spam.

    Mike
     
    #13 mtindor, Jul 6, 2007
    Last edited: Jul 6, 2007
  14. Skie

    Skie Active Member

    Joined:
    Mar 27, 2003
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    I'm not sure if this is a related or seperate problem, but I've received reports from a few customers that the subject is being overwritten instead of re-written with "***SPAM***".
     
  15. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    You don't by chance have clamav installed as well ?
     
  16. Skie

    Skie Active Member

    Joined:
    Mar 27, 2003
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Yes I do. Is there a conflict with clamav and the new way things are handled in CPanel?
     
  17. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    That's what I was talking about in my previous post.

    Check /etc/exim.conf

    add_header = X-Spam-Subject: ***SPAM*** $h_subject

    If that line has $h_subject (all lowercase) at the end, that's your problem. It rewrites the subject only with ***SPAM*** (i.e. replacing any previous subject) because $h_subject is not the variable that contains the original subject, $h_Subject is.

    Change to $h_Subject, ie:

    add_header = X-Spam-Subject: ***SPAM*** $h_Subject

    - Ya need that capital S in Subject. Then /scripts/restartsrv_exim

    Mike
     
  18. Skie

    Skie Active Member

    Joined:
    Mar 27, 2003
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    I think I went through your post too quickly to pick up on what you were saying. It was lowercase in my config so I just changed it. I'll have to wait to get some spam before I know if that makes a difference. Heh. I think there's something wrong with me. I'm actually wanting to get some spam. :eek:
     
  19. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator

    Yes, that should make all the difference. Just make sure you restart exim afterwards.

    Mike
     
  20. madsmaks

    madsmaks Registered

    Joined:
    Mar 25, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I had exactly the same problem since upgrading to cPanel 11 but luckily the answer can be found in http://forums.cpanel.net/showthread.php?t=69129&highlight=rewriting+subject.

    Basically, just make a backup of your current exim.conf in case of problems then go to WHM and Exim Configuration Editor. (You need to be logged in as root) At the bottom of this window you should see a button that says Reset ACL Config to Defaults. Click this button and once exim has restarted you should now see the option to add text to the Subject line. The default value is ***SPAM***. I also had to click the option to enable for all users (global). Save these settings and restart exim again.

    In my case all of my clients individual settings for autodelete, blacklist, whitelist and filter levels were retained.

    Jon
     
Loading...

Share This Page