pop2smtp

pop2smtp is a program which fetches mail from a POP3 server and feeds it into an SMTP server. It is of particular interest to customers of Demon Internet who are moving from dialup to ADSL service. Where previously mail was delivered direct via SMTP (triggered by dialling in), it now must be collected by POP3. The pop2smtp program allows the mail system to be left unmodified, replacing the automatic delivery of mail by Demon with a cron job periodically collecting it.

Note that all mail is collected before any is deleted from the POP3 server. This means that if it crashes during collection, any messages already collected will be delivered again (i.e. duplicated) when it next runs. This is unlikely to be a problem for a system which collects only a modest amount of mail at frequent intervals.

Usage

The pop2smtp program is run like this:

	perl pop2smtp.pl POP3-username POP3-server-addr SMTP-server-addr < POP3-passwordfile

where the items required are:

POP3-username
The username to send to the POP3 server.
POP3-server-addr
The address of the POP3 server to use. This may be a name or an IP address. For example, pop3.demon.co.uk to collect from the Demon mail system.
SMTP-server-addr
The address of the SMTP server to use. This may be a name or an IP address. This is typically 127.0.0.1 since the pop2smtp program would normally be run on the machine that runs the SMTP server. However, you can run pop2smtp on a firewall machine with the SMTP and POP3 servers on opposite sides of the firewall, with only pop2smtp passing incling mail across the firewall.
POP3-passwordfile
This is a file which contains only a single line which is the POP3 password. This prevents the password appearing in ps listings of active processes.

The source code

The source for pop2smtp is available at pop2smtp.pl. It is licenced for use in accordance with the terms of the GNU General Public Licence.