RIGIN meischke.de.
$TTL 86400
meischke.de. IN SOA . hostmaster. (
2003062101
10800
3600
604800
86400 )
. 86400 IN A 62.112.129.137
. 86400 IN A 62.112.140.253
meischke.de. 86400 IN A 62.112.157.154
*.meischke.de. 86400 IN A 62.112.157.154
meischke.de. 86400 IN MX 10 mail..meischke.de.
meischke.de. 86400 IN NS .
meischke.de. 86400 IN NS .
Virtual domains
This allows your Postfix mailer to accept mails for domains other than its own. By default, you must create a user account in /etc/passwd, and add a mapping in eg. /etc/postfix/virtual between the public email address and the actual account that lives in /etc/passwd.
If no mapping is required (ie. the user account used in the virtual address matches a unique account in /etc/passwd), you can simplify things by editing /etc/postfix/transport, and tell it to just deliver any email meant for virtual accounts locally. The latter is dangerous, however, because eg. any email for mike@abc.com and mike.@xyz.com will be delivered to the same mailbox.
The standard way
In the following example, we'll create a Unix user account, tell Postfix to accept accounts for the virtual domain "testcompany.com", and have it forward any email meant for jdoe@testcompany.com to the real Unix account janed.
1. useradd -c "Postfix user account" -s /bin/false janed ; passwd janed
2. Edit /etc/postfix/main.cf: virtual_maps = hash:/etc/postfix/virtual
3. Build the hashed file: postmap /etc/postfix/virtual
4. Edit /etc/postfix/virtual:
testcompany.com virtual
jdoe@testcompany.com janed
Note: In the hashed virtual table, Postfix can discriminate between the list of virtual domains and the list of email redirectors by checking for the presence of the @ sign.
5. postfix reload
The funny way
Here, we don't want to bother keeping an up-to-date mapping between virtual email addresses and Unix user accounts. This is OK if any user account is unique, regardless of the domain to which it belongs:
1. useadd -c "Postfix user account" -s /bin/false janed ; passwd janed
2. Edit /etc/postfix/main.cf: transport_maps = hash: /etc/postfix/transport
3. Edit /etc/postfix/transport:
othercompany.com local:
4. postmap hash: /etc/postfix/transport
5. postfix reload
Important: Again, this shortcut only works if Unix user accounts are unique!
For instance, suppose that...
1. The Postfix mailer lives in the domain @acme.com, ie. in main.cf, mydomain = acme.com
2. An entry in /etc/passwd is called "janed"
3. You are asked to support messages for the virtual domain @testcompany.com
4. Another Jane Doe exists in that other company whose virtual domain you handle, and thus, needs an email called janed@testcompany.com
Now, any email meant for janed@acme.com or janed@testcompany.com is delivered into a single /var/spool/mail/janed (or whatever mailbox scheme you are using). For this reason, it is recommended to use The Standard Way.
snake:~ # host 1017-1.1st-housing.de
1017-1.1st-housing.de has address 62.112.157.153
snake:~ # host -t MX 1017-1.1st-housing.de
snake:~ #
snake:~ # host meischke.de
meischke.de has address 62.112.157.154
snake:~ # host -t MX meischke.de
meischke.de mail is handled by 100 mail.meischke.de.
mydomain = meischke.de
myhostname = 1017-1.1st-housing.de
mynetworks = 62.112.157.152/29, 127.0.0.0/8, 128.0.0.0/1