Postfix + SpamAssassin with SPAM Quarantine

Talk about any thing that related to networking, running servers with *nux.

Moderator: kalinga

Postby pjv » Thu Aug 02, 2007 1:08 pm

This is the spamfilter's code :

Code: Select all
#! /bin/bash/
/usr/bin/spamassassin|/usr/sbin/sendmail -i "$@"
exit $?


I do not use SpamAssassin with SPAM Quarantine
pjv
 
Posts: 7
Joined: Wed Aug 01, 2007 9:56 pm
Location: France

Postby kalinga » Thu Aug 02, 2007 2:21 pm

1. your missing space on your code

[/code]

/usr/bin/spamassassin|/usr/sbin/sendmail -i "$@"

Code: Select all

should be as



/usr/bin/spamassassin | /usr/sbin/sendmail -i "$@"

Code: Select all

need space between the "|"

also check if you have spamassassin at the location

[code]
/usr/bin/spamassassin
[/code]
kalinga
Site Admin
 
Posts: 209
Joined: Fri Oct 14, 2005 3:19 pm
Location: Sri Lanka

Postby pjv » Thu Aug 02, 2007 2:31 pm

the spaces do not change anything and Spamassassin looks well installed and loaded... :(

edit :

If I comment this line :

/etc/postfix/master.cf
Code: Select all
smtp      inet  n       -       n       -       -       smtpd
#        -o content_filter=spamfilter:dummy

All works fine, but mails are not tested by spamassassin
pjv
 
Posts: 7
Joined: Wed Aug 01, 2007 9:56 pm
Location: France

Postby kalinga » Thu Aug 02, 2007 2:53 pm

what about script permissions ?

1.

# spamassassin --lint
# spamassassin --lint -D


2.

make sure you have spamassassin at

/usr/bin/spamassassin


if every things seems ok

then you may want to try this

First, edit /etc/postfix/master.cf, find the

change this line

Code: Select all
smtp      inet  n       -       n       -       -       smtpd


to

Code: Select all
smtp      inet  n       -       n       -       -       smtpd
    -o content_filter=spamassassin



then add the following lines

Code: Select all
spamassassin
          unix  -       n       n       -       -       pipe
          user=nobody argv=/usr/bin/spamassassin -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}



make sure to put all of them as one line
kalinga
Site Admin
 
Posts: 209
Joined: Fri Oct 14, 2005 3:19 pm
Location: Sri Lanka

Postby pjv » Thu Aug 02, 2007 3:20 pm

1.
Code: Select all
/home/install# spamassassin --lint
/home/install# spamassassin --lint -D
[28992] dbg: logger: adding facilities: all
[...]
[28992] dbg: check: subtests=__HAS_MSGID,__MSGID_OK_DIGITS,__MSGID_OK_HOST,__NONEMPTY_BODY,__SANE_MSGID,__UNUSABLE_MSGID


Do you want to see all logs ?

2. Permissions :
Code: Select all
/home/install# ll /usr/local/bin/spamfilter
-rwxr-xr-x 1 spamfilter staff 73 2007-08-02 10:30 /usr/local/bin/spamfilter


3. Spamassassin :
Code: Select all
/home/install# ll /usr/bin/
[...]
-rwxr-xr-x 1 root root      25187 2007-02-15 06:28 spamassassin
[...]


It's still not working.

4. master.cf

Code: Select all
Aug  2 11:15:12 ### postfix/pipe[29935]: 02B3037A4A: to=<postmaster@###.###>, relay=spamassassin, delay=31, delays=31/0/0/0.3, dsn=5.3.0, status=bounced (command line usage error. Command output: [29936] warn: Unknown option: o [29936] warn: Unknown option: i [29936] warn: Unknown option: f Usage:     spamassassin [options] [ < mailmessage | path ... ]      spamassassin -d [ < mailmessage | path ... ]      spamassassin -r [ < mailmessage | path ... ]      spamassassin -k [ < mailmessage | path ... ]      spamassassin -W|-R [ < mailmessage | path ... ]      Options:       -L, --local                       Local tests only (no online tests)      -r, --report                      Report message as spam      -k, --revoke                      Revoke message as spam      -d, --remove-markup               Remove spam reports from a message      -C path, --configpath=path, --config-file=path                                        Path to standard configuration dir      -p prefs, --prefspath=file, --prefs-file=fi


I've the same problem with a pipe like this
Code: Select all
argv=/usr/bin/spamassassin -e | /usr/sbin/sendmail -oi -f ${sender} ${recipient}


:(
pjv
 
Posts: 7
Joined: Wed Aug 01, 2007 9:56 pm
Location: France

Postby kalinga » Thu Aug 02, 2007 3:29 pm

instead of

/usr/sbin/sendmail

user

/usr/sbin/sendmail.postfix
kalinga
Site Admin
 
Posts: 209
Joined: Fri Oct 14, 2005 3:19 pm
Location: Sri Lanka

Postby pjv » Thu Aug 02, 2007 3:44 pm

kalinga wrote:instead of

/usr/sbin/sendmail

user

/usr/sbin/sendmail.postfix


Still nothing...

I'm reinstalling postfix, spamassassin, etc.

Maybe, it could work...
Last edited by pjv on Thu Aug 02, 2007 3:51 pm, edited 1 time in total.
pjv
 
Posts: 7
Joined: Wed Aug 01, 2007 9:56 pm
Location: France

Postby kalinga » Thu Aug 02, 2007 3:51 pm

seems your issue is with spamassasin, i just did a test with all the above and it works fine for me.

did you start spamd ?
kalinga
Site Admin
 
Posts: 209
Joined: Fri Oct 14, 2005 3:19 pm
Location: Sri Lanka

Postby pjv » Thu Aug 02, 2007 4:11 pm

Spamd is started.

I installed all the application on my own computer for testing and it worked fine.
Now, on the server, it doesn't work.
I don't understand why.

I use Debian Etch 4.0. I'm trying to reinstall everything on my own computer.

Thank you for your help
pjv
 
Posts: 7
Joined: Wed Aug 01, 2007 9:56 pm
Location: France

Postby kalinga » Fri Aug 03, 2007 9:07 am

try to use up2date ver, from the last error it seems like a sendmail error. hmm funny !
kalinga
Site Admin
 
Posts: 209
Joined: Fri Oct 14, 2005 3:19 pm
Location: Sri Lanka

Postby kalinga » Fri Aug 03, 2007 9:13 am

P.S.

did you try the original ver of the script ?

http://onetforum.com/fourm/viewtopic.php?t=26
kalinga
Site Admin
 
Posts: 209
Joined: Fri Oct 14, 2005 3:19 pm
Location: Sri Lanka

Postby pjv » Sun Aug 05, 2007 5:55 pm

After a re-re-re-re-...-installation, postfix and spamassassin work well. I don't understand...

thank you for your help ! :D
pjv
 
Posts: 7
Joined: Wed Aug 01, 2007 9:56 pm
Location: France

Postby kalinga » Tue Aug 07, 2007 1:19 pm

good to know that you got it to work, must be an issue with spamassassin, cant be postfix,
kalinga
Site Admin
 
Posts: 209
Joined: Fri Oct 14, 2005 3:19 pm
Location: Sri Lanka

Postby adamsargant » Sat Nov 03, 2007 6:01 pm

I've got spamassassin working a treat with this script, but I now want to change the spamlimit to 6... I've done this in the script and I've restarted spamassassin and postfix, but the limit seems unchanged (when I check email headers they tell me under X-Spam_Status that 5 is still required... how do I get the change in spamlimit value to register properly?
adamsargant
 
Posts: 2
Joined: Sat Nov 03, 2007 5:55 pm

Postby kalinga » Mon Nov 05, 2007 8:16 am

hi,

for this first you need to set spamassassin level from the local.cf "required_hits 6" file at /etc/mail/spamassassin in most cases.

after that you need to set the script as well "SPAMLIMIT=6"
kalinga
Site Admin
 
Posts: 209
Joined: Fri Oct 14, 2005 3:19 pm
Location: Sri Lanka

PreviousNext

Return to Linux - Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron