POP2VMSMAIL

As a real OpenVMS enthusiast using something else than VMS-MAIL for reading and writing emails is somehow not an option. The problem which arises quickly is that there is no easy way to get emails from a POP mailbox and put these mails into the VMS-MAIL system which bothered me for quite a while.

After a half hearted attempt to write something like fetchmail in native C for FAFNER, my VAX, I decided to do it in Perl and asked my friend Thomas Kratz for help and advise since he is a real Perl guru. A first version of a Perl program and a short DCL routine to encapsulate this was ready after a few hours but got refined during the time. The current version is called POP2VMSMAIL and consists of a Perl program and a DCL script - both of which will be described in the following.

Since there are quite a lot of users on FAFNER I decided to write a short (and quite unelegant as I have to admit, but this was a bit of a midnight hack) DCL routine which extracts a list of users together with their home directories from the UAF file (using MC AUTHORIZE). For each users the script checks if there is a file called .MAILRC in the home directory.

This file, .MAILRC, is expected to contain only one line consisting of three whitespace separated parts:

A typical .MAILRC-file could contain a line like this:
pop.onlinehome.de my-user-name my-password
   
If the DCL script (which may be found here: POP_CLIENT.COM) finds such a file, it subsequently starts the Perl script (the extension of this script has been changed from .PL to .PERL - do not forget to change this back after downloading the script!) POP2VMSMAIL.PL (and assumes that you have a Perl interpreter installed on you OpenVMS-system). This script need the following Perl modules as well: The Perl script then opens a connection to the POP-server specified in the current .MAILRC-file, checks for new mail, fetches mail if necessary and sends it via VMS-MAIL to the owner of the current .MAILRC.

If no .MAILRC can be found, that user's account is just skipped and the DCL script continues. After one loop through all accounts, the script waits 15 minutes before resubmitting itself.

The DCL script is started at system startup time by putting something like this in your SYSTARTUP_VMS.COM (after changing at least the logfile and script directories, of course :-) ):

$ SUBMIT/NOPRINT/NOTIFY/LOG=DISK$SCRATCH:[SYSTEM.LOG] -
    DISK$SOFTWARE:[UTILS.MAIL]POP_CLIENT.COM
   

29-APR-2004, B. Ulmann fecit.

P.S.: If you have questions or suggestions, please mail me at ulmann@vaxman.de