[Dovecot] Dovecot Antispam Problem (Using mail sending backend)
I'm trying to setup DSPAM training using the mail-sending backend of the Antispam filter, unfortunately, things don't appear to be working.
I've compiled it against the debian etch dovecot libraries, and the plugin itself builds, and doesn't report any errors when running. As a matter of fact, it doesn't report ANYTHING when running, except for the initialization code (DEBUG=syslog):
imap: antispam: plugin initialising imap: antispam: "trash" is trash folder imap: antispam: "Trash" is trash folder imap: antispam: "Deleted Items" is trash folder imap: antispam: "spam" is spam folder imap: antispam: "Spam" is spam folder imap: antispam: "SPAM" is spam folder imap: antispam: "junk" is spam folder imap: antispam: "Junk" is spam folder imap: antispam: "Junk Mail" is spam folder imap: antispam: no unsure folders imap: antispam: mail backend spam address dspam-add@xxx.yyy imap: antispam: mail backend not-spam address dspam-fp@xxx.yyy imap: antispam: mail backend sendmail /usr/sbin/sendmail imap: antispam: mail backend tmpdir /tmp
....
And that's it. I never hear from the plugin again, regardless of how many times I create/delete the SPAM folder, or how many times I move/copy into/out of the folder. The plugin is basically silent. I don't see the mails being sent/recieved, so I'm assuming that's it isn't doing anything at all.
I can manually use the training addresses, so I know they're working. Any help would be appreciated.
-Justin R.
Just to get more information...
If I change the email accounts in dovecot.conf from dspam-add@xxx.yy to my own personal account (hosted off-site), the emails ARE getting forwarded.
If I go into the console and do "cat <mail file> | /usr/sbin/sendmail dspam-add@xxx.yyy" then dspam DOES detect and properly retrain.
But, when I set the antispam email address to dspam-add@xxx.yyy, I see nothing in the logs to indicate that any messages are being sent.
-J
Any ideas would be greatly appreciated on this one...
On 12/10/07, Justin Refice justin@refice.net wrote:
I'm trying to setup DSPAM training using the mail-sending backend of the Antispam filter, unfortunately, things don't appear to be working.
I've compiled it against the debian etch dovecot libraries, and the plugin itself builds, and doesn't report any errors when running. As a matter of fact, it doesn't report ANYTHING when running, except for the initialization code (DEBUG=syslog):
imap: antispam: plugin initialising imap: antispam: "trash" is trash folder imap: antispam: "Trash" is trash folder imap: antispam: "Deleted Items" is trash folder imap: antispam: "spam" is spam folder imap: antispam: "Spam" is spam folder imap: antispam: "SPAM" is spam folder imap: antispam: "junk" is spam folder imap: antispam: "Junk" is spam folder imap: antispam: "Junk Mail" is spam folder imap: antispam: no unsure folders imap: antispam: mail backend spam address dspam-add@xxx.yyy imap: antispam: mail backend not-spam address dspam-fp@xxx.yyy imap: antispam: mail backend sendmail /usr/sbin/sendmail imap: antispam: mail backend tmpdir /tmp
....
And that's it. I never hear from the plugin again, regardless of how many times I create/delete the SPAM folder, or how many times I move/copy into/out of the folder. The plugin is basically silent. I don't see the mails being sent/recieved, so I'm assuming that's it isn't doing anything at all.
I can manually use the training addresses, so I know they're working. Any help would be appreciated.
-Justin R.
On Monday 10 December 2007 15:10:05 Justin Refice wrote:
And that's it. I never hear from the plugin again, regardless of how many times I create/delete the SPAM folder, or how many times I move/copy into/out of the folder. The plugin is basically silent. I don't see the mails being sent/recieved, so I'm assuming that's it isn't doing anything at all.
I can manually use the training addresses, so I know they're working. Any help would be appreciated.
I do not know if this will help you or not but for some reason I could not use sendmail. The training emails looped forever. My setup is probably weird but I was able to get around the problem by using mailx:
antispam_mail_spam = spam-%u
antispam_mail_notspam = notspam-%u
#antispam_mail_sendmail = /usr/sbin/sendmail
antispam_mail_sendmail = /usr/bin/mailx
Jim-
Thanks for the advice, but that didn't quite work. It's worth noting that if I call sendmail manually, the message goes through w/o a problem. It only seems to be when the antispam plugin calls sendmail that we run into a problem...
-J
On 12/10/07, Jim Horner jhorner@arinbe.com wrote:
On Monday 10 December 2007 15:10:05 Justin Refice wrote:
And that's it. I never hear from the plugin again, regardless of how many times I create/delete the SPAM folder, or how many times I move/copy into/out of the folder. The plugin is basically silent. I don't see the mails being sent/recieved, so I'm assuming that's it isn't doing anything at all.
I can manually use the training addresses, so I know they're working. Any help would be appreciated.
I do not know if this will help you or not but for some reason I could not use sendmail. The training emails looped forever. My setup is probably weird but I was able to get around the problem by using mailx:
antispam_mail_spam = spam-%u antispam_mail_notspam = notspam-%u #antispam_mail_sendmail = /usr/sbin/sendmail antispam_mail_sendmail = /usr/bin/mailx
on 12/12/2007 6:52 AM Justin Refice spake the following:
Jim-
Thanks for the advice, but that didn't quite work. It's worth noting that if I call sendmail manually, the message goes through w/o a problem. It only seems to be when the antispam plugin calls sendmail that we run into a problem...
-J
On 12/10/07, Jim Horner jhorner@arinbe.com wrote:
On Monday 10 December 2007 15:10:05 Justin Refice wrote:
And that's it. I never hear from the plugin again, regardless of how many times I create/delete the SPAM folder, or how many times I move/copy into/out of the folder. The plugin is basically silent. I don't see the mails being sent/recieved, so I'm assuming that's it isn't doing anything at all.
I can manually use the training addresses, so I know they're working. Any help would be appreciated.
I do not know if this will help you or not but for some reason I could not use sendmail. The training emails looped forever. My setup is probably weird but I was able to get around the problem by using mailx:
antispam_mail_spam = spam-%u antispam_mail_notspam = notspam-%u #antispam_mail_sendmail = /usr/sbin/sendmail antispam_mail_sendmail = /usr/bin/mailx
does the anti-spam plugin run as a non-root user? Or dovecot? Maybe you need to add that user to trusted users in sendmail. It works from commandline because root is already a trusted user.
-- MailScanner is like deodorant... You hope everybody uses it, and you notice quickly if they don't!!!!
does the anti-spam plugin run as a non-root user?
yes, it always runs as the user you're logged in as.
Or dovecot?
Mostly not.
Maybe you need to add that user to trusted users in sendmail. It works from commandline because root is already a trusted user.
Interesting, my exim's sendmail works for all users.
johannes
does the anti-spam plugin run as a non-root user?
yes, it always runs as the user you're logged in as.
Or dovecot?
Mostly not.
Maybe you need to add that user to trusted users in sendmail. It works from commandline because root is already a trusted user.
Interesting, my exim's sendmail works for all users.
johannes Actual sendmail only lets the trusted users send mail with a different "from"
on 12/12/2007 9:18 AM Johannes Berg spake the following: than the user running the command. So if user "x" is trying to send something but trying to say it is from user "y" (maybe postmaster), sendmail won't allow it unless user "x" is in trusted users.
-- MailScanner is like deodorant... You hope everybody uses it, and you notice quickly if they don't!!!!
Actual sendmail only lets the trusted users send mail with a different "from" than the user running the command. So if user "x" is trying to send something but trying to say it is from user "y" (maybe postmaster), sendmail won't allow it unless user "x" is in trusted users.
Hmm, mine doesn't check the "From:" header line but rather the envelope sender which we don't set (so the local user should be used)
johannes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 12 Dec 2007, Johannes Berg wrote:
Hmm, mine doesn't check the "From:" header line but rather the envelope sender which we don't set (so the local user should be used)
Real sendmail is not interessted in the mail data, but envelope data only.
I had a problem with sendmail running from Dovecot's Sieve implemenation, the basic points were:
First the path to sendmail was screwed up, the binary wasn't found at all. Later I added strace and some other programs to deliver in order to see what's going on, which in turn prevents sendmail to setguid- (or setuid-) to smmsp (or whatever uid/gid the sendmail MSP client is running under) and, hence, it had no access to the client queue.
Some distributions limit sendmail to certain user groups.
BTW: Did you wrapped to call to sendmail with a script in order to capture "id" information and the stderr of sendmail and, probably, its exitcode or kill-signal?
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBR2Dn6y9SORjhbDpvAQKdxwf+O0Sqn6P/TkUCUNpz8p67i7EC4H7rYwYi /kQRHg8vBLPaNL43qnp45mmyBZ9JYuSEMZ8rVED0t8Wvh6+4ip8eryBma5pujEDs G8z4v0eVjzjbsXR14WaW5Y9QcOP/EL+k7314MmllIjrSdaRMJO8UKz2xoZc2x7Bt P8OFDH9JJwEevbwlsSX2iQo5VcpbpAJUAKWX8f/tRpikdwzrompvI4kQkM4ORLtQ 3d1zXH4vH1E+f4cdBk4AzsquAHGWjYu250F/2TVrygk3ZkZz6dekuflX6aSiAkDW bLeZgsXenZeYpeMcBnsbn40JHxb0vj8zdTDl9RD2IAj4mCAmoeFybQ== =awvM -----END PGP SIGNATURE-----
Hi,
Can you maybe insert some debug() statements, e.g.
debug("%s %s", sendmail_binary, dest);
before dup2(mailfd, 0); in mailtrain.c
johannes
participants (5)
-
Jim Horner
-
Johannes Berg
-
Justin Refice
-
Scott Silva
-
Steffen Kaiser