The <pattern1> in a popgate line is identical to the <pattern1> in redirect lines, but there can only be one <pattern2>, which must either be a full email address or an account on the local mail server:
popgate cust5.dk cust5@dialup.avalonia.dk
popgate cust6.dk cust6
In this example all messages to the domain "cust5.dk" are forwarded to the
address "cust5@dialup.avalonia.dk" and all messages to the domain "cust6.dk"
are forwarded to the account "cust6" on the local mail server.
In both cases it is then up to the customers server software to make a connection
to your server to collect the mail. The essential difference between redirect
and popgate lines is that when popgate is used extra lines are
inserted in each message. The lines inserted are:
X-Deliver-To: <address>
X-Real-To: <address>
where <address> contains the address the message originally was sent to. This enables the calling server to place the message into the right mailbox.
By adding an extra parameter to a popgate line it is possible to request that a specific header is used in stead of the two default lines:
popgate cust5.dk cust5@dialup.avalonia.dk X-Envelope
popgate cust6.dk cust6 To
Here the first line results in all messages to the domain "cust5.dk" getting the
address the message was originally sent to added to the message header, in a line
beginning with "X-Envelope: ".
Some mail servers fetching messages via POP insist on always using the "To:"
field in the message header. As the "To:" field may not contain that
information (if the recipient is only mentioned in a "Cc:" or "Bcc:" field,
or if the message is from a mailing list), this strategy prevents some
messages from being delivered. Fortunately this problem can be solved by
requesting that MailRouter always adds a "To:" field containing the true
recipient of the message to the header, as shown in the second sample line.
As this would result in the message containing two different "To:" fields,
MailRouter also changes the original "To:" field to "X-RFC-To:". As some
gateways also look in all "Cc:" fields in the header, which could result
in multiple copies of the same message, and other problems. All "Cc:"
fields in the header are therefore also changed to "X-RFC-Cc:".
The ipsgate keyword is a special version of the popgate keyword, which changes the contents of the "To:" field so that it contains a local account in a comment. This format is used by a few hardware SMTP/POP3 proxy servers to distribute mail locally. A description of such a device can be found at Sercomm.com.The line:
ipsgate cust6.dk cust6@server.net
redirects all incoming messages to the domain "cust6.dk" to the address "cust6@server.net", while changing the contents of the "To:" field in the header, so that it shows both the local account and the POP3 mailbox the message is placed in. If a message is received to be delivered to "peter@cust6.dk" the "To:" field is changed to:
To: "peter"
The information in the original "To:" and "Cc:" fields are preserved in "X-RFC-To:" and "X-RFC-Cc:" fields.