Exim4, Courier, SpamAssassin and RoundCube
Having broken my non-production mail server a few days ago, I decided it was about time to actually get around to fixing it. I don't intend using it as my primary mail server, but more as a mirror of my ISP's account - at least until I have a private colocated box again, on a decent line that can handle my mail. Some how I don't think my home line (read: me) will be happy with all of the various mailing lists coming at it.
Anyway, I decided tonight would be a good time to fix it. Amy's off dancing with her mum, and other than wanting to play some games, it seemed like an ideal time. Having never actually used Exim4, Courier, and SpamAssassin it seemed like an ideal thing to waffle on about.Install what you need. As usual apt-get is king.apt-get install exim4-daemon-heavy courier-imap spamassassin spamc sa-eximObviously accept all the various dependancies, and select multiple files for exim4, and internet site. Otherwise leave as default.Make your Maildir (I prefer this over mbox), using courier's maildirmake commandmaildirmake ~/Maildir/Append the following to /etc/exim4/update-exim4.conf.confdc_localdelivery='maildir_home'Edit /etc/default/spamassassin, and set ENABLE = 1Generate the new configupdate-exim4.confand if that went through without any errors, check eximexim4 -bVand then restart/etc/init.d/exim4 startTest Exim is working, just to make sureexim4 -bt user@localhostexim4 -v AnExternalMailAccount@Domain.TLD From: user@localhost To: AnExternalMailAccount@Domain.TLD Subject: Test
Test .If you want to be particularly shitty and reject exe's, com's, bat's, etc. then add the following to /etc/exim4/conf.d/acl/40_exim4-config_check_data, before the final line, “accept"deny message = Serious MIME defect detected ($demime_reason) demime = * condition = ${if >{$demime_errorlevel}{2}{1}{0}}
deny message = This server will not accept certain file attachments.
Please resend it as a compressed archive.
demime = bat:btm:cmd:com:cpl:dll:exe:lnk:msi:pif:prf:reg:scr:vbsEdit /etc/exim4/sa-exim.conf, and change the line SAEximRunCond: 0toSAEximRunCond: 1Now lets add support for virtual domains, in the old fashioned way.mkdir /etc/exim4/virtualCreate a set of file, one for each of your domains.touch /etc/exim4/virtual/yourdomain.tldIn each file, add the various aliases. The format is localpart: localuser@localhost. Wildcards are accepted.postmaster : user@localhost
One thing to finally remember is to create the Maildir in /etc/skel, and possibly .forward, which can apparently contain user defined filtering rules (and can be surprisingly powerful);if $h_X-Spam-Status: CONTAINS “Yes” or $h_X-Spam-Flag: CONTAINS “Yes” then save Maildir/.Junk/ finish endifHaving gotten past the hard bit, its was time to play with RoundCube. As with most PHP scripts (yes, I know I've been trying to get rid of them, not add more), all you need to do is read INSTALL. Its very straight forward. As for how RoundCube works… I'm not entirely sure if I like it. The interface is pretty good, but I have to say its not quite as slick as Outlook Web Access (which if you ignore the whole IE-only-proprietory-experience thing, isnt too bad), Zimbra or Hula, and its missing some features; but it's definately getting there. Most certainly much better than Horde IMP or Squirrelmail by a long shot. I'll give it a few weeks / days, and see how things go.