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
/var/spool/skxmail/ `-- 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.