Posts Tagged ‘maildrop’

Updated .mailfilter for Courier Maildrop and SpamAssassin

April 26th, 2009

My spam count has exploded in the last few days, so I made a decision to adjust my filtering a little more.

Previously, all messages that got more than 5 points in SpamAssassin tests were flagged and sent to my .Spam folder. This got to be a bit of an issue as I still check there to make sure that no emails are miscategorized… Call me crazy, but I’m a bit anal when it comes to that stuff. (I missed an interview because of Gmail’s filters, but that’s a story for another day).

For the last few days, I’ve been reviewing the spam counts for both the more cleverly hidden spam and the less-than-clever spam. I’ve come to realize that while the odds are low that any real emails will get marked as spam if they do they’ll definitely get a score less than 10. So to combat the large amount of spam that’s now coming through, emails with greater than 10 points will now be sent directly to the trash.

Here’s what I put in my .mailfilter file for courier-maildrop:

1
2
3
4
5
6
7
8
9
if ( /^X-Spam-Level: \*\*\*\*\*\*\*\*\*.*$/ )
{
exit
}

if ( /X-Spam-Flag/ )
{
to "$DEFAULT.Spam"
}

This way, anything that gets more than won’t even be delivered, and all other emails that get a spam flag (greater than 5 points) get sent to spam, then the rest of my filters are processed.

Tested the email with the GTUBE and with a normal message and it seems to work, but we’ll see if I wake up in the morning and all my email has been dumped in the trash can.

Configuring Postfix, Courier, and Courier-Maildrop for Virtual Users

March 23rd, 2009

Here are some highlights for configuring Postfix to use Courier-Maildrop for local delivery.

This allows some advantages over just having postfix deliver, because you can do server-side filtering of spam and mailing list messages to de-clutter your inbox.

All these notes are based on configuring the setup on Ubuntu 8.10 (Intrepid Ibex) with Debian Lenny’s courier-maildrop

The following are snippets from my configuration files, highlighting the changes that I had to make, from an already existing mail server. If these look unfamiliar, or you need more assistance setting up the basic framework of a Postfix + Courier-IMAP mail server, start here.

1
2
3
4
5
6
7
#/etc/courier/maildroprc
EXTENSION="$1"
RECIPIENT=tolower("$2")
USER="$3"
HOST="$4"
SENDER="$5"
DEFAULT="/home/vmail/$HOST/$USER/."
1
2
3
#/etc/postfix/main.cf
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1
1
2
3
#/etc/postfix/master.cf
maildrop unix   -       n       n       -       -       pipe
flags=ODRhu user=vmail argv=/usr/bin/maildrop -w 90 -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop}

So if you have a working mail server: make these changes, sudo /etc/init.d/postfix restart, and then get to work writing your .mailfilters!

Intrepid’s courier-maildrop and authlib

March 23rd, 2009

Ubuntu 8.10’s courier-maildrop is not compiled against courier-authlib and so cannot read from many of the supported authentication schemes that authlib can support.

Fortunately, Debian Lenny’s can. So if you’re having trouble you can try and install the package from that distribution, YMMV.

To save you the effort of going out and locating it, I’ll attach a version of it here. Use it at your own risk, but it’s working for me.

courier-maildrop_0600-2_amd64