Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Enabling spamassassin for Postfix's local mail
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
JC Denton
Apprentice
Apprentice


Joined: 16 Apr 2003
Posts: 151
Location: USA

PostPosted: Thu Jan 12, 2006 11:52 pm    Post subject: [SOLVED] Enabling spamassassin for Postfix's local mail Reply with quote

I've been running Postfix with Spamassassin for awhile now. Here are the relevant snips from my master.cf:
Code:
smtp      inet  n       -       n       -       -       smtpd -o content_filter=spamassassin
smtp      unix  -       -       n       -       -       smtp -o content_filter=spamassassin

Code:
spamassassin
          unix  -       n       n       -       -       pipe
   user=admin argv=/usr/local/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

The problem with this setup is, it doesn't do local filtering. When Joe Bob on the system mails John Doe with 'mail,' or 'mutt,' it doesn't pass through spamassassin. I tried adding the '-o content_filter' setting to the 'local' service, but that didn't seem to work. Now I'll admit, I haven't read most of the Postfix manual, it's huge after all ;). If I have to grin and bear it, I can do that. Although I'd like to ask my fellow Gentoo users for assistance first.

Your help, as always, is appreciated :).


Last edited by JC Denton on Sun Jan 15, 2006 11:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
JC Denton
Apprentice
Apprentice


Joined: 16 Apr 2003
Posts: 151
Location: USA

PostPosted: Sat Jan 14, 2006 11:53 pm    Post subject: Reply with quote

Bump.
Back to top
View user's profile Send private message
adsmith
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1386
Location: NC, USA

PostPosted: Sun Jan 15, 2006 2:38 am    Post subject: Reply with quote

I have exactly the same setup. I guess I never saw this behavior as a problem.

My first guess was the thing you already tried, but of course it doesn't work because of the delivery flowchart of postfix.

The only other thing I can recommend is to very carefully read the documentation at http://www.postfix.org/documentation.html.
Back to top
View user's profile Send private message
JC Denton
Apprentice
Apprentice


Joined: 16 Apr 2003
Posts: 151
Location: USA

PostPosted: Sun Jan 15, 2006 6:26 am    Post subject: Reply with quote

adsmith wrote:
I have exactly the same setup. I guess I never saw this behavior as a problem.

My first guess was the thing you already tried, but of course it doesn't work because of the delivery flowchart of postfix.

The only other thing I can recommend is to very carefully read the documentation at http://www.postfix.org/documentation.html.

Got it to work :). I had to use SpamPD. The spamc/spamd setup won't filter mail sent via the local Postfix sendmail command.

There's an extra catch though. SpamPD can't handle TLS. If you have smtpd_use_tls = yes, then it will try to talk TLS with SpamPD, crashing the smtpd program. There's a workaround though, since some of us like our encrypted mail ;). The smtp_tls_per_site directive allows a DB file to be specified. In that file, you can set "use no TLS with this host" for 127.0.0.1.

Hope this helps some folks...
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Sun Jan 15, 2006 5:54 pm    Post subject: Reply with quote

This seems a lot of work to make sure local users don't spam each other. Clearly the sendmail binary just drops the messages into the Postfix maildrop queue, so SA won't see them. Why not invoke SA by using procmail or maildrop? This would ensure all messages are scanned as they are delivered to the mailbox.
Back to top
View user's profile Send private message
JC Denton
Apprentice
Apprentice


Joined: 16 Apr 2003
Posts: 151
Location: USA

PostPosted: Sun Jan 15, 2006 11:11 pm    Post subject: Reply with quote

magic919 wrote:
This seems a lot of work to make sure local users don't spam each other. Clearly the sendmail binary just drops the messages into the Postfix maildrop queue, so SA won't see them. Why not invoke SA by using procmail or maildrop? This would ensure all messages are scanned as they are delivered to the mailbox.

I considered that, but really SpamPD seemed like a better solution. There are times when spamd crashes, and the message just bounces. With the SA proxy, the message will be queued. I'm currently using maildrop to invoke spamprobe though. Good stuff :).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum