domain alias + routing rule rewrites recipient domain

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
porcupine
Normal user
Normal user
Posts: 40
Joined: 2007-03-12 09:02

domain alias + routing rule rewrites recipient domain

Post by porcupine » 2009-06-23 08:15

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.

User avatar
mattg
Moderator
Moderator
Posts: 20134
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: domain alias + routing rule rewrites recipient domain

Post by mattg » 2009-06-23 08:40

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.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: domain alias + routing rule rewrites recipient domain

Post by martin » 2009-06-23 17:37

It's more "undefined" than expected...

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

porcupine
Normal user
Normal user
Posts: 40
Joined: 2007-03-12 09:02

Re: domain alias + routing rule rewrites recipient domain

Post by porcupine » 2009-06-23 17:48

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.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: domain alias + routing rule rewrites recipient domain

Post by martin » 2009-06-23 17:51

Good. :)

Post Reply