O'Reilly logo

Postfix: The Definitive Guide by Kyle D. Dent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Separate Message Store

The last configuration we'll consider is hosting virtual domains with a system using a proprietary message store. To work with these systems, Postfix hands off messages using a protocol like LMTP, letting the proprietary system handle delivery to the correct mail box.

Since Postfix must receive messages before handing them off to the LMTP server, it has to know that it should accept mail for each of the virtual domains. List them in virtual_mailbox_domains :

virtual_mailbox_domains = ora.com, oreilly.com

You also have to list each email address, so Postfix can accept messages for valid addresses and reject unknown users. Use the virtual_mailbox_maps parameter to point to a lookup file with valid addresses:

virtual_mailbox_maps = hash:/etc/postfix/virtual

In the /etc/postfix/virtual file, the righthand value isn't used because all messages are passed along to the POP/IMAP server. You must still include a righthand value because lookup tables must have a key and a value, but the value you use doesn't matter:

info@ora.com         General Information Address
info@oreilly.com     General Information Address

In order to have Postfix pass mail for virtual domains through to your POP/IMAP server, specify the correct transport in the virtual_transport parameter in main.cf. You have to know how your LMTP server socket is set up. Assuming it's on the same host as Postfix and uses a socket file located at /var/imap/socket/lmtp, the transport lookup table for the example domains looks ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required