OutMail Pre-processors

OutMail pre-processors can process any messages which are received by the VPOP3 SMTP server before they are placed in the OutQueue, or into user's mailboxes. This means that an OutMail pre-processor can process local mail, and incoming SMTP mail as well as outgoing mail.

OutMail pre-processors can optionally be run on internal email as well as Internet email.

OutMail processors require you to be an experienced programmer so they are not intended for most users.

If you want to write an OutMail processor then you will need to be willing to read/write binary & text files, and you should also understand the SMTP protocol (described in RFC 821).

How OutMail pre-processors work

When VPOP3 calls the OutMail processor it passes two command line parameters:

  1. The 'In' Filename - this is the name of the file containing the initial data to be sent

  2. The 'Out' filename - this is the name of the file which will contain the final data to be sent.

The OutMail pre-processor should read the In file and (optionally) create the Out file (if it doesn't create an Out file, then VPOP3 will just discard the message). It should NOT delete the In file - VPOP3 will do that.

The In/Out File Format

Both the In and Out files are in an internal VPOP3 file format. This is described below:

The first 100 bytes are a null padded string containing the MAIL FROM: name which will be used in the outgoing message

Following that, everything is in text format - lines MUST end with a CR/LF pair. Immediately following the first 100 bytes there will be one or more lines containing:

*RCPT TO: <recipient>

These lists all the recipients of the message

There may also be a line starting *DSNINFO - this contains Delivery Status Notification information (see RFC 1891)

Next there will be a line saying:

!DATA

This marks the end of the SMTP envelope data and the start of the message itself.

Following that is the message text

 

Notes:

  1. In the message text, there is no terminating '.' stored in the file that the OutMail pre-processor sees or creates (VPOP3 adds that character when necessary).

  2. '.' (period) characters contained in the message text do not need padding with an extra period to ensure that the end of message is not incorrectly detected. (VPOP3 will do this automatically).

  3. In VPOP3 V2 and later, we recommend that Message Processor plugins are created instead of Outmail Pre-processors, as Message Processor plugins can easily differentiate between incoming and outgoing SMTP messages as well as POP3 messages. They also have more flexibility and can perform common tasks more simply than Outmail pre-processors.

See Also