About Archive Tags RSS Feed


If there isn't a movie about it, it's not worth knowing, is it?

26 November 2008 21:50

So, I've just got a portable machine. I've configured it to be a pretty minimal installation of Debian Lenny, but one thing that makes me unhappy is mail handling.

By default it came with several exim4- packages. Now in general Exim4 rocks. But it is a deamon running all the time, and overhead I could live without.

I looked around to find a mail transport agent that would be more suited to the machine and was suprised to find nothing suitable.

Basically I figure the machine will never generate "real" emails. Instead it will only receive mails from cron, etc. The machine will never have a real fixed IP, and so relaying mail externally is a waste of time. The mail should just go somewhere predictable and local.

There are a couple of lightweight agents which will forward to another system, but nothing seems to exist which will queue mail locally only.

So I've hacked a simple script which will do the job.

Given the spool director /var/spool/skxmail the following command:

skxmail root < /etc/passwd

Produces this:

`-- root
    |-- cur
    |-- new
    |   `-- 1227702470.P8218M243303Q22.vain.my.flat
    `-- tmp

4 directories, 1 file

That seems to be sufficient for my needs. (I support the flag which says "read the receipient from the body).

Of course to do this properly I'd be setgid(mailgroup). Instead I assume that local means everybody can see it and /var/spool/skxmail is mode 777. Ooops.

Still happy to share if it sounds interesting.

ObFilm: Dogma



Comments on this entry

icon A Canuck at 14:24 on 26 November 2008
Does the deliver package do what you need?

icon Steve Kemp at 14:53 on 26 November 2008

It might have done if the removal bug didn't suggest it was buggy.

(And of course if it were still in Debian - I see it only exists in Etch at the moment.)

icon Dominic Hargreaves at 15:24 on 26 November 2008
Exim4 will do this fine - one of the prebaked configs that it offers is for local-only delivery (dpkg-reconfigure exim4-config)
icon Steve Kemp at 15:25 on 26 November 2008

Sure it will but the dependencies for exim4 are a little heavy.

I always assumed that when you ran "dpkg-reconfigure exim4-config" and selected local-only delivery it would still listen on :25. Is that the case?

icon Dominic Hargreaves at 15:34 on 26 November 2008
Sorry, I lost track of the fact that you didn't want exim4 - yes, it feels slightly wrong to have the daemon running - you can disable it if you're sure that no message would ever get deferred for any reason (since it's responsible for running the queue runner) but to be honest the daemon is pretty lightweight and doesn't harm on all but the smallest systems.
icon Steve Kemp at 15:42 on 26 November 2008

Its not that I dislike exim4 - quite the reverse - but on a flash-based machine I would prefer:

  • Less daemons: Gives me faster startup.
  • Less packages: Less disk writing on package updates/upgrades/installs.

Thats why I thought nullmailer, masqmail, or similar might be useful. Only they all spool to remote systems which doesn't make sense when I'll be mostly offline...

icon Dirk at 16:20 on 26 November 2008
I'm using exim for the purpose you want. Configure it to deliver local mail online and at the end change all start scripts of the daemon (e.g. S20exim4) in /etc/rc$$ to killscripts (K20exim4). Local mail delivery will work without a running daemon. Installed packages on my system: i A exim4 i A exim4-base i A exim4-config i A exim4-daemon-light
icon toupeira at 18:41 on 26 November 2008
I use ESMTP (package esmtp-run) in combination with deliver, it doesn't have a daemon and will deliver local mails just fine. I do use the external relaying for "real", outgoing mails, though.