The FreeBSD Diary |
(TM) | Providing practical examples since 1998If you buy from Amazon USA, please support us by using this link. |
Postfix - virtual domains (part II)
21 May 2003
|
This is the second of two articles on Postfix. Please read Postfix - virtual domains first. Postfix is my mail server of preference and has been for over a year. But my first article about it was less than two weeks ago. It showed how I installed and configured Postfix and how I implemented virtual domains. At the time, I was setting up some secondary mail servers and was moving the mail service for some domains from one server to another. Shortly after writing that article, I became much more aware of the power and flexibility which is available with Postfix when it comes to virtual domains. That first article barely scratches the surface. Sure, it will get you up and running, but will you have the type of implementation which best suits your needs? In this article, I will talk about the three different types of virtual domains available with Postfix. After reading this, I'm sure you will know which one to use. My thanks must go to Russell Mosemann for pointing out the missing pieces. You can find the original message via Google |
Things have changed, be warned
|
This article was written back in November 2002, but sat here unfinished for some time. After someone asked me about virtual domains, I decided it was time to publish. Please note that around January 2003, the terminology used for Postfix virtual domains was changed to avoid confusion. The terms sendmail virtual domains and postfix virtual domains are no longer used in Postfix 2. The RELEASE_NOTES has details. Look for Name change of virtual domain tables. I have reproduced that section here:
|
The choices
|
There are three types of virtual domains available with Postfix.
|
sendmail-style virtual domain
|
With a sendmail-style virtual domain, every local account exists in all of the domains handled by Postfix. For example, if your mail server accepts mail for example.net and example.com, and you have a local user tk19, then mail to tk19@example.net and tk19@example.com will both be delivered to the local user. This may not be what you want. If it isn't, then regular postfix-style virtual domain may be what you need. This is an example of a sendmail-style virtual domain:
With this scenario, mail sent to the unknown user dtm@example.com will be delivered
to the local user dtm. Mail to xyz@example.org will be bounced to the sender if no
local user xyz exists.
|
regular postfix-style virtual domain
|
The main difference between a sendmail-style virtual domain and a regular postfix-style virtual domain is what I call the domain header (this is a term I made up; don't expect to see it used elsewhere). This creates a domain use name space. Local user names are not visible in a regular postfix-style virtual domain.
With this example, mail for an unknown user in example.net will be bounced back to the
sender, unlike a sendmail-style virtual domain where delivery will be first
attempted to a local user before bouncing.
For what it's worth, this is the type of virtual domain I use on my mail servers.
|
virtual mailbox domain
|
I haven't investigated this at all yet. See http://www.postfix.org/virtual.8.html and this long google link. |