postfix-users October 2010 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: Virtual Domains

Virtual Domains

From: Jeremy Bowen <jeremy_at_nospam>
Date: Mon Oct 11 2010 - 21:21:26 GMT
To: "Postfix users" <postfix-users@postfix.org>

Hi All

I'm probably missing something really obvious but I can't see what I'm
doing wrong.

I have a server which I wish to use to host both my primary domain (eg.
example.com) and several virtual domains (virtual1.com, virtual2.com
etc.).

I'm running Postfix v2.3.3 on CentOS 5 (This is the latest packaged
version
available with CentOS)
[Note: I've substituted the actual domain names with examples.]

First up, here's the output of "postconf -n"
==============================================
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
default_destination_concurrency_limit = 20
header_checks = regexp:/etc/postfix/header_checks
html_directory = no
inet_interfaces = all
local_destination_concurrency_limit = 2
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
mail_owner = postfix
mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
myhostname = phantom.example.com
mynetworks = 127.0.0.0/8
mynetworks_style = host
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
relayhost =
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
virtual_alias_domains = virtual1.com virtual2.com
virtual_alias_maps = hash:/etc/postfix/virtual
=====================================================

my /etc/postfix/virtual file looks like this:
@example.com jeremy

jane@virtual1.com jane
@virtual1.com fred

@virtual2.com bill

(Yes, these are catch-all recipes)

My problem is that email sent to someone@virtual1.com is delivered to
jeremy@example.com as per the following log entry:

Oct 12 10:04:33 phantom postfix/lmtp[9669]: 909161086FC:
to=<jeremy@example.com>, orig_to=<fred@virtual1.com>,
relay=phantom.example.com[/var/lib/imap/socket/lmtp], delay=30,
delays=30/0.04/0.11/0.33, dsn=2.1.5, status=sent (250 2.1.5 Ok)

I think I'm probably wrong in specifying @example.com in
the /etc/postfix/virtual file but I'm not sure where I should define the
valid recipients for example.com.

Should I not specify $mydomain in $mydestination and include all valid
addresses in the virtual file or is it something more basic I'm missing.

All help greatly appreciated.
Regards
Jeremy