OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Address rewrite oddity

From: Gary W. Smith (garyprimeexalia.com)
Date: Sun Apr 09 2006 - 23:29:20 CDT


We have been seeing some odd behaviour on a machine for which we house multiple domains using virtual hosting. I'm not sure if it's standard operation but I just wanted to check before going on.

We have all logins prefixed with a special identifier to make each domain user uniquie from one another. Here is an example of a few logins

site1_bob (site1.com)
site2_jack (site2.com)
site2_john (site2.com)
...

Each user has a default address of theirname (not login name) theirsite.com

bobsite1.com
jacksite2.com
johnsite2.com

If we do this in the virtual file it fails

bobsite1.com site1_bob
jacksite2.com site2_jack

But if we do this it works:

site1_bobsite1.com site1_bob
bbobsite1.com site1_bob
site2_jacksite2.com site2_jack
jjacksite2.com site2_jack

Is there something simple in the configuration that we are missing that would cause this problem?

Also, here is where it also get's interesting. The following results in very strange results

someaddress2site2.com jacksite2.com,johnsite2.com

It will try to rewrite the destination to:

jacksite2.com and johnsite2.comhostname.domain.tld

It only rewrites the last email address if it is local. if it is not local then it goes just fine.

Here are what I believe are the relevant sections of the configuration file:

# Global Postfix configuration file.
append_at_myorigin = yes
append_dot_mydomain = yes

# INTERNET HOST AND DOMAIN NAMES
#myhostname = (use default)
#mydomain = (use default)
myorigin = $myhostname

# RECEIVING MAIL
inet_interfaces = all
mydestination = /etc/postfix/mydestinations
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
virtual_alias_maps =
mysql:/etc/postfix/virtual.mysql,hash:/etc/postfix/virtual
virtual_alias_domains = mysql:/etc/postfix/virtualdomains.mysql
mailbox_command = /usr/bin/procmail
mailbox_transport = cyrus
local_header_rewrite_clients = permit_inet_interfaces

# DOMAIN FORWARDING
transport_maps = hash:/etc/postfix/transport

# SECURITY PRECAUTION
disable_vrfy_command = yes
smtpd_banner = $myhostname.$mydomain ESMTP $mail_name

# UCE RESTRICTIONS
mynetworks = 127.0.0.0/8
relay_domains = $mydestination, /etc/postfix/relay-domains