mailtools are going to become my replacement for fetchmail, procmail and so on. Like
most of my tools it started as a perl or shell script and was rewritten and
published in C for minimum execution size and maximum execution speed since
most other tools are far too heavyweight for my taste although they are more
powerful than mine.
At the moment mailtools consists just of one programm, mailfetch, which sucks messages from a POP3 server and pipes it to a local mail delivery agent, which then feeds your mails to cyrus, courier or your local mailbox.
$ mailfetch [-c <config file>] <mail delivery agent> [<args to mda> ...]
If you do not specify a config file, ~/.mailfetch will be used. So, for example:
$ crontab -l */5 * * * * mailfetch /var/qmail/bin/qmail-inject mylocalaccountnameA typical ~/.mailfetch looks like:
# this is a comment :-) pop3://yourusername:email@example.com # maybe the pop3 server listens on a non-default port: pop3://yourusername:firstname.lastname@example.org:666
It does not download messages exceeding 20 MB in size which is a compile time default.
$ diet -Os gcc -W -Wall -s -pipe -o mailfetch mailfetch.c