Community Discussions and Support
mxredir.dll

Thomas & Dilbert,

Thanks for taking the time to correct my naivety in this matter. I'll take a look at the POP3 connectors, which is where Thomas directed me to in the first place.

Regards,
Richard

<P>Thomas & Dilbert,</P> <P>Thanks for taking the time to correct my naivety in this matter. I'll take a look at the POP3 connectors, which is where Thomas directed me to in the first place.</P> <P>Regards, Richard</P>

Following a suggestion I was given in another thread 'Relay only specified domains', I'm trying to use mxredir.dll.

Does anyone have it working properly? For me it half works, but I may not have the settings right. I'm testing it with two hosts, each running a copy of Mercury. Using fictional addresses and domain names:

MX records for mydomain.net and myotherdomain.net point to 1.2.3.4

HostA

1.2.3.4

Mercury on HostA has mydomain.net as a local domain, for myotherdomain.net, I'm using:

Local host or server = daemon:C:\Mercury\mxredir.dll;[5.6.7.8]

Internet name =myotherdomain.net

HostB

5.6.7.8

Has myotherdomain.net as a local domain 

If I send mail to richard@myotherdomain.net, it arrives at HostA, which sends it on to  HostB.

However, looking at the SMTP connection history on HostB, the RCPT TO: field has been changed to:

RCPT TO: <richard@[5.6.7.8]> 

Is there any way of keeping the correct recipient?

 

Regards,

Richard 

&lt;p&gt;Following a suggestion I was given in another thread &#039;Relay only specified domains&#039;, I&#039;m trying to use mxredir.dll.&lt;/p&gt; &lt;p&gt;Does anyone have it working properly? For me it half works, but I may not have the settings right. I&#039;m testing it with two hosts, each running a copy of Mercury. Using fictional addresses and domain names:&lt;/p&gt; &lt;p&gt; MX records for mydomain.net and myotherdomain.net point to 1.2.3.4 &lt;/p&gt; &lt;p&gt;HostA 1.2.3.4 Mercury on HostA has mydomain.net as a local domain, for myotherdomain.net, I&#039;m using: Local host or server = daemon:C:\Mercury\mxredir.dll;[5.6.7.8] Internet name =myotherdomain.net &lt;/p&gt; &lt;p&gt;HostB 5.6.7.8 Has myotherdomain.net as a local domain&amp;nbsp;&lt;/p&gt; &lt;p&gt;If I send mail to richard@myotherdomain.net, it arrives at HostA, which sends it on to&amp;nbsp; HostB. However, looking at the SMTP connection history on HostB, the RCPT TO: field has been changed to: RCPT TO: &amp;lt;richard@[5.6.7.8]&amp;gt;&amp;nbsp; &lt;/p&gt; &lt;p&gt;Is there any way of keeping the correct recipient?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;Richard&amp;nbsp;&lt;/p&gt;

You're correct it's not a proper mxredir - it rewrites the To info, and replaces the just received email into the queue - so it is actually forwarding the email to another domain.

&lt;P&gt;You&#039;re correct it&#039;s not a proper mxredir - it rewrites the To info, and replaces the just received email into the queue - so it is actually forwarding the email to another domain.&lt;/P&gt;

Hmmm, I only briefly tested this with a domain literal address, so I missed this, sorry.

Does it change the "To:" address as displayed in the mail client, or just the smtp envelope RCPT TO: address?

 

&lt;p&gt;Hmmm, I only briefly tested this with a domain literal address, so I missed this, sorry.&lt;/p&gt;&lt;p&gt;Does it change the &quot;To:&quot; address as displayed in the mail client, or just the smtp envelope RCPT TO: address? &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;

[quote user="dilberts_left_nut"]

Does it change the "To:" address as displayed in the mail client, or just the smtp envelope RCPT TO: address?

[/quote]

 

I don't know. It never seemed to arrive in my mailbox for me to look at that.

But, I think I've found another way to achieve what I want. Thanks for your mxredir suggestion anyway. It was interesting to play with, even though it didn't work.

Regards

Richard 

[quote user=&quot;dilberts_left_nut&quot;]&lt;p&gt;Does it change the &quot;To:&quot; address as displayed in the mail client, or just the smtp envelope RCPT TO: address? &lt;/p&gt;&lt;p&gt;[/quote]&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I don&#039;t know. It never seemed to arrive in my mailbox for me to look at that.&lt;/p&gt;&lt;p&gt;But, I think I&#039;ve found another way to achieve what I want. Thanks for your mxredir suggestion anyway. It was interesting to play with, even though it didn&#039;t work.&lt;/p&gt;&lt;p&gt;Regards&lt;/p&gt;&lt;p&gt;Richard&amp;nbsp;&lt;/p&gt;

[quote user="dilberts_left_nut"]What is your solution, just out of interest?
[/quote]

ok. So the problem is that I have an Exchange server hosting domains DomainB.com and DomainC.com. It's on a private address of 10.1.0.2 behind NAT, which has a public address of a.b.c.d . I wanted all the inbound mail for DomainB and DomainC to be relayed through a Mercury server at 10.1.0.3, before reaching the Exchange host, where I could take advantage of SpamHalter, the Content control and Blacklist definitions.

 

My solution is to run the Mercury server with DomainA as a local domain. The only accounts in DomainA the admin account and spam & nospam for SpamHalter. From the outside world, connecting to port 25 on the firewall, ie a.b.c.d:25 results in a connection to the Mercury server. Incoming SMTP connections cannot connect to the Exchange server. As far as the outside world is concerned, the MX records for all 3 domains refer to a.b.c.d . Mercury is configured to act as an open relay, but, there are Global Filtering rules to theis effect:

If the 'To' field header contains the text '@DomainA.com' Exit from rule processing.

If the 'To' field header contains the text '@DomainB.com' Exit from rule processing.

If the 'To' field header contains the text '@DomainC.com' Exit from rule processing.

If the 'To' field header contains the text '@' Delete the message.

So, the only mail that will survive, will be that that's supposed to be relayed to DomainB or DomainC. Plus, I can send corrections to spam@DomainA.com and nospam@DomainB.com.

The last bit of the setup is that the Mercury host is configured to use a DNS server on the private network which has MX records for DomainB & DomainC refering to 10.1.0.2.

The Exchange server is free to make outbound SMTP connections and can therefore deliver mail to anywhere.

It seems to do what I want, although Thomas says that the filters don't work too well. I'd be interested to know in what situations, if any, they don't work.

Regards,

Richard

[quote user=&quot;dilberts_left_nut&quot;]What is your solution, just out of interest? [/quote] &lt;p&gt;ok. So the problem is that I have an Exchange server hosting domains DomainB.com and DomainC.com. It&#039;s on a private address of 10.1.0.2 behind NAT, which has a public address of a.b.c.d . I wanted all the inbound mail for DomainB and DomainC to be relayed through a Mercury server at 10.1.0.3, before reaching the Exchange host, where I could take advantage of SpamHalter, the Content control and Blacklist definitions.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;My solution is to run the Mercury server with DomainA as a local domain. The only accounts in DomainA the admin account and spam &amp;amp; nospam for SpamHalter. From the outside world, connecting to port 25 on the firewall, ie a.b.c.d:25 results in a connection to the Mercury server. Incoming SMTP connections cannot connect to the Exchange server. As far as the outside world is concerned, the MX records for all 3 domains refer to a.b.c.d . Mercury is configured to act as an open relay, but, there are Global Filtering rules to theis effect: If the &#039;To&#039; field header contains the text &#039;@DomainA.com&#039; Exit from rule processing. If the &#039;To&#039; field header contains the text &#039;@DomainB.com&#039; Exit from rule processing. If the &#039;To&#039; field header contains the text &#039;@DomainC.com&#039; Exit from rule processing. If the &#039;To&#039; field header contains the text &#039;@&#039; Delete the message. So, the only mail that will survive, will be that that&#039;s supposed to be relayed to DomainB or DomainC. Plus, I can send corrections to spam@DomainA.com and nospam@DomainB.com. The last bit of the setup is that the Mercury host is configured to use a DNS server on the private network which has MX records for DomainB &amp;amp; DomainC refering to 10.1.0.2. The Exchange server is free to make outbound SMTP connections and can therefore deliver mail to anywhere. &lt;/p&gt; &lt;p&gt;It seems to do what I want, although Thomas says that the filters don&#039;t work too well. I&#039;d be interested to know in what situations, if any, they don&#039;t work.&lt;/p&gt; Regards, Richard

[quote user="rhayward"]

open relay, but, there are Global Filtering rules to theis effect:

If the 'To' field header contains the text '@DomainA.com' Exit from rule processing.

If the 'To' field header contains the text '@DomainB.com' Exit from rule processing.

If the 'To' field header contains the text '@DomainC.com' Exit from rule processing.

If the 'To' field header contains the text '@' Delete the message.

So, the only mail that will survive, will be that that's supposed to be relayed to DomainB or DomainC. Plus, I can send corrections to spam@DomainA.com and nospam@DomainB.com.

It seems to do what I want, although Thomas says that the filters don't work too well. I'd be interested to know in what situations, if any, they don't work.

Regards,

Richard[/quote]

This will miss (and delete) any CC'd or BCC'd  mail or mail lists etc that don't put the intended recipient in the To: address of the mail headers.

Unfortunately the RCPT TO: envelope header cannot be tested for in filtering rules.

You might be better off using domain mailboxes (set DomainB & C as local to mercury).

Mail that gets through the filters (without being MOVED) and is delivered by core will get an 'X-Envelope-To:' header with the original recipient.

Then you would need the pop connector for Exchange to pull the mail from the domain mailboxes. 

[quote user=&quot;rhayward&quot;]&lt;p&gt;open relay, but, there are Global Filtering rules to theis effect: If the &#039;To&#039; field header contains the text &#039;@DomainA.com&#039; Exit from rule processing. If the &#039;To&#039; field header contains the text &#039;@DomainB.com&#039; Exit from rule processing. If the &#039;To&#039; field header contains the text &#039;@DomainC.com&#039; Exit from rule processing. If the &#039;To&#039; field header contains the text &#039;@&#039; Delete the message. So, the only mail that will survive, will be that that&#039;s supposed to be relayed to DomainB or DomainC. Plus, I can send corrections to spam@DomainA.com and nospam@DomainB.com. It seems to do what I want, although Thomas says that the filters don&#039;t work too well. I&#039;d be interested to know in what situations, if any, they don&#039;t work.&lt;/p&gt;&lt;p&gt; Regards, Richard[/quote]&lt;/p&gt;&lt;p&gt;This will miss (and delete) any CC&#039;d or BCC&#039;d&amp;nbsp; mail or mail lists etc that don&#039;t put the intended recipient in the To: address of the mail headers.&lt;/p&gt;&lt;p&gt;Unfortunately the RCPT TO: envelope header cannot be tested for in filtering rules.&lt;/p&gt;&lt;p&gt;You might be better off using domain mailboxes (set DomainB &amp;amp; C as local to mercury).&lt;/p&gt;&lt;p&gt;Mail that gets through the filters (without being MOVED) and is delivered by core will get an &#039;X-Envelope-To:&#039; header with the original recipient. &lt;/p&gt;&lt;p&gt;Then you would need the pop connector for Exchange to pull the mail from the domain mailboxes.&amp;nbsp;&lt;/p&gt;

The filters do not work when the actual domain is not in the RFC 2822 message headers.  In addition, you are only looking at the To: field and the Cc; of Bcc: field may have the address with the domain of interest.  For example, mail from the PMail list has the senders email address in the From: field and the PMail list address in the To: field, the receivers address is not in any of the address fields. My domain shows up nowhere in the message except for the X-Envelope-To: added when the mail message is written to the user mailbox and  X-Recipient: header added by POPFileD.  In this case the RCPT TO: address support@tstephenson.com (and domain) is only available for filtering in the POPFileD added header.

 If you were to use Mercury/32 domain mailboxes for the two Exchange server domains then you could have Exchange pull the mail from the Mercury/32 host using one of the many POP3 connectors available to download and deliver the mail to the users.  In this case the X-Envelope-To: headers will contain the original RCPT TO: address.  I did a Yahoo search on "exchange server POP3 connector" and came up with quite a few.  Maybe the latest Exchange server comes with one as well.  If the POP3 connector could use this header for delivery the system could do away with all of the filtering .

 


  

&lt;p&gt;The filters do not work when the actual domain is not in the RFC 2822 message headers.&amp;nbsp; In addition, you are only looking at the To: field and the Cc; of Bcc: field may have the address with the domain of interest.&amp;nbsp; For example, mail from the PMail list has the senders email address in the From: field and the PMail list address in the To: field, the receivers address is not in any of the address fields. My domain shows up nowhere in the message except for the X-Envelope-To: added when the mail message is written to the user mailbox and &amp;nbsp;X-Recipient: header added by POPFileD.&amp;nbsp; In this case the RCPT TO: address support@tstephenson.com (and domain) is only available for filtering in the POPFileD added header.&lt;/p&gt;&lt;p&gt;&amp;nbsp;If you were to use Mercury/32 domain mailboxes for the two Exchange server domains then you could have Exchange pull the mail from the Mercury/32 host using one of the many POP3 connectors available to download and deliver the mail to the users.&amp;nbsp; In this case the X-Envelope-To: headers will contain the original RCPT TO: address.&amp;nbsp; I did a Yahoo search on &quot;exchange server POP3 connector&quot; and came up with quite a few.&amp;nbsp; Maybe the latest Exchange server comes with one as well.&amp;nbsp; If the POP3 connector could use this header for delivery the system could do away with all of the filtering . &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
0
-1
0
This topic is closed
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