1 2 3 4 5 Previous Next 74 Replies Latest reply: Jun 12, 2014 4:48 PM by scottl31 Go to original post
  • 15. Re: Where do I configure spamassassin in Mountain Lion Server?
    niwrik Level 1 Level 1 (0 points)

    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...

  • 16. Re: Where do I configure spamassassin in Mountain Lion Server?
    redshift82r Level 2 Level 2 (325 points)

    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

  • 17. Re: Where do I configure spamassassin in Mountain Lion Server?
    Kostas B Level 1 Level 1 (90 points)

    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

  • 18. Re: Where do I configure spamassassin in Mountain Lion Server?
    essandess Level 1 Level 1 (0 points)

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

  • 19. Re: Where do I configure spamassassin in Mountain Lion Server?
    niwrik Level 1 Level 1 (0 points)

    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;)

  • 20. Re: Where do I configure spamassassin in Mountain Lion Server?
    Matt Domenici Level 1 Level 1 (110 points)

    @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?

  • 21. Re: Where do I configure spamassassin in Mountain Lion Server?
    Brian Kendig Level 2 Level 2 (170 points)

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

  • 22. Re: Where do I configure spamassassin in Mountain Lion Server?
    Matt Domenici Level 1 Level 1 (110 points)

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

  • 23. Re: Where do I configure spamassassin in Mountain Lion Server?
    Brian Kendig Level 2 Level 2 (170 points)

    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.

  • 24. Re: Where do I configure spamassassin in Mountain Lion Server?
    Buckiejoe Level 1 Level 1 (0 points)

    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.

  • 25. Re: Where do I configure spamassassin in Mountain Lion Server?
    scottl31 Level 1 Level 1 (5 points)

    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,

  • 26. Re: Where do I configure spamassassin in Mountain Lion Server?
    Buckiejoe Level 1 Level 1 (0 points)

    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

  • 27. Re: Where do I configure spamassassin in Mountain Lion Server?
    scottl31 Level 1 Level 1 (5 points)

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

     

    Thanks,

    Scott

  • 28. Re: Where do I configure spamassassin in Mountain Lion Server?
    scottl31 Level 1 Level 1 (5 points)

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

     

    sudo mail:imap:junk_mail_userid = ""

  • 29. Re: Where do I configure spamassassin in Mountain Lion Server?
    Buckiejoe Level 1 Level 1 (0 points)

    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...