Brian Kendig

Q: Where do I configure spamassassin in Mountain Lion Server?

Where, in Mountain Lion Server, can I configure SpamAssassin?

 

I've tried modifying /Library/Server/Mail/Config/spamassassin/local.cf, but the changes I made there don't have any effect.

Mac mini, Mac OS X (10.7)

Posted on Aug 5, 2012 8:51 PM

Close

Q: Where do I configure spamassassin in Mountain Lion Server?

  • All replies
  • Helpful answers

Previous Page 2 of 5 last Next
  • by niwrik,

    niwrik niwrik Oct 9, 2012 6:13 PM in response to angryiphoneuser
    Level 1 (0 points)
    Oct 9, 2012 6:13 PM in response to angryiphoneuser

    Following redshift82r's instructions posted elsewhere in the forums, I loaded Roundcube on our MLS and added the managesieve plug in.  Once everything was working, I was able to setup a rule to move messages with the string ***JUNK MAIL*** in the subject to the junk folder.  This seems pretty effective at keeping the inboxes clean, while allowing end users to  check their own junk folders so long as they are using IMAP.

     

    I'm real green still, so I'm looking at the following (over the next several months):

     

    1) Default templates for Roundcube mailboxes (default folders) and default manageseve filters

    2) Updating whitelists/blacklists with some script (maybe called from cronjob) to allow users to put false positives in one folder and spam in another to train spamassassin <-- this might turn out to be a pipe dream

    3) More customization in spamassasin rules to automaticaly delete/bounce spam with certain characteristics

     

    So far, so good, though.  Got a snapin running that allows carddav sync with MLS address books.  Looking at getting calendar snapin to work as well.

     

    I am getting e-mails from spamassassin RE: blocked spam and blocked viruses.  Since 10.8.2, there are additional messages sent when the filter blocks a virus...

  • by redshift82r,

    redshift82r redshift82r Oct 10, 2012 3:55 PM in response to angryiphoneuser
    Level 2 (325 points)
    Oct 10, 2012 3:55 PM in response to angryiphoneuser

    Hi AIU,

     

    Hopefully my other replies have set you on the right track, but to make it easy.

     

    1. Set up a local user on the server to catch spam - say 'spamcollector'.

     

    2 using serveradmin from the command line:

     

    Re: auto delete junk mail on os x server

    Aug 15, 2012 10:26 PM (in response to shcaerp)

    Or, easier than Option 1 and 2 above. - use serveradmin to make the changes instead.

     

     

    $ sudo serveradmin settings mail:postfix:spam_quarantine = spamcollector@yourdomain.com

     

    Other spam settings configureable in serveradmin include:

     

    mail:postfix:spam_subject_tag = "***JUNK MAIL*** "

    mail:postfix:spam_ok_locales = "en"

    mail:postfix:spam_notify_admin_email =                          # "i.e. spamcollector at your domain dot com"

    mail:postfix:black_hole_domains:_array_index:0 = "zen.spamhaus.org"

    mail:postfix:spam_scan_enabled = yes

    mail:postfix:spam_rewrite_subject = yes

    mail:postfix:spam_notify_admin = no                              #yes

    mail:postfix:spam_ok_languages = "en fr de ja sw ta"

    mail:postfix:spam_action = "deliver"                          # don't change to 'delete' and definitely don't change to 'bounce'

    mail:postfix:spam_log_level = "info"  #warning/notice/critical/debug

     

     

    cheers

    Gerry

  • by Kostas B,

    Kostas B Kostas B Oct 19, 2012 2:07 AM in response to redshift82r
    Level 1 (90 points)
    Oct 19, 2012 2:07 AM in response to redshift82r

    Thank you,

     

    Can you please share how do you whitelist some addresses and domains in SpamAssassin, and how to check if they really get whitelisted or blacklisted?

     

    Best regards

     

    Kostas

  • by essandess,

    essandess essandess Nov 4, 2012 2:43 AM in response to Brian Kendig
    Level 1 (28 points)
    Applications
    Nov 4, 2012 2:43 AM in response to Brian Kendig

    See this post to train spamassassin using the content of the mailboxes "junkmail" and "notjunkmail": https://discussions.apple.com/thread/4481820

  • by niwrik,

    niwrik niwrik Dec 10, 2012 7:42 AM in response to Brian Kendig
    Level 1 (0 points)
    Dec 10, 2012 7:42 AM in response to Brian Kendig

    It looks like server app 2.2 has addressed the spamassassin issue whereby the slider bar was inverted.  I have not yet loaded this on our production server, having adjusted all the threshholds manually in amavisd.conf - I'm afraid the update will break everything that is finally working perfectly.  Here is a screen shot of the 2.2 mail filter screen from my test box:

     

    Screen Shot 2012-12-10 at 10.26.46 AM.png

     

    NOTE:  In brief testing, I noticed that the slider controls only the 'tag2' level and not the 'kill' level.  You're probably still better off changing the settings manually in amavisd.conf - I found that it was far more effective to reduce the tag level to zero so that everything gets tagged, then set the kill level action to discard.  ($final_spam_destiny = D_DISCARD;)

  • by Matt Domenici,

    Matt Domenici Matt Domenici Feb 3, 2013 10:34 AM in response to Brian Kendig
    Level 1 (119 points)
    Feb 3, 2013 10:34 AM in response to Brian Kendig

    @Brian:  I'm having the same issue with rules not being run -- seemed to happen after I needed to do a complete restore.  Did you ever determine what the root cause of your spamassassin rules not being run was?

  • by Brian Kendig,

    Brian Kendig Brian Kendig Feb 13, 2013 4:03 PM in response to Matt Domenici
    Level 2 (186 points)
    Windows Software
    Feb 13, 2013 4:03 PM in response to Matt Domenici

    No, I never was able to find the config file that the default SpamAssassin installation uses.

  • by Matt Domenici,

    Matt Domenici Matt Domenici Feb 13, 2013 9:56 PM in response to Brian Kendig
    Level 1 (119 points)
    Feb 13, 2013 9:56 PM in response to Brian Kendig

    @Brian-- could you share the location and steps you followed?

  • by Brian Kendig,

    Brian Kendig Brian Kendig Feb 16, 2013 6:34 AM in response to Matt Domenici
    Level 2 (186 points)
    Windows Software
    Feb 16, 2013 6:34 AM in response to Matt Domenici

    The steps I followed to not get it to work? No, I'm sorry, that was months ago and I finally gave up on it and resigned myself to having to delete the spam on my iPhone.

     

    I would really love the mail server to automatically move spam into the Junk folder for me (without me having to keep a desktop Mail client running to do this). Or, better yet, to refuse acceptance of spam in the first place - I used to do this with Exim and the sa-exim plugin. Maybe if I eventually get annoyed enough, I'll switch back to Exim.

  • by Buckiejoe,

    Buckiejoe Buckiejoe Oct 8, 2013 7:06 AM in response to Brian Kendig
    Level 1 (10 points)
    Oct 8, 2013 7:06 AM in response to Brian Kendig

    Am I the only one who found out that the actual working config file for spamassassin is located in

    /etc/mail/spamassassin/local.cf

    instead of /Library/Server/Mail/config/spamassassin/local.cf ?

    It could be because I migrated from 10.6 to 10.8 and spamassassin lost its bayes database access for some reason (wrong db version or something along those lines) and I had to manually update SA through cpan, took some work because of errors but eventually worked out, then ran sa-update and it fixed the database after which it worked again with amavis with the only problem being that I couldn't set any rules in local.cf that resided in /Library... Took a run of

    spamassassin --lint -D

    to see that it's actually looking in /etc... instead of /Library... to find its local.cf there. Once I set the rules in the former directory they immediately started working.

  • by scottl31,

    scottl31 scottl31 May 29, 2014 6:37 PM in response to Buckiejoe
    Level 1 (13 points)
    Servers Enterprise
    May 29, 2014 6:37 PM in response to Buckiejoe

    Mine shows:

    using "/Library/Server/Mail/Data/scanner/spamassassin/3.003002/updates_spamassassin_o rg/30_text_de.cf" for included file

     

    and although the files inside there have been updated recently, is it not correct? The spam filtering sure seems to not be working.

     

    Any clues how I would go about fixing the above path to:

     

    /etc/mail/spamassassin/local.cf

     

    Also, while I'm at it how do I enter my junkmail into this:

     

    sudo mail:imap:junk_mail_userid = ""

     

    Thanks,

  • by Buckiejoe,

    Buckiejoe Buckiejoe May 30, 2014 10:45 PM in response to scottl31
    Level 1 (10 points)
    May 30, 2014 10:45 PM in response to scottl31

    You're looking at the wrong line. The thing you should be looking for is

     

    dbg: config: using "<your working dir here>" for site rules dir

    dbg: config: read file <your working dir here>/local.cf

     

    As for the latter part, read here https://discussions.apple.com/thread/4481820

  • by scottl31,

    scottl31 scottl31 May 31, 2014 5:29 PM in response to Buckiejoe
    Level 1 (13 points)
    Servers Enterprise
    May 31, 2014 5:29 PM in response to Buckiejoe

    Sorry for being an idiot, but where do I look to fix this? I don't recognize: dbg: config:

     

    Thanks,

    Scott

  • by scottl31,

    scottl31 scottl31 May 31, 2014 5:41 PM in response to Buckiejoe
    Level 1 (13 points)
    Servers Enterprise
    May 31, 2014 5:41 PM in response to Buckiejoe

    Also, I checked that other thread and could not find how to add "junkmail" between the quotes of:

     

    sudo mail:imap:junk_mail_userid = ""

  • by Buckiejoe,

    Buckiejoe Buckiejoe Jun 1, 2014 2:34 AM in response to scottl31
    Level 1 (10 points)
    Jun 1, 2014 2:34 AM in response to scottl31

    That's part of the larger output of

    spamassassin --lint -D

     

    Read through all the lines being output and you will find it. Two lines above will give you a clue to your proper local.cf location.

     

    The other thread mentions that on page 3 or 4, and your command should be preceded with "serveradmin" and other options, not just sudo mail:imap... which makes no sense to the system. Read carefully, you will find the examples there. It should be working by default though. Create a user named junkmail, add it in your IMAP email client and try pasting/dragging some spam message into its inbox. If the message is gone next day from junkmail's inbox then spam training's working proprely and there's no need to assign anything through sudo...

Previous Page 2 of 5 last Next