Community Discussions and Support
AW: AW: Route single mail domain to 'n' locations

Brackets are for numerical addresses only. 

It might be possible to break a loop by adding a header and having a global rule look for it, but it's of course better to avoid creating the loop in the first place. Check console or logs to see if the looping message actually is sent out by MercuryE or if it loops locally on the Mercury server. Unless the MX record for mydomain.de points to IP 11.22.33.44 there shouldn't be a loop.

I've tested forwarding messages from Mercury to another Mercury server and to a common webmail provider, and in both cases the TO: header is unchanged and the original recipient address is shown in the client. It could be that the server program used for your German MTA behaves differently though.

The rule you describe should work assuming that the message actually had a TO: header containing user123@mydomain.de. It would miss on header CC: unless that was selected too (an would definitely miss on BCC as that isn't a header). Try using action Log a console message when testing if a rule triggers or not.

 


 

<p><span style="font-size: 13.3333330154419px;">Brackets are for numerical addresses only.</span> </p><p>It might be possible to break a loop by adding a header and having a global rule look for it, but it's of course better to avoid creating the loop in the first place. Check console or logs to see if the looping message actually is sent out by MercuryE or if it loops locally on the Mercury server. Unless the MX record for mydomain.de points to IP 11.22.33.44 there shouldn't be a loop.</p><p>I've tested forwarding messages from Mercury to another Mercury server and to a common webmail provider, and in both cases the TO: header is unchanged and the original recipient address is shown in the client. It could be that the server program used for your German MTA behaves differently though.</p><p>The rule you describe should work assuming that the message actually had a TO: header containing user123@mydomain.de. It would miss on header CC: unless that was selected too (an would definitely miss on BCC as that isn't a header). <span style="font-size: 13.3333330154419px;">Try using action Log a console message when testing if a rule triggers or not.</span></p><p> </p><p> </p><p> </p>

Hi to all,
i'm new in Pegasus and the forum here. Hope my english is good enough to explain my situation.

I'm looking for a way to route incoming mails for a single mail domain to 3 countries with their own mail server each.
Can this be done with Pegasus?

Example:
userabc@domain.de - shall go to germany MTA
user123@domain.de - shall go to usa MTA
userxyz@domain.de - shall go to asian MTA

Each MTA has it's own MX and will send out mails directly, means it only affects incoming mails.

We have this done now by a service company but would like to do this 'in house' instead.

Now i send a plain text mail with all valid addresses and the target MX like this:
userabc@domain.de (is sent to germany MTA)
user123@domain.de:usa (is sent to usa MTA)
userxyz@domain.de:asia (is sent to asia MTA)
Any not listed addresses are blocked.

My wish is to run Pegasus on our primary MX-Record and 'route' the mails according to different destinations (MXs) based on the recipient address(es).

Many of our mails have multiple recipients (all countries) all addressed in 'TO:'

I know the easiest way would be mail (sub) domains for each location but that's not agreed by management.

Do you think such can be implemented with Pegasus?


Thanks for reading and spending your time.

Regards
Wolfgang

Hi to all, i'm new in Pegasus and the forum here. Hope my english is good enough to explain my situation. I'm looking for a way to route incoming mails for a single mail domain to 3 countries with their own mail server each. Can this be done with Pegasus? Example: userabc@domain.de - shall go to germany MTA user123@domain.de - shall go to usa MTA userxyz@domain.de - shall go to asian MTA Each MTA has it's own MX and will send out mails directly, means it only affects incoming mails. We have this done now by a service company but would like to do this 'in house' instead. Now i send a plain text mail with all valid addresses and the target MX like this: userabc@domain.de (is sent to germany MTA) user123@domain.de:usa (is sent to usa MTA) userxyz@domain.de:asia (is sent to asia MTA) Any not listed addresses are blocked. My wish is to run Pegasus on our primary MX-Record and 'route' the mails according to different destinations (MXs) based on the recipient address(es). Many of our mails have multiple recipients (all countries) all addressed in 'TO:' I know the easiest way would be mail (sub) domains for each location but that's not agreed by management. Do you think such can be implemented with Pegasus? Thanks for reading and spending your time. Regards Wolfgang

There are usually several ways to handle situations like this in Mercury (Mercury is the MTA program, Pegasus is the email client program). It's possible to write plugins, called daemons, to handle specific tasks in Mercury, but if you want to do it without any additional programming it would probably be easiest to use file-based forwarding.

To do this, make sure that file-based forwarding is activated in Core configuration / Advanced, create local mailboxes for all users, and fill in the address where the message should be delivered using the mail forwarding file option. Forwarding could be done directly by SMTP by using a numerical (IP literal) address such as user123@[11.22.33.44] if no addressable FQDN for the remote MTA host is available. The TO: header in the message will not be changed, only the address in the SMTP envelope.

<p>There are usually several ways to handle situations like this in Mercury (Mercury is the MTA program, Pegasus is the email client program). I<span style="font-size: 13.3333px;">t's possible to write plugins, called daemons, to handle specific tasks in Mercury, but i</span>f you want to do it without any additional programming it would probably be easiest to use file-based forwarding. </p><p>To do this, make sure that file-based forwarding is activated in Core configuration / Advanced, create local mailboxes for all users, and fill in the address where the message should be delivered using the mail forwarding file option. Forwarding could be done directly by SMTP by using a numerical (IP literal) address such as user123@[11.22.33.44] if no addressable FQDN for the remote MTA host is available. The TO: header in the message will not be changed, only the address in the SMTP envelope.</p>

Rolf, you've caught me, of course I meant Mercury not Pegasus. (ashamed)

Sadly I have no programming experience. Therefore, I will try with file-based forwarding.

Is there way without creating mailboxes for all users?

I gave hMailServer a try as there is a roule/route function without any mailboxes defined. Unfortunately, when i have eg. 3 addresses in 'TO:' for one destination each all mails are delivered to only one MTA. (We have this often.)
This would force me to create lots of rules on each target MTA in plenty combinations to forward these mails to their legal recipients. Not elegant and disgusting to administrate but does work.

If necessary, i will create a few users and see how it works. Anyhow it sounds like much less work to get my result.
The 3 MTAs are on static IPs, registered in DNS and have a reverse entry. So i have any possible way in and out.
When you say the TO: header will not be changed does this mean the complete mail header stays unchanged? This would be a great benefit when it comes to evaluate faulty mails.

And one more question: i'm using a server 2K8-R2 (64) now for testing and propably as productive system afterwards. Will this get me into trouble?

Many thanks for your reply.

Rolf, you've caught me, of course I meant Mercury not Pegasus. (ashamed) Sadly I have no programming experience. Therefore, I will try with file-based forwarding. Is there way without creating mailboxes for all users? I gave hMailServer a try as there is a roule/route function without any mailboxes defined. Unfortunately, when i have eg. 3 addresses in 'TO:' for one destination each all mails are delivered to only one MTA. (We have this often.) This would force me to create lots of rules on each target MTA in plenty combinations to forward these mails to their legal recipients. Not elegant and disgusting to administrate but does work. If necessary, i will create a few users and see how it works. Anyhow it sounds like much less work to get my result. The 3 MTAs are on static IPs, registered in DNS and have a reverse entry. So i have any possible way in and out. When you say the TO: header will not be changed does this mean the complete mail header stays unchanged? This would be a great benefit when it comes to evaluate faulty mails. And one more question: i'm using a server 2K8-R2 (64) now for testing and propably as productive system afterwards. Will this get me into trouble? Many thanks for your reply.

There are filtering rules and domain re-routing alternatives in Mercury as well, but I think file-based forwarding will be a better approach even if it means creating mailboxes. (Unless there is some foolproof way of knowing the destination server from the e-mail address for each user.)

All headers from the original message are kept, but some will of course be added during forwarding.

Mercury will run fine under Windows 2008 Server, but should probably be run as a program rather than as a service until v5 is out (to be able to access the GUI). Make sure to update to the just-released v4.80 final: http://download-us.pmail.com/m32-480.exe

<p>There are filtering rules and domain re-routing alternatives in Mercury as well, but I think file-based forwarding will be a better approach even if it means creating mailboxes. (Unless there is some foolproof way of knowing the destination server from the e-mail address for each user.)</p><p>All headers from the original message are kept, but some will of course be added during forwarding.</p><p>Mercury will run fine under Windows 2008 Server, but should probably be run as a program rather than as a service until v5 is out (to be able to access the GUI). Make sure to update to the just-released v4.80 final: http://download-us.pmail.com/m32-480.exe</p>

Don't know what the brackets [] stand for. Have tried the forwarding now and it's working in 'principle'.

My testing shows an extended header but with the original TO: in it.
The destination user123@[11.22.33.44] comes to an error and loop in the ..\MERCURY\QUEUE\ directory. Think this comes from the fact that the servers (Mercury and german MTA) stay in the same IP-Range. Using FQDN like user123@[mail.mydomain.de] works.
(how can i stop such a loop from running endless?)

When the forwarded mail arrives at destination (german MTA) the recipient address unfortunately does not show "user123@mydomain.de" as it would be through a standard delivery. Instead it shows "user123@mail.mydomain.de". My suspicion now is that my MTA does not use the TO: recipient for addressing but the envelope recipient instead. Could this be the reason?
If so, i have no chance to access or change this behaviour.

I also tried to work it out with "Edit global rules" with no success.
Rule type "Headers" with TO: contains user123@mydomain.de => Forward message => german MTA doesn't work and a test using "Scan list" didn't either.

Is there any other thing / setting i can try?

Thanks.

Don't know what the brackets [] stand for. Have tried the forwarding now and it's working in 'principle'. My testing shows an extended header but with the original TO: in it. The destination user123@[11.22.33.44] comes to an error and loop in the ..\MERCURY\QUEUE\ directory. Think this comes from the fact that the servers (Mercury and german MTA) stay in the same IP-Range. Using FQDN like user123@[mail.mydomain.de] works. (how can i stop such a loop from running endless?) When the forwarded mail arrives at destination (german MTA) the recipient address unfortunately does not show "user123@mydomain.de" as it would be through a standard delivery. Instead it shows "user123@mail.mydomain.de". My suspicion now is that my MTA does not use the TO: recipient for addressing but the envelope recipient instead. Could this be the reason? If so, i have no chance to access or change this behaviour. I also tried to work it out with "Edit global rules" with no success. Rule type "Headers" with TO: contains user123@mydomain.de => Forward message => german MTA doesn't work and a test using "Scan list" didn't either. Is there any other thing / setting i can try? Thanks.
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft