[Dovecot] How to integrate dspam and dovecot
Hello all, I am currently setting up a new mail server with Qmail, OpenLDAP and Dovecot in CentOS-4.4. Qmail version is 1.03, OpenLDAP is 2.3 and Dovecot version is dovecot-1.0-3_50.rc27(RPM). I have successfully installed and tested it. But I have two issues with the current setup:
#1. I am using dovecot LDA and configured the OpenLDAP such that the mail be delivered to the virtual users through a script. This script is saved in /var/qmail/bin/deliver.sh and the contents is as follows: /usr/bin/dspam --stdout --mode=tum --deliver=innocent,spam --feature=chained,noise --user global |/var/qmail/bin/preline -f /usr/libexec/dovecot/deliver -d $RECIPIENT || exit 77
This script name is mentioned in each user's deliveryProgramPath in the LDAP.
I am not sure whether this is the best approach of using dovecot as MDA. I tried to include the following contents in /var/qmail/control/defaultdelivery : |/var/qmail/bin/preline -f /usr/libexec/dovecot/deliver -d $RECIPIENT
But it seems that this is not working as desired. Please comment, if I have gone wrong anywhere.
#2: I wish to use dspam to filter out the spam messages, but I am unsure whether the dspam plugin mentioned in http://johannes.sipsolutions.net/Projects/dovecot-dspam-integration is already in the dspam version I am using. If it's available please give details to configure it.
Kindly share ideas. regards Manilal.
-- Better to light one candle than to curse the darkness. Blog: http://librewings.blogspot.com Blog: http://flossvalley.blogspot.com
On Mon, 2007-04-02 at 12:58 +0530, Manilal K M wrote:
#1. [...]
No idea. Maybe the dspam and/or qmail manual helps?
#2: I wish to use dspam to filter out the spam messages, but I am unsure whether the dspam plugin mentioned in http://johannes.sipsolutions.net/Projects/dovecot-dspam-integration is already in the dspam version I am using. If it's available please give details to configure it.
dspam will never include the plugin, and nor will dovecot since it's just a bridge between the two. You need to read and understand that page and then compile the plugin yourself.
johannes
On 03/04/07, Johannes Berg johannes@sipsolutions.net wrote:
On Mon, 2007-04-02 at 12:58 +0530, Manilal K M wrote:
#1. [...]
No idea. Maybe the dspam and/or qmail manual helps?
#2: I wish to use dspam to filter out the spam messages, but I am unsure whether the dspam plugin mentioned in http://johannes.sipsolutions.net/Projects/dovecot-dspam-integration is already in the dspam version I am using. If it's available please give details to configure it.
dspam will never include the plugin, and nor will dovecot since it's just a bridge between the two. You need to read and understand that page and then compile the plugin yourself.
johannes
Thanks Jonannes for your comments. I am also trying to explore other possibilities.
regards Manilal
Better to light one candle than to curse the darkness. Blog: http://librewings.blogspot.com Blog: http://flossvalley.blogspot.com
On Tue, 2007-04-03 at 10:45 +0530, Manilal K M wrote:
dspam will never include the plugin, and nor will dovecot since it's just a bridge between the two. You need to read and understand that page and then compile the plugin yourself.
johannes
Thanks Jonannes for your comments. I am also trying to explore other possibilities.
Also, I forgot one thing: It's not a plugin for dspam, it's a plugin for dovecot that links dspam to dovecot.
johannes
On 03/04/07, Johannes Berg johannes@sipsolutions.net wrote:
On Tue, 2007-04-03 at 10:45 +0530, Manilal K M wrote:
dspam will never include the plugin, and nor will dovecot since it's just a bridge between the two. You need to read and understand that page and then compile the plugin yourself.
johannes
Thanks Jonannes for your comments. I am also trying to explore other possibilities.
Also, I forgot one thing: It's not a plugin for dspam, it's a plugin for dovecot that links dspam to dovecot.
I know :)
johannes
-- Better to light one candle than to curse the darkness. Blog: http://librewings.blogspot.com Blog: http://flossvalley.blogspot.com
On Tue, 2007-04-03 at 12:21 +0530, Manilal K M wrote:
Also, I forgot one thing: It's not a plugin for dspam, it's a plugin for dovecot that links dspam to dovecot.
I know :)
:)
It seemed you were a bit confused when you asked if it would be included with dspam. FWIW, I'm using it with dspam 3.6.8 from debian. But I have a per-user setup, if you want a virtual user setup you probably need to do a bit more work since the plugin will actually need to call the dspam binary with a --user argument which requires a plugin modification.
I know that some people have done this modification, but I haven't received any patches. If you get it to work a patch would be welcome.
johannes
On 03/04/07, Johannes Berg johannes@sipsolutions.net wrote:
On Tue, 2007-04-03 at 12:21 +0530, Manilal K M wrote:
Also, I forgot one thing: It's not a plugin for dspam, it's a plugin for dovecot that links dspam to dovecot.
I know :)
:)
It seemed you were a bit confused when you asked if it would be included with dspam. FWIW, I'm using it with dspam 3.6.8 from debian. But I have a per-user setup, if you want a virtual user setup you probably need to do a bit more work since the plugin will actually need to call the dspam binary with a --user argument which requires a plugin modification.
I know that some people have done this modification, but I haven't received any patches. If you get it to work a patch would be welcome.
johannes
Basically my primary objective is to prevent spam and today i got an interesting link to it: http://searchenterpriselinux.techtarget.com/tip/0%2C289483%2Csid39_gci123577...
and http://www.oreillynet.com/pub/a/sysadmin/2005/09/15/qpsmtpd.html
I think this method is more reliable since I am playing with a production server.
I will surely try to contribute to dovecot, but there is a long way to go ...
regards Manilal
-- Better to light one candle than to curse the darkness. Blog: http://librewings.blogspot.com Blog: http://flossvalley.blogspot.com
On Tue, 2007-04-03 at 13:38 +0530, Manilal K M wrote:
Basically my primary objective is to prevent spam and today i got an interesting link to it: http://searchenterpriselinux.techtarget.com/tip/0%2C289483%2Csid39_gci123577...
and http://www.oreillynet.com/pub/a/sysadmin/2005/09/15/qpsmtpd.html
Nothing stops you from using that together with dspam to filter everything it let through.
Here's my setup:
In my exim, during SMTP, I check what dspam thinks about the email (if it's directed to a single user and that user has opted in to this service.) Then, if the spamminess of the email is higher than that user's threshold, I fake-reject the email with a message like:
Your email was determined to be spam. Send email to <secret>@<domain> if that wasn't true.
Since it's fake-reject the email body is stilled used, I store it in a database for later.
Then, the mail gets delivered to maildrop for each user, which is globally configured to run dspam if it hasn't been run in the smtp session already. Then, depending on the dspam verdict Spam/Innocent, the mail is sorted into either the SPAM folder or handed to the users filters.
Now the dovecot plugin comes into play. When a user determines that a mail was sorted wrongly, it simply retrains dspam by moving the message into or out of the SPAM folder. This is the great thing about the dspam plugin here.
Mail that has been fake-rejected above is cleaned from the database every 2 weeks or so by a cronjob. If mail is sent to <secret>@<domain>, then that email is rejected with a message saying:
Your previous email has been released and delivered to the original recipient.
Where exactly that happens, and dspam is also trained with that message.
Of course, dovecot is only involved in a tiny step here... dovecot/dspam integration requires my plugin for dovecot, exim/dspam integration is done via that fake spamassassin server for dspam that's also available on my homepage.
johannes
Manilal K M wrote:
On 03/04/07, Johannes Berg johannes@sipsolutions.net wrote:
On Tue, 2007-04-03 at 12:21 +0530, Manilal K M wrote:
Also, I forgot one thing: It's not a plugin for dspam, it's a plugin for dovecot that links dspam to dovecot.
I know :)
:)
It seemed you were a bit confused when you asked if it would be included with dspam. FWIW, I'm using it with dspam 3.6.8 from debian. But I have a per-user setup, if you want a virtual user setup you probably need to do a bit more work since the plugin will actually need to call the dspam binary with a --user argument which requires a plugin modification.
I know that some people have done this modification, but I haven't received any patches. If you get it to work a patch would be welcome.
johannes
Basically my primary objective is to prevent spam and today i got an interesting link to it: http://searchenterpriselinux.techtarget.com/tip/0%2C289483%2Csid39_gci123577...
and http://www.oreillynet.com/pub/a/sysadmin/2005/09/15/qpsmtpd.html
I think this method is more reliable since I am playing with a production server.
I will surely try to contribute to dovecot, but there is a long way to go ...
regards Manilal
I've had several setups for SPAM/Virus handling in qmail servers,
and the best solution so far was a combination of simscan + dspam + clamav. All the other qmail-queue replacements i've tried, including qpsmtpd, where just too expensive regarding system resources. Most solutions involving perl will simply not do, at least for me, on account of perl overhead.
Right now i have several production environments, one of which is
rather large, and i've been rather happy with the implementation outcome. That setup includes qmail-ldap with some patches for greylisting and greeting delay, simscan with a patch to handle dspam internal quarantine engine, dspam with a patch to allow user checking/address alias mapping, clamav, maildrop for server side filtering and finally dovecot with Johannes dspam plugin.
Besides the regular locations for all that software, you might
consider taking a look at the set of patches i mentioned. The link is http://pessoa.fct.unl.pt/hmmm/files/anti-spam/
Regards,
Hugo Monteiro.
-- ci.fct.unl.pt:~# cat .signature
Hugo Monteiro Email : hugo.monteiro@fct.unl.pt Telefone : +351 212948300 Ext.15307
Centro de Informática Faculdade de Ciências e Tecnologia da Universidade Nova de Lisboa Quinta da Torre 2829-516 Caparica Portugal Telefone: +351 212948596 Fax: +351 212948548 www.ci.fct.unl.pt apoio@fct.unl.pt
ci.fct.unl.pt:~# _
On Tue, Apr 03, 2007 at 12:15:38PM +0100, Hugo Monteiro wrote:
I've had several setups for SPAM/Virus handling in qmail servers,
and the best solution so far was a combination of simscan + dspam + clamav. All the other qmail-queue replacements i've tried, including qpsmtpd, where just too expensive regarding system resources.
Note that qpsmtpd is more of a qmail-smtpd replacement than a qmail-queue replacement.
Most solutions involving perl will simply not do, at least for me, on account of perl overhead.
Well, a theory is that the resources saved by rejecting more spam will more than offset the resources used by the perl interpreter.
There are, of course, non-perl qmail-smtpd replacements, including my own :-) But qpsmtpd has a lot of momentum and you gain from that.
mm (not really here nor there)
participants (4)
-
Hugo Monteiro
-
Johannes Berg
-
Manilal K M
-
Mark E. Mallett