On 01/18/2011 08:41 PM, J4 wrote: > On 01/18/2011 07:54 PM, J4 wrote: >> On 01/18/2011 06:51 PM, Patrick Ben Koetter wrote: >>> * J4 <ju...@klunky.co.uk>: >>>> This is pretty much what I would like to achieve, & the reason I >>>> decided not to use Dovecot Sieve (apart from me being incapable of >>>> setting it. ;) ). >>>> >>>> Parse the SPAM during the SMPT session and use only RAM: Perfect. >>>> >>>> I would still like to notify the connecting SMTP client with a reject >>>> message. Real spammers are uninterested anyway, but legitimate >>>> e-mailers would be, although this is not essential to let them know. >>> spamassassin can make Postfix REJECT clients in session if you integrate >>> Spamassassin using a MILTER or amavis. Your master.cf excert below indicates >>> you are not running Spamassassin in SMTP session, but after the mail has >>> been >>> accepted. >>> >>> If you only want to identify and reject spam use a Spamassassin Milter >>> interface. There are several out there. See section "Integrated into >>> Sendmail" >>> in http://wiki.apache.org/spamassassin/IntegratedInMta. >>> >>> If you need more, go for amavis. >>> >>> Which plattform are you on? >>> >>> p@rick >>> >> Hi Patrick, >> >> I'm on Debian Squeeze. > Right folks! I did all of this: > > # spamass-milter -m -u nobody -f -p /var/run/spamass.sock > # chown postfix.postfix /var/run/spamass.sock > # spamass-milter -m -u nobody -f -p /var/spool/postfix/var/run/spamass.sock > # chown postfix.postfix /var/spool/postfix/var/run/spamass.sock > # ls -l /var/spool/postfix/var/run/spamass.sock > srwxr-x--- 1 postfix postfix 0 Jan 18 20:13 > /var/spool/postfix/var/run/spamass.sock > > 2 sockets are used above because someone else (thanks Google) wrote that > that postfix chroots. Also, I added the above into an init.d script to > be run at a reboot as the sockets might get lost. > > > Added this into /etc/postfix/main.cf:- > ### spamassassin-milter > milter_default_action = accept # accept is for testing > smtpd_milters = unix:/var/run/spamass.sock > > > /etc/default/spamass-milter contains this: > OPTIONS="-u nobody -m -r 15 -i 127.0.0.1 -f -p > /var/spool/postfix/var/run/spamass.sock" > SOCKET="/var/spool/postfix/spamass/spamass.sock" > SOCKETOWNER="postfix:postfix" > SOCKETMODE="0660" > > > Restarted spamass-milter, but got some horrid messages: > # /etc/init.d/spamass-milter restart > Restarting Sendmail milter plugin for SpamAssassin: Jan 18 20:30:20 > logout spamass-milter[29969]: spamass-milter 0.3.1 starting > Jan 18 20:30:20 logout spamass-milter[29969]: SpamAssassin: Unable to > bind to port /var/spool/postfix/var/run/spamass.sock: Permission denied > Jan 18 20:30:20 logout spamass-milter[29969]: SpamAssassin: Unable to > create listening socket on conn /var/spool/postfix/var/run/spamass.sock > Jan 18 20:30:20 logout spamass-milter[29969]: spamass-milter 0.3.1 exiting > chmod: cannot access `/var/spool/postfix/spamass/spamass.sock': No such > file or directory > All a bit odd, so deleted the sockets & tried to restart spamass-milter, > and had the same error message. > So, I deleted the two sockets, and then created these again but left off > the chmod bits: > # spamass-milter -m -u nobody -f -p /var/run/spamass.sock > Jan 18 20:38:15 logout spamass-milter[30026]: spamass-milter 0.3.1 starting > # spamass-milter -m -u nobody -f -p /var/spool/postfix/var/run/spamass.sock > Jan 18 20:38:26 logout spamass-milter[30032]: spamass-milter 0.3.1 starting > Next I restarted spamass-milter, but had exactly the same messages. > > > > All of the above taken from a guide on the Internet... which says > something out users not being able to follow simple copy & paste > instructions... :-D > Double post, but added to this Patrick's replies that got it working so that there is a solution for others in years to come: Patrick Ben Koetter wrote:
# apt-get install spamass-milter Then edit /etc/default/spamass-milter and check the SOCKET* options at the bottom of the file. After that restart spamass-milter and verify the SOCKET was created e.g. in /var/spool/postfix/spamass/spamass.sock. Then configure Postfix to use that socket in main.cf using the smtpd_milters parameter e.g. like this: smtpd_milters = unix:/spamass/spamass.sock The example above assumes you run Postfix chrooted, which is default on Debian systems. Now reload Postfix and try to send a GTUBE spam test pattern in a telnet session from a client that is not part of the network you defined with the "-i" option in /etc/default/spamass-milter. Your message should be rejected in session. p@rick ----- J4 wrote some time: That worked. Thank-you Patrick:- Modified the default milter action in mail.cf: milter_default_action = tempfail # /etc/init.d/spamass-milter restart Restarting Sendmail milter plugin for SpamAssassin: No /usr/sbin/spamass-milter found running; none killed. Jan 18 21:01:05 logout spamass-milter[30261]: spamass-milter 0.3.1 starting spamass-milter GTUBE test message from http://gtube.net/gtube.txt produced:- Jan 18 21:06:45 logout postfix/cleanup[30304]: 7F8DE8232B: milter-reject: END-OF-MESSAGE from smtp-auth.no-ip.com[204.16.252.94]: 5.7.1 Blocked by SpamAssassin; from=<j...@klunky.co.uk> to=<t...@abc.info> proto=ESMTP helo=<smtp-auth.no-ip.com> What is interesting, is that a reject message sent back to the SMTP client no-ip.com in this case. I suppose it was a 5** type message. is there way to enable this?