fetchmail & pop3

Chris Bopp cpb at spal455a.lll.hawaii.edu
Tue Nov 7 20:06:50 PST 2000


Regarding fetchmail, procmail, elm, sendmail, whatever - keep in mind
the fact that what fetchmail WANTS to do is to deliver the mail it grabs
elsewhere to the local MTA, often sendmail or (by definition) its
work-alikes smail, exim, qmail --- if you are not running a mail server
in order to receive the booty that fetchmail produces, it doesn't work
(but see below).

So if you're running a server (somebody like sendmail is listening on
TCP port 25 [smtp]), then you could also take advantage of sendmail-like
aliases, .forward files, etc. In addition, you could take advantage of
post-delivery programs like procmail (that run as the local user, to
process email that sendmail would otherwise append to /var/spool/mail/<user>.

If you're NOT running a server on the machine which runs fetchmail, you
have to tell fetchmail to do something else with the email, with the --mda
switch. You can grab remote email to a local file with something like this:

fetchmail --verbose --keep --all --protocol pop3 --user remoteuser 
          --mda '(echo From blahblah; cat -; echo) >> localfile' remotepop.com

The --keep and --all switches are good because you may, just may, not get
*quite* what you expect the first time, and you might wish you hadn't flushed
the remote email box before you were darn sure you actually copied it first!

That way when you're done the localfile will have mbox format (need a
"From" line, need a blank line between messages). What you do with the
result file is your business.

I don't know if any unix email clients let you easily adopt different
sending "personalities" (Eudora calls them that) to reply to email exactly
the way you want. Anyway, the way outgoing mail looks is heavily influenced
by the first SMTP server that sees it, and the configuration of that system.
(linuxconf, I guess, though never forget that linuxconf is fundamentally
eeeeeevil muahaha! but hey, so is all email itself!) 

Chris Bopp



More information about the LUAU mailing list