This site is now 100% read-only, and retired.

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.

 

 


Re: What is the best server-side mail filtering setup?
Posted by mafeu (84.137.xx.xx) on Thu 15 Sep 2005 at 11:07
This is a question which I ask myself for a while now, but, alas, no good answers so far.

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 ]

Re: What is the best server-side mail filtering setup?
Posted by Steve (82.41.xx.xx) on Thu 15 Sep 2005 at 11:34
[ 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 ]

Re: What is the best server-side mail filtering setup?
Posted by Steve (82.41.xx.xx) on Thu 15 Sep 2005 at 11:38
[ View Weblogs ]

Hmmm exim4 appears to support sieve after all!

That is interesting...

Steve
--

[ Parent ]

Re: What is the best server-side mail filtering setup?
Posted by Anonymous (202.0.xx.xx) on Fri 14 Oct 2005 at 09:15
Indeed it does.
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 ]

Re: What is the best server-side mail filtering setup?
Posted by lynrees (131.251.xx.xx) on Fri 16 Sep 2005 at 13:32
You could always have a look at Hula:

http://www.hulaproject.org/Hula_Server

[ Parent ]

Re: What is the best server-side mail filtering setup?
Posted by wouter (195.162.xx.xx) on Thu 15 Sep 2005 at 15:32

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 ]

Re: What is the best server-side mail filtering setup?
Posted by ptecza (193.0.xx.xx) on Fri 16 Sep 2005 at 09:28
Hello!

> 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 ]

Exim+clamav+spamassassin+lots of config
Posted by Anonymous (62.167.xx.xx) on Thu 15 Sep 2005 at 17:59
I use Exim4 (daemon-heavy) with some custom config that allows to:
  • 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 ]

Re: What is the best server-side mail filtering setup?
Posted by Anonymous (80.126.xx.xx) on Thu 15 Sep 2005 at 18:31
I have been fighting the same thing as you describe here.
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 ]

Re: What is the best server-side mail filtering setup?
Posted by Anonymous (150.203.xx.xx) on Fri 16 Sep 2005 at 00:53
>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.

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 ]

Re: What is the best server-side mail filtering setup?
Posted by ugob (216.113.xx.xx) on Mon 19 Sep 2005 at 13:07
I use MailScanner a lot. I wrote an article about setting MailScanner on a debian box. It is rather quick and simple, once you know what you want to do with filtered messages: http://www.debian-administration.org/articles/172

MailScanner is very robust flexible and reliable.

[ Parent ]

Re: What is the best server-side mail filtering setup?
Posted by ugob (216.113.xx.xx) on Mon 19 Sep 2005 at 13:12
I forgot to say that if you install MailWatch, which is also freely available, you get a web interface that gives you stats, reports, and a way to manage whitelists/blacklists, per user/domain/global. http://mailwatch.sourceforge.net

[ Parent ]

Re: What is the best server-side mail filtering setup?
Posted by Antitribu (203.144.xx.xx) on Wed 21 Sep 2005 at 05:18
Once upon a time I ran a similar setup, exim4/cyrus. I used imapfilter and a crontab ( apt-get install imapfilter ) on a short interval. It isn't perfect but may work and allows user config files. I'm sure someone out there has written a web frontend to allow you to configure it easily.

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 ]