spamassassin-users January 2011 archive
Main Archive Page > Month Archives  > spamassassin-users archives
spamassassin-users: Re: NOW: spamass-milter postfix Debian (WAS

Re: NOW: spamass-milter postfix Debian (WAS: Q about short-circuit over ruling blacklisting rule)

From: Robert Schetterer <robert_at_nospam>
Date: Wed Jan 19 2011 - 09:00:14 GMT
To: users@spamassassin.apache.org

Am 18.01.2011 20:41, schrieb J4:
> On 01/18/2011 07:54 PM, J4 wrote:
>>
>> On 01/18/2011 06:51 PM, Patrick Ben Koetter wrote:
>>> * J4 <junk4@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
>
>

jeah the pack is somehow buggy on debian/ubuntu
fixing this bored me

i fixed it with empty
/etc/default/spamass-milter

and used this in /etc/init.d/spamass-milter

PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=spamass-milter
DAEMON=/usr/sbin/spamass-milter
SOCKET=/var/spool/postfix/spamass-milter/spamass.sock
PIDFILE=/var/spool/postfix/spamass-milter/spamass.pid
DESC="Sendmail milter plugin for SpamAssassin"

OPTIONS="-f -e -x -I -u vmail -r 15 -i 127.0.0.1"
RUNAS="postfix"
CHUID=""
SOCKETMODE="0660"
SOCKETOWNER="postfix:postfix"

options and user may differ at your side !

this leads
to
/usr/sbin/spamass-milter -P
/var/spool/postfix/spamass-milter/spamass.pid -f -p
/var/spool/postfix/spamass/spamass.sock -f -e -x -I -u vmail -r 15 -i
127.0.0.1

main.cf

smtpd_milters = unix:/var/run/clamav/clamav-milter.ctl,
inet:localhost:8891, unix:/var/spool/postfix/spamass/spamass.sock
non_smtpd_milters = unix:/var/run/clamav/clamav-milter.ctl,
inet:localhost:8891, unix:/var/spool/postfix/spamass/spamass.sock

-- Best Regards MfG Robert Schetterer Germany/Munich/Bavaria