<< PreviousDecember 2003Next >>

Tuesday 09 December, 2003
#Monkeying with fetchmail and multidrop mailboxes

Finally decided to let my Demon subscription lapse. For the last few years, I've been routing jezuk.co.uk mail through to jezuk.demon.co.uk and picking it up from there. Nobody but spammers sends mail directly to jezuk.demon.co.uk anymore, I've got the cable modem so I don't use the Demon dial-up, and all my webpages live here, so it's money that doesn't need to be spent any more.

Mail to any jezuk.co.uk address all winds up in the same mailbox. At this end it all gets picked apart, so that Nat's mail goes to her, Daniel's to him, the various mailing lists to the appropriate bots, and everything else ("Enlarge your p'e'n'i's" mostly) ends up with me. While I was fetching the mail from Demon, that was easy because Demon's POP3 setup was especially jiggled to make that kind of thing easy. Now I'm picking it all up from my mail provider, it's a bit more tricky.

My mail gateway will happily grab everything from the POP3 box, and send Nattle's mail to her, and so on. When it sees something from a mailing list though, which isn't explicitly addressed to someone, it packages it in an attachment before forwarding it to the default account (me). Not super.

So I had a hunt around for something else to scrape the mail, and the only real candidate is fetchmail. Happily it runs under Cygwin (virtually all the useful stuff running on my server machine now seems to be Cygwinised versions of Linux programs - I really should move it over sometime), and a small bit of config file hackery had it grabbing mail. And forwarding it all to me. Every bit of it.

To the FAQs. While multidrop mailboxes like mine are really rather common, the fetchmail docs council against them. That's fair enough in an ideal world, but you've got to deal with what you've got. fetchmail's author, Eric Raymond, has written at length about the open source development process, and interesting stuff it is too. He often cites his experience with fetchmail, sometimes holding it up as a kind of canonical project, an exemplar even. I'd only note that while the code itself works exactly as advertised, the documentation is best described as lacking. This is a common criticism of software of all stripes, and is an accusation that can also be levelled at my projects.

For a little while I considered lumping up 50 quid to get multiple mailboxes. I Googled around a bit for an alternative package. All I want is to grab mail from a POP3 box and to forward it based on the To: header. How hard could it be? However, while going mad scanning up and down the man page, I saw a folder option.

folder Specify remote folder to query

Folders. That's an IMAP thing. UKShells has IMAP access. I rejigged the config, and grabbed mail via IMAP. And delivered it all to me. Another microbrainwave. I could use server-side filtering to deliver Nattle's mail into it's own IMAP folder. Then fetchmail could grab the mail from that folder, and forward it to her. Could it?

Ptptptptp! It could. A few more minutes setting up folders for the other jezuk.co.uk addresses, a few more lines in the fetchmail config, and it's all done. A multidrop mailbox gamed into multiple mailboxes.

If you're here via Google, here's the summary you probably would have preferred at the start of this little ramble.

planetcutie said I've recently ended a long running dispute with Demon. Namely them trying to charge me £233.25 for an account I cancelled last year. A simple and vaguely offended email set it right on 8th December - one of the best birthday presents I've had. Still, it brings home the lack of 'joined up thinking' between a company's 'online' staff and those who deal with the financial side, [added 11th Dec 2003]
Enter your comment

Name Email
URL
If you have an account, please log in.
No account? Just create one.