Community Discussions and Support
Securing Mercury against unauthorised connections

[quote user="Rolf Lindby"]To allow for local users connecting from the Internet and authenticating use operation D instead of H in the rule.[/quote]

*Facepalm* I could not see for looking. Thanks!

<p>[quote user="Rolf Lindby"]To allow for local users connecting from the Internet and authenticating use <span style="font-family: Tahoma, Arial, Helvetica; font-size: 12px;">operation D instead of H in the rule.</span>[/quote]</p><p>*Facepalm* I could not see for looking. Thanks!</p>

Hi

We presently use Mercury/32 to manage mail for three domains. Our mail passes through a 3rd party filtering service.

We use Google Apps GMail for staff that are out of the office and who need to work in local authority offices. This is because the local authority will not allow IMAP connections. GMail is configured so that mail is routed via our server which allows us to make and keep a copy of all messages sent. But - GMail does not allow an SMTP password to be entered as part of the 'remote gateway' setup.

We also allow certain staff to access their mail from home or on the move via IMAP.

SMTP>Relaying control is configured as follows to allow GMail to relay mail via our server: 

Use strict local relaying restrictions is checked

Authenticated SMTP connections may relay mail is checked

Only Authenticated SMTP connections my relay mail is not checked 

The other problem I have is that in order for staff to relay mail via our server from their home computers we need to configure Mercury/32 to allow connections from any source. This is because staff that use IMAP do not have static IP addresses, which would allow me to add those addresses to the Connection Control section of Mercury's SMTP configuration.

However, today one of our staff received a message containing malicious code. The message headers have our postmaster address as the sender address. The message originated from an external IP. I've appended the headers below.

I'm not really sure how to proceed. I need to keep all connections open for staff IMAP access and I also cannot allow only authenticated relaying because Google Apps does not make provision for entering an SMTP password.

Does anyone have any suggestions for me, please? I've not had to go down this route before so am out of my depth.

Thanks. 

*********************************************************************************************************

05:28:16.861: Connection from 122.144.10.242, Thu Apr 17 05:28:16 2014<lf>

05:28:16.861: << 220 **our-domain**.co.uk ESMTP server ready.<cr><lf>

05:28:16.080: >> EHLO **our-domain**.co.uk<cr><lf>

05:28:16.080: << 250-**our-domain**.co.uk Hello **our-domain**.co.uk; ESMTPs are:<cr><lf>250-TIME<cr><lf>

05:28:16.080: << 250-SIZE 0<cr><lf>

05:28:16.080: << 250-AUTH CRAM-MD5 LOGIN<cr><lf>

05:28:16.080: << 250-AUTH=LOGIN<cr><lf>

05:28:16.080: << 250 HELP<cr><lf>

05:28:18.406: >> MAIL FROM:<postmaster@**our-domain**.co.uk><cr><lf>

05:28:18.406: << 250 Sender OK - send RCPTs.<cr><lf>

05:28:18.624: >> RCPT TO:<user@**our-domain**.co.uk><cr><lf>

05:28:18.624: << 250 Recipient OK - send RCPT or DATA.<cr><lf>

05:28:18.842: >> DATA<cr><lf>

05:28:18.858: << 354 OK, send data, end with CRLF.CRLF<cr><lf>

05:28:18.061: >> From: "The Post Office" <postmaster@**our-domain**.co.uk><cr><lf>

05:28:18.076: >> To: user@**our-domain**.co.uk<cr><lf>

05:28:18.076: >> Subject: DELIVERY REPORTS ABOUT YOUR E-MAIL<cr><lf>

05:28:18.076: >> Date: Thu, 17 Apr 2014 10:25:24 +0600<cr><lf>

05:28:18.076: >> MIME-Version: 1.0<cr><lf>

05:28:18.076: >> Content-Type: multipart/mixed;<cr><lf>

05:28:18.076: >> boundary="----=_NextPart_000_0001_45AB10F8.B838EC9C"<cr><lf>

05:28:18.076: >> X-Priority: 3<cr><lf>

05:28:18.076: >> X-MSMail-Priority: Normal<cr><lf>

05:28:18.076: >> X-Mailer: Microsoft Outlook Express 6.00.2600.0000<cr><lf>

05:28:18.076: >> X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000<cr><lf>

05:28:18.076: >> <cr><lf>

05:28:18.076: >> This is a multi-part message in MIME format.<cr><lf>

05:28:18.076: >> <cr><lf>

05:28:18.076: >> ------=_NextPart_000_0001_45AB10F8.B838EC9C<cr><lf>

05:28:18.076: >> Content-Type: text/plain;<cr><lf>

05:28:18.076: >> charset=us-ascii<cr><lf>

05:28:18.076: >> Content-Transfer-Encoding: 7bit<cr><lf>

05:28:18.076: >> <cr><lf>

05:28:18.076: >> Dear user of **our-domain**.co.uk,<cr><lf>

05:28:18.092: >> <cr><lf>

05:28:18.092: >> We have detected that your email account was used to send a huge amount of spam during this week.<cr><lf>

05:28:18.092: >> Probably, your computer had been compromised and now contains a trojan proxy server.<cr><lf>

05:28:18.092: >> <cr><lf>

05:28:18.092: >> We recommend that you follow the instructions in the attached text file in order to keep your computer safe.<cr><lf>

05:28:18.092: >> <cr><lf>

05:28:18.092: >> Best wishes,<cr><lf>

05:28:18.092: >> **our-domain**.co.uk support team.<cr><lf>

05:28:18.092: >> <cr><lf>

05:28:18.092: >> <cr><lf>

05:28:18.092: >> ------=_NextPart_000_0001_45AB10F8.B838EC9C<cr><lf>

05:28:18.092: >> Content-Type: application/octet-stream;<cr><lf>

05:28:18.092: >> name="tftmth.zip"<cr><lf>

05:28:18.092: >> Content-Transfer-Encoding: base64<cr><lf>

05:28:18.092: >> Content-Disposition: attachment;<cr><lf>

05:28:18.092: >> filename="tftmth.zip"<cr><lf>

05:28:18.092: >> <cr><lf> 

&lt;p&gt;Hi&lt;/p&gt;&lt;p&gt;We presently use Mercury/32 to manage mail for three domains. Our mail passes through a 3rd party filtering service.&lt;/p&gt;&lt;p&gt;We use Google Apps GMail for staff that are out of the office and who need to work in local authority offices. This is because the local authority will not allow IMAP connections.&amp;nbsp;&lt;span style=&quot;font-size: 10pt;&quot;&gt;GMail is configured so that mail is routed via our server which allows us to make and keep a copy of all messages sent. But - GMail does not allow an SMTP password to be entered as part of the &#039;remote gateway&#039; setup.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;We also allow certain staff to access their mail from home or on the move via IMAP.&lt;/p&gt;&lt;p&gt;SMTP&amp;gt;Relaying control is configured as follows to allow GMail to relay mail via our server:&amp;nbsp;&lt;/p&gt;&lt;p&gt;Use strict local relaying restrictions is checked&lt;/p&gt;&lt;p&gt;Authenticated SMTP connections may relay mail is checked&lt;/p&gt;&lt;p&gt;Only Authenticated SMTP connections my relay mail is not checked&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The other problem I have is that in order for staff to relay mail via our server from their home computers we need to configure Mercury/32 to allow connections from any source. This is because staff that use IMAP do not have static IP addresses, which would allow me to add those addresses to the Connection Control section of Mercury&#039;s SMTP configuration.&lt;/p&gt;&lt;p&gt;However, today one of our staff received a message containing malicious code. The message headers have our postmaster address as the sender address. The message originated from an external IP. I&#039;ve appended the headers below.&lt;/p&gt;&lt;p&gt;I&#039;m not really sure how to proceed. I need to keep all connections open for staff IMAP access and I also cannot allow only authenticated relaying because Google Apps does not make provision for entering an SMTP password.&lt;/p&gt;&lt;p&gt;Does anyone have any suggestions for me, please? I&#039;ve not had to go down this route before so am out of my depth.&lt;/p&gt;&lt;p&gt;Thanks.&amp;nbsp;&lt;/p&gt;&lt;p&gt;*********************************************************************************************************&lt;/p&gt;&lt;p&gt;05:28:16.861: Connection from 122.144.10.242, Thu Apr 17 05:28:16 2014&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:16.861: &amp;lt;&amp;lt; 220 **our-domain**.co.uk ESMTP server ready.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:16.080: &amp;gt;&amp;gt; EHLO **our-domain**.co.uk&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:16.080: &amp;lt;&amp;lt; 250-**our-domain**.co.uk Hello **our-domain**.co.uk; ESMTPs are:&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;250-TIME&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:16.080: &amp;lt;&amp;lt; 250-SIZE 0&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:16.080: &amp;lt;&amp;lt; 250-AUTH CRAM-MD5 LOGIN&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:16.080: &amp;lt;&amp;lt; 250-AUTH=LOGIN&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:16.080: &amp;lt;&amp;lt; 250 HELP&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.406: &amp;gt;&amp;gt; MAIL FROM:&amp;lt;postmaster@**our-domain**.co.uk&amp;gt;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.406: &amp;lt;&amp;lt; 250 Sender OK - send RCPTs.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.624: &amp;gt;&amp;gt; RCPT TO:&amp;lt;user@**our-domain**.co.uk&amp;gt;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.624: &amp;lt;&amp;lt; 250 Recipient OK - send RCPT or DATA.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.842: &amp;gt;&amp;gt; DATA&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.858: &amp;lt;&amp;lt; 354 OK, send data, end with CRLF.CRLF&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.061: &amp;gt;&amp;gt; From: &quot;The Post Office&quot; &amp;lt;postmaster@**our-domain**.co.uk&amp;gt;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; To: user@**our-domain**.co.uk&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; Subject: DELIVERY REPORTS ABOUT YOUR E-MAIL&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; Date: Thu, 17 Apr 2014 10:25:24 +0600&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; MIME-Version: 1.0&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; Content-Type: multipart/mixed;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;boundary=&quot;----=_NextPart_000_0001_45AB10F8.B838EC9C&quot;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; X-Priority: 3&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; X-MSMail-Priority: Normal&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; X-Mailer: Microsoft Outlook Express 6.00.2600.0000&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; &amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; This is a multi-part message in MIME format.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; &amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; ------=_NextPart_000_0001_45AB10F8.B838EC9C&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; Content-Type: text/plain;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;charset=us-ascii&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; Content-Transfer-Encoding: 7bit&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; &amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.076: &amp;gt;&amp;gt; Dear user of **our-domain**.co.uk,&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; &amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; We have detected that your email account was used to send a huge amount of spam during this week.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; Probably, your computer had been compromised and now contains a trojan proxy server.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; &amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; We recommend that you follow the instructions in the attached text file in order to keep your computer safe.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; &amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; Best wishes,&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; **our-domain**.co.uk support team.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; &amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; &amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; ------=_NextPart_000_0001_45AB10F8.B838EC9C&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; Content-Type: application/octet-stream;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;name=&quot;tftmth.zip&quot;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; Content-Transfer-Encoding: base64&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; Content-Disposition: attachment;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;filename=&quot;tftmth.zip&quot;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;05:28:18.092: &amp;gt;&amp;gt; &amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&amp;nbsp;&lt;/p&gt;

If messages are for local recipients it's not a relaying issue, so we won't have to worry about those settings. To stop the malicious messages you could perhaps use transaction filtering in MercuryS to block the spoofed HELO/EHLO greeting (05:28:16.080: >> EHLO **our-domain**.co.uk<cr><lf>). Additionally, it could be possible to catch the attached zip files with Clamwall.

If messages are for local recipients it&#039;s not a relaying issue, so we won&#039;t have to worry about those settings. To stop the malicious messages you could perhaps use transaction filtering in MercuryS to block the spoofed HELO/EHLO greeting (05:28:16.080: &amp;gt;&amp;gt; EHLO **our-domain**.co.uk&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;). Additionally, it could be possible to catch the attached zip files with Clamwall.

Thanks a lot, Rolf.

Would you be able to help with the format of the transaction filter, please? I have read through the section in the manual 'Compliance Options' about this, but am unsure of how to implement it as the domain name is the same as that of our system. I don't know what the difference in processing is between local mail and external mail. I have encouraged everyone to use the full address when sending local mail (staff-name@ourdomain.com) so that Mercury makes a copy of it, so don't want to inadvertently stop legitimate mail.

The TRANSFLT.MER file contains the following transaction filter: H, "[EHeh][EHeh]LO +[0-9]+.[0-9]+.[0-9]+.[0-9]*", R, "554 Invalid HELO format" which is pre-configured, but I am unsure of how to tell Mercury to drop connections from mail servers that impersonate our domain name.

Thanks. 

&lt;p&gt;Thanks a lot, Rolf.&lt;/p&gt;&lt;p&gt;Would you be able to help with the format of the transaction filter, please? I have read through the section in the manual &#039;Compliance Options&#039; about this, but am unsure of how to implement it as the domain name is the same as that of our system. I don&#039;t know what the difference in processing is between local mail and external mail. I have encouraged everyone to use the full address when sending local mail (staff-name@ourdomain.com) so that Mercury makes a copy of it, so don&#039;t want to inadvertently stop legitimate mail.&lt;/p&gt;&lt;p&gt;The TRANSFLT.MER file contains the following transaction filter: H, &quot;[EHeh][EHeh]LO +[0-9]+.[0-9]+.[0-9]+.[0-9]*&quot;, R, &quot;554 Invalid HELO format&quot; which is pre-configured, but I am unsure of how to tell Mercury to drop connections from mail servers that impersonate our domain name.&lt;/p&gt;&lt;p&gt;Thanks.&amp;nbsp;&lt;/p&gt;

On my server I use:

H, "[EHeh][EHeh]LO mydomain.se*", R, "554 Illegal HELO, connection refused."

H, "[EHeh][EHeh]LO mail.mydomain.se*", R, "554 Illegal HELO, connection refused."

These rules apply to the SMTP HELO greeting, not MAIL FROM or the From header in the message. Neither your domain name (mydomain.se) or the qualified host name of the server (mail.mydomain.se) should normally appear here. If you have multiple servers handling your domain where some of them handle other domains as well, you may need to set servers to use the full host name in their greetings (if they sometimes need to send on mail from one of your servers to another for a specific domain).

 

&lt;p&gt;On my server I use:&lt;/p&gt;&lt;p&gt;H, &quot;[EHeh][EHeh]LO mydomain.se*&quot;, R, &quot;554 Illegal HELO, connection refused.&quot;&lt;/p&gt;&lt;p&gt;H, &quot;[EHeh][EHeh]LO mail.mydomain.se*&quot;, R, &quot;554 Illegal HELO, connection refused.&quot;&lt;/p&gt;&lt;p&gt;These rules apply to the SMTP HELO greeting, not MAIL FROM or the From header in the message. Neither your domain name (&lt;span style=&quot;font-size: 10pt;&quot;&gt;mydomain.se)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;or the qualified host name of the server (&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;mail.mydomain.se)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;should normally appear here. If you have multiple servers handling your domain where some of them handle other domains as well, you may need to set servers to use the full host name in their greetings (if they sometimes need to send on mail from one of your servers to another for a specific domain).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;

That's great, Rolf. Thank you very much.

We just use one server so this will be fine.

Thanks again for the help!

Cheers! 

&lt;p&gt;That&#039;s great, Rolf. Thank you very much.&lt;/p&gt;&lt;p&gt;We just use one server so this will be fine.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;Thanks again for the help!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;Cheers!&amp;nbsp;&lt;/span&gt;&lt;/p&gt;

We are starting to get these connections from other domains. Is there a way to block all domains except the one that filters our email?

The MX records for our domain only list the filtering providers' addresses. These other connections are being made directly to our IP address.

So, is possible to include a transaction filtering rule that will reject any connection that is not from *mailspamfiltering.com ? Or, is this something can be configured elsewhere in Mercury, please?

Thanks! 


&lt;p&gt;We are starting to get these connections from other domains. Is there a way to block all domains except the one that filters our email?&lt;/p&gt;&lt;p&gt;The MX records for our domain only list the filtering providers&#039; addresses. These other connections are being made directly to our IP address.&lt;/p&gt;&lt;p&gt;So, is possible to include a transaction filtering rule that will reject any connection that is not from *mailspamfiltering.com ? Or, is this something can be configured elsewhere in Mercury, please?&lt;/p&gt;&lt;p&gt;Thanks!&amp;nbsp;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;

If you want to refuse a connection that doesn't match a specific expression in transaction filtering in MercuryS you can set the action to R-N. If you use Mercury for sending messages from local users it might not be a good idea to only allow mailspamfiltering.com to connect though (unless local users always authenticate; if so use operation D in the filter rule). If you know IP addresses or IP ranges for all that should be allowed to connect it might be possible to block using connection control instead of transaction filtering.

If you want to refuse a connection that doesn&#039;t match a specific expression in transaction filtering in MercuryS you can set the action to&amp;nbsp;R-N. If you use Mercury for sending messages from local users it might not be a good idea to only allow&amp;nbsp;mailspamfiltering.com to connect though (unless local users always authenticate; if so use operation D in the filter rule). If you know IP addresses or IP ranges for all that should be allowed to connect it might be possible to block using connection control instead of transaction filtering.

[quote user="Rolf Lindby"]If you want to refuse a connection that doesn't match a specific expression in transaction filtering in MercuryS you can set the action to R-N. If you use Mercury for sending messages from local users it might not be a good idea to only allow mailspamfiltering.com to connect though (unless local users always authenticate; if so use operation D in the filter rule). If you know IP addresses or IP ranges for all that should be allowed to connect it might be possible to block using connection control instead of transaction filtering.[/quote]

Thanks a lot, Rolf

All our staff that connect remotely have to authenticate SMTP connections. They do not have static IP addresses. We use Google Apps GMail and have configured GMail's SMTP delivery IP ranges in Connection control so that they can relay via our server and are exempt from blacklisting. Local users do not authenticate.

I'd missed the optional N action in the documentation, thanks a lot for that.

So, how about if:

We use Connection control to allow local IP's (192.168.0.1 - 192.168.0.254) to connect and configure the range so that they can relay mail, are exempt from transaction filtering and are whitelisted.

and set the following transaction filter rule:

H, "[EHeh][EHeh]LO *mailspamfiltering.com*", R-N, "554 connection refused." 

-

Would that work? 

Thanks!

&lt;p&gt;[quote user=&quot;Rolf Lindby&quot;]If you want to refuse a connection that doesn&#039;t match a specific expression in transaction filtering in MercuryS you can set the action to&amp;nbsp;R-N. If you use Mercury for sending messages from local users it might not be a good idea to only allow&amp;nbsp;mailspamfiltering.com to connect though (unless local users always authenticate; if so use operation D in the filter rule). If you know IP addresses or IP ranges for all that should be allowed to connect it might be possible to block using connection control instead of transaction filtering.[/quote]&lt;/p&gt;&lt;p&gt;Thanks a lot, Rolf&lt;/p&gt;&lt;p&gt;All our staff that connect remotely have to authenticate SMTP connections. They do not have static IP addresses. We use Google Apps GMail&amp;nbsp;and have&amp;nbsp;configured&amp;nbsp;GMail&#039;s SMTP delivery IP ranges in&amp;nbsp;Connection control so that they can relay via our server and are exempt from blacklisting. Local users do not authenticate.&lt;/p&gt;&lt;p&gt;I&#039;d missed the optional N action in the documentation, thanks a lot for that.&lt;/p&gt;&lt;p&gt;-&amp;nbsp;&lt;/p&gt;&lt;p&gt;So, how about if:&lt;/p&gt;&lt;p&gt;We use Connection control to&amp;nbsp;allow local IP&#039;s (192.168.0.1 - 192.168.0.254)&amp;nbsp;to connect&amp;nbsp;and configure the range&amp;nbsp;so that they can relay mail, are exempt from transaction filtering and are whitelisted.&lt;/p&gt;&lt;p&gt;and set the following transaction filter&amp;nbsp;rule:&lt;/p&gt;&lt;p&gt;H, &quot;[EHeh][EHeh]LO *mailspamfiltering.com*&quot;, R-N, &quot;554 connection refused.&quot;&amp;nbsp;&lt;/p&gt;&lt;p&gt;-&lt;/p&gt;&lt;p&gt;Would that work?&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks!&lt;/p&gt;

As long as there aren't any other transaction filter rules that need to be applied to connections from the local IP range it looks like it should work. It's very possible that the mailspamfiltering.com MTA always uses EHLO in the greeting so it might actually not be necessary to allow HELO.

 

&lt;p&gt;As long as there aren&#039;t any other transaction filter rules that need to be applied to connections from the local IP range it looks like it should work. It&#039;s very possible that the&amp;nbsp;mailspamfiltering.com MTA always uses EHLO in the greeting so it might actually not be necessary to allow HELO.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;

Thanks a lot, Rolf

There are no transaction rules applied to local mail.

I'll exempt Google's and our spam filtering service IP addresses from transaction filtering and pop this rule into the list.

Thanks again. You've been a great help. 

&lt;p&gt;Thanks a lot, Rolf&lt;/p&gt;&lt;p&gt;There are no transaction&amp;nbsp;rules applied&amp;nbsp;to local mail.&lt;/p&gt;&lt;p&gt;I&#039;ll exempt&amp;nbsp;Google&#039;s and our&amp;nbsp;spam filtering service IP addresses from transaction filtering and&amp;nbsp;pop this rule into the list.&lt;/p&gt;&lt;p&gt;Thanks again. You&#039;ve been a great help.&amp;nbsp;&lt;/p&gt;

Unfortunately, that is not working as expected. Staff that try to send messages when away from the office are having their connections refused. As stated above all remote connections require authentication.

I tried adding rules using the M operation and defining the domains we use and suppressing further transaction processing but the H rule is still active:

M, "*domain1.co.uk*" S
M, "*domain2.org*" S
H, "[EHeh][EHeh]LO *mailspamfiltering.com*", R-N, "554 connection refused." 

When I try to send a mail message from my home machine MercuryS refuses the connection: 

Connection from 12.23.56.78, Sat Jun 07 08:43:02 2014
EHLO [192.168.1.100]
554 connection refused.

Here's the full mer file:

H, "*80.45.49.93*", R, "554"
R, "*honeypot@aphrodite.pmail.gen.nz*", RS, "554 Fraudulent RCPT rejected."
S, "*viagra*", D, "'Viagra' encountered in subject line - connection dropped."
S, "*vicodin*", R, "554 'Vicodin' encountered in subject line - message refused."
M, "*@domain1.co.uk*" S
M, "*@domain2.org*" S
H, "[EHeh][EHeh]LO +[0-9]+.[0-9]+.[0-9]+.[0-9]*", R, "554 Invalid HELO format"
H, "[EHeh][EHeh]LO domain1.co.uk*", R, "554 Illegal HELO, connection refused."
H, "[EHeh][EHeh]LO mail.domain1.co.uk*", R, "554 Illegal HELO, connection refused."
H, "[EHeh][EHeh]LO domain2.org*", R, "554 Illegal HELO, connection refused."
H, "[EHeh][EHeh]LO mail.domain2.org*", R, "554 Illegal HELO, connection refused."
H, "[EHeh][EHeh]LO *mailspamfiltering.com*", R-N, "554 connection refused."
# S, "/c*CONGRATULATIONS*WON*", BS, "554 Possibly Nigerian 419 Variant - please change and re-send."
# S, "*for job*", BS, "554 Possibly employment spam - please change and re-send."

As soon as I comment out    H, "[EHeh][EHeh]LO *mailspamfiltering.com*", R-N, "554 connection refused."     connections from my home machine are allowed.

I'm obviously doing something wrong here but can't figure it out. Can anyone help me with this, please?

&lt;p&gt;Unfortunately, that is not working as expected. Staff that try to send messages when away from the office are having their connections refused. As stated above all remote connections require authentication.&lt;/p&gt;&lt;p&gt;I tried&amp;nbsp;adding rules using the M operation and defining the domains we&amp;nbsp;use and suppressing further transaction processing&amp;nbsp;but the H rule is still active:&lt;/p&gt;&lt;p&gt;M, &quot;*domain1.co.uk*&quot; S M, &quot;*domain2.org*&quot; S H, &quot;[EHeh][EHeh]LO *mailspamfiltering.com*&quot;, R-N, &quot;554 connection refused.&quot;&amp;nbsp;&lt;/p&gt;&lt;p&gt;When I try to send a mail message from my home machine MercuryS&amp;nbsp;refuses the connection:&amp;nbsp;&lt;/p&gt;&lt;p&gt;Connection from 12.23.56.78, Sat Jun 07 08:43:02 2014 EHLO [192.168.1.100] 554 connection refused.&lt;/p&gt;&lt;p&gt;Here&#039;s the full mer file:&lt;/p&gt;&lt;p&gt;H, &quot;*80.45.49.93*&quot;, R, &quot;554&quot; R, &quot;*honeypot@aphrodite.pmail.gen.nz*&quot;, RS, &quot;554 Fraudulent RCPT rejected.&quot; S, &quot;*viagra*&quot;, D, &quot;&#039;Viagra&#039; encountered in subject line - connection dropped.&quot; S, &quot;*vicodin*&quot;, R, &quot;554 &#039;Vicodin&#039; encountered in subject line - message refused.&quot; M, &quot;*@domain1.co.uk*&quot; S M, &quot;*@domain2.org*&quot; S H, &quot;[EHeh][EHeh]LO +[0-9]+.[0-9]+.[0-9]+.[0-9]*&quot;, R, &quot;554 Invalid HELO format&quot; H, &quot;[EHeh][EHeh]LO domain1.co.uk*&quot;, R, &quot;554 Illegal HELO, connection refused.&quot; H, &quot;[EHeh][EHeh]LO mail.domain1.co.uk*&quot;, R, &quot;554 Illegal HELO, connection refused.&quot; H, &quot;[EHeh][EHeh]LO domain2.org*&quot;, R, &quot;554 Illegal HELO, connection refused.&quot; H, &quot;[EHeh][EHeh]LO mail.domain2.org*&quot;, R, &quot;554 Illegal HELO, connection refused.&quot; H, &quot;[EHeh][EHeh]LO *mailspamfiltering.com*&quot;, R-N, &quot;554 connection refused.&quot; # S, &quot;/c*CONGRATULATIONS*WON*&quot;, BS, &quot;554 Possibly Nigerian 419 Variant - please change and re-send.&quot; # S, &quot;*for job*&quot;, BS, &quot;554 Possibly employment spam - please change and re-send.&quot;&lt;/p&gt;&lt;p&gt;As soon as I comment out&amp;nbsp;&amp;nbsp; &amp;nbsp;H, &quot;[EHeh][EHeh]LO *mailspamfiltering.com*&quot;, R-N, &quot;554 connection refused.&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connections from my home machine are allowed.&lt;/p&gt;&lt;p&gt;I&#039;m obviously doing something wrong here but can&#039;t figure it out. Can anyone help me with this, please?&lt;/p&gt;

To allow for local users connecting from the Internet and authenticating use operation D instead of H in the rule.

To allow for local users connecting from the Internet and authenticating use&amp;nbsp;&lt;span style=&quot;font-family: Tahoma, Arial, Helvetica; font-size: 12px;&quot;&gt;operation D instead of H in the rule.&lt;/span&gt;
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