You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

Reply
74 replies

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

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:


User uploaded file


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

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.

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.

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,

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

Jun 1, 2014 10:27 AM in response to Buckiejoe

Thanks for your patience and your help as as it seems these two items are related.


1. So I found the two lines, but they aren't looking in "/etc/mail/spamassassin/local.cf" like you said. Here they are, should they be changed? If so, how?:


Jun 1 09:10:13.045 [49258] dbg: config: using "/Library/Server/Mail/Config/spamassassin" for site rules dir

Jun 1 09:10:13.045 [49258] dbg: config: read file /Library/Server/Mail/Config/spamassassin/local.cf


2. I have already created the junkmail account and was feeding it via POP. After weeks of doing so, there seemed to be no difference in the spam. So I made an IMAP account in apple mail and found it a lot easier to feed messages to. But still no letup in the spam, and never any messages marked ***Junk***. In both cases the messages were gone from the account the next day. This is why I thought I needed to have junkmail inside the quotes in "mail:imap:junk_mail_userid = """


Although it "seems" to be working, my boss still gets about 400 spams a day. I just thought it wasn't working because of your info above that it may be the wrong path we are using.


Thanks again for your help,

Scott

Where do I configure spamassassin in Mountain Lion Server?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.