What is the best server-side mail filtering setup?
Posted by Alex on Thu 15 Sep 2005 at 08:49
Following on from the procmail article, I wondered what solutions people are using for filtering their email at the server level, and for updating the rules?
A little background:
My email server used to be a Windows 2003/Exchange 2003 box (behind a Linux gateway of course) and now it's a hosted Debian Linux box running Postfix/Dovecot/Procmail/Squirrelmail, and constantly keeping my procmail rules updated is a chore, as well as being awkward for my users.
The feature I miss most about the Windows/Exchange combo is that I could set rules in Outlook (or via Webmail) and they would automatically replicate to the server.
The big question is, how do I go about replicating that functionality?
I've looked at web-sieve, but there's no sieve support in dovecot, and the squirrelmail and IMP plugins seem a little clunky.
I currently use Thunderbird as my client and my ideal solution would be a Thunderbird plugin that can upload my rules to the server automatically.
I run a similar setup using Exim4/dovecot and reading my mail with Thunderbird and Squirrelmail (when away).
While Thunderbird has a nice filter system, which I really like to use, it is only client based. So, when reading new mail with Squirrelmail I have all my new mail, mailinglists a.s.o. cluttered in my Inbox.
Since there is no Sieve support in dovecot, the only thing I can come up with is filtering by Exim4.
Does anybody have a better solution?
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
I'm afraid that I've been in the similar position for a while - but my solution is to use procmail.
I've seen a couple of plugins for squirrelmail which do server-side filtering, such as Server Side Filter. I just grit my teeth and resign myself to connecting via ssh and updating my ~/.procmailrc file by hand when I join new mailing lists.
I hope that at some point exim and postfix will gain Sieve support. But I've no idea whether that is likely or not.
Steve
--
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
[ Parent | Reply to this comment ]
Dovecot has experimental support for seive with it's new LDA deliver (http://wiki.dovecot.org/moin.cgi/LDA) but it's bleeding edge and needs to be compiled, but it looks promising.
The problem with using procmail and connecting via ssh is that I have to give all mail users shell/ftp access to update their rules.
Is there anything like timesieved available seperately that I might be able to use? Any web-based interfaces that I can offer my users?
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
There are a couple of web-based sieve filters listed on the sieve homepage, although I've not used any of them.
Steve
--
[ Parent | Reply to this comment ]
I'm having problems with the redirect statement of sieve. Please have a look at:
http://www.dovecot.org/list/dovecot/2005-September/009140.html
Rudy Gevaert AT UGent remove_this DOT be
[ Parent | Reply to this comment ]
Dead easy to setup.
Simply use .forward for the user account(s) that want server based forward.
A modified example of my .forward
# Exim filter
if $header_subject: contains "[Spam]"
then
save $home/mail/Spam
elif $header_subject: contains "[Yahoo group]"
then
save $home/mail/yahoo-group
elif $header_subject: contains "[family]"
then
save $home/mail/family
endif
/Martin Forest
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
I have the same problem as you have, the problem is probably quite universal. Server-side filtering is great, but how do you allow people to set things up -- in a userfriendly way, too -- on the server...
I believe sieve support will be added to Dovecot, I seem to remember a discussion about it on the mailing list.
For now, you could write a simple web interface to the procmail file... Or check all squirrelmail plugins, there might be some that can help you with procmail and sieve scripts.
If I remember correctly, Kmail has sieve support, although I never used it.
Also check if any users are using remote filtering or would be interested in doing so, most people don't even know about setting up filtering rules. If it's just for you, perhaps ssh with a simple procmail edit will do?
[ Parent | Reply to this comment ]
> I have the same problem as you have, the problem is probably quite universal.
> Server-side filtering is great, but how do you allow people to set things up
> -- in a userfriendly way, too -- on the server...
Try the Courier. It provides ESMTP, IMAP, POP3, webmail, and mailing list services
within a single, consistent, framework. The webmail has a mail filtering feature which
uses server-side maildrop filters. The users can create/edit/delete mail filters
via web interface.
My best regards!
P.
[ Parent | Reply to this comment ]
- Verify the sender address with a callout (try to send an email to From without really sending it). That's the most efficient spam filter, but it costs.
- Use clamav and mark the subject of the emails containing viruses
- Use spamassassin and mark the emails containing spam
- In spamassin, I use rulesDuJour to keep some additional filters updated automatically.
- Then, I have a procmail script to put the spam/viruses in a special folders for each users
- To do some stats about all that, I have a homemade perl script that runs weekly
[ Parent | Reply to this comment ]
My solution right now is:
Debian (of course)
Postfix with virtual domains/mailboxes in mysql
Courier imap/pop3/imaps/pop3s with the same mysql database for auth and path storage
Courier Maildrop for serverside filtering.
I wrote a small php webapp that is linked inside high5's postfixadmin. That way users can change their filter rules, vacation settings and password in one interface.
All this is working great here for several domains and around 100 users doing their own filtering admin.
[ Parent | Reply to this comment ]
>postfixadmin. That way users can change their filter
>rules, >vacation settings and password in one interface.
>All this is working great here for several domains and
around
>100 users doing their own filtering admin.
Do you mind sharing (even if it's not clean and nice code) ?
I've a similar problem with a number of users and I didn't
have any time to write something similar...
:)
p
[ Parent | Reply to this comment ]
MailScanner is very robust flexible and reliable.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
The good thing is its server independent, meaning both you can run it against any imap server software and any imap server regardless of location. The bad is that when I last used imapfilter it did require a crontab or another way of implementing a check cycle and as such there was a chance you could catch mail in your inbox before it was filtered.
[ Parent | Reply to this comment ]