Page 1 of 1

domain alias + routing rule rewrites recipient domain

Posted: 2009-06-23 08:15
by porcupine
morning all - no doubt this scenario is unusual, please bear with me
Scenario:-
server1: is the smtp gateway for domains blah1.com and blah2.com
server1: has domain blah1.com
server1: domain blah1.com has an alias for blah2.com
server1: has a routing rule for blah2.com which routes to server2
server1: has a user called john
server2: has domain: blah2.com
server2: has a user called bob
server1 & server2: run either hmailserver v4 (latest) or v5 (latest)

Problem: anyone internally or externally trying to send an email to bob@blah2.com will fail because server1 will rewrite the recipient domain as blah1.com when routing to server2

Why: when any domain has an alias and that alias has a routing rule the original recipient domain (blah2.com) will get rewritten to the primary domain (blah1.com) and server1 will relay that message to bob@blah1.com instead of bob@blah2.com.

Workaround 1: if you want john to receive email for both blah1.com and blah2.com then blah1.com cannot have the domain alias blah2.com, blah2.com must be a separate domain to prevent the recipient domain being rewritten. If you already had blah1.com and a large number of users that you wanted to receive email for blah2.com it would not be practical to create a separate domain or set up mailbox forwarding on server2 to these users.

Workaround 2: create a domain alias on server2 for blah1.com, this will work if server2 runs hmailserver but may be hard to configure for other servers.

Question: is this expected behaviour and if not could we see a fix? or any other suggested work around.

Code: Select all

"SMTPD"	6100	11	"2009-06-23 13:06:30.015"	"127.0.0.1"	"SENT: 220 COMMSERVER ESMTP"
"SMTPD"	5728	11	"2009-06-23 13:06:30.015"	"127.0.0.1"	"RECEIVED: HELO CommServer"
"SMTPD"	5728	11	"2009-06-23 13:06:30.031"	"127.0.0.1"	"SENT: 250 Hello."
"SMTPD"	6100	11	"2009-06-23 13:06:30.031"	"127.0.0.1"	"RECEIVED: MAIL FROM: <john@blah1.com>"
"SMTPD"	6100	11	"2009-06-23 13:06:30.046"	"127.0.0.1"	"SENT: 250 OK"
"SMTPD"	5728	11	"2009-06-23 13:06:30.046"	"127.0.0.1"	"RECEIVED: RCPT TO: <bob@blah2.com>"
"SMTPD"	5728	11	"2009-06-23 13:06:30.062"	"127.0.0.1"	"SENT: 250 OK"
"SMTPD"	6100	11	"2009-06-23 13:06:30.078"	"127.0.0.1"	"RECEIVED: DATA"
"SMTPD"	6100	11	"2009-06-23 13:06:30.078"	"127.0.0.1"	"SENT: 354 OK, send."
"APPLICATION"	2596	"2009-06-23 13:06:30.093"	"SMTPDeliverer - Message 13: Delivering message from john@blah1.com to bob@blah1.com.

Re: domain alias + routing rule rewrites recipient domain

Posted: 2009-06-23 08:40
by mattg
So could you set up account aliases, rather than domain aliases for each of the accounts like john@. This could be scripted if there are many of them.

Re: domain alias + routing rule rewrites recipient domain

Posted: 2009-06-23 17:37
by martin
It's more "undefined" than expected...

I've reported it as an issue here:
http://www.hmailserver.com/devnet/?page ... ssueid=226

Re: domain alias + routing rule rewrites recipient domain

Posted: 2009-06-23 17:48
by porcupine
mattg: yes, that would be a workaround

martin: thanks, I think that is a good label for it: "undefined" and overall would be beneficial to change.

we have "workedaround" for now.

Re: domain alias + routing rule rewrites recipient domain

Posted: 2009-06-23 17:51
by martin
Good. :)