2.2 Checking Virtual Recipients with Cyrus IMAP

An alternate Postfix configuration eliminates the need for maintaining two lists of virtual users (one in a vmailbox file and a second in Cyrus IMAP). It is quite simple to implement: just remove the virtual_mailbox_maps definition from main.cf.

If the virtual mailbox list is undefined, the Postfix server does not reject any mail addressed to the virtual domain (external.com). Mail addressed to virtual mail boxes passes though the normal pipeline (i.e. is scanned for viruses and spam) and is presented to the Cyrus LMTP transport for delivery. If Cyrus is unable to locate the recipient’s virtual mail box, the message is discarded and it generates a bounce notice that is forwarded to the sender via the Postfix SMTP client. Figure 3 illustrates this process.

Figure 3: Recipient Verification Using Cyrus IMAP

Note that under this configuration, bounces for unknown users in the public domain (unknown@external.com) don’t occur until the mail has already been filtered and sent to the IMAP server for delivery. The actual Postfix server’s recipient verification is fairly useless since it only bounces messages to the mail host (unknown@mail.internal.lan). Since these addresses can only be reached while logged into the private network, the situation rarely arises.

Obviously, one drawback to this configuration is wasted time and processing power. Messages to invalid recipients are scanned for viruses and spam before they are bounced.