Hmmm. This does not work. Mercury 4.80beta accepts further commands. I would expect that Mercury refuses the connection.
01:00:14.121: >> EHLO<cr><lf><br></lf></cr>
01:00:14.152: << 250-foo.bar Hello ; ESMTPs are:<cr><lf>250-TIME<cr><lf><br></lf></cr></lf></cr>
01:00:14.152: << 250-SIZE 123456789<cr><lf><br></lf></cr>
01:00:14.152: << 250-STARTTLS<cr><lf><br></lf></cr>
01:00:14.152: << 250 HELP<cr><lf><br></lf></cr>
01:00:31.433: >> MAIL FROM: foobar@foo.bar<cr><lf><br></lf></cr>
01:00:31.433: << 250 Sender OK - send RCPTs.<cr><lf><br></lf></cr>
01:01:01.277: >> RCPT TO: foobar@foo.bar<cr><lf><br></lf></cr>
01:01:01.277: << 250 Recipient OK - send RCPT or DATA.<cr><lf><br></lf></cr>
01:01:11.949: >> DATA<cr><lf><br></lf></cr>
01:01:11.949: << 354 OK, send data, end with CRLF.CRLF<cr><lf><br></lf></cr>
01:01:13.980: >> .<cr><lf><br></lf></cr>
01:01:13.980: << 250 Data received OK.<cr><lf><br></lf></cr>
01:01:17.605: >> QUIT<cr><lf><br></lf></cr>
01:01:17.605: << 221 foo.bar Service closing channel.<cr><lf><br></lf></cr>
01:01:17.605: --- Connection closed normally at 26 Jul 2015, 1:01:17.605. ---
01:01:17.605:
I will use a work-around until somebody posts a better solution. A test with the following filtering rule works as expected:
M, "*foobar@foo.bar*", RS, "Mail from foobar@foo.bar - Connection refused"
19:15:31.574: >> EHLO<cr><lf><br></lf></cr>
19:15:31.621: << 250-foo.bar Hello ; ESMTPs are:<cr><lf>250-TIME<cr><lf><br></lf></cr></lf></cr>
19:15:31.636: << 250-SIZE 123456789<cr><lf><br></lf></cr>
19:15:31.636: << 250-STARTTLS<cr><lf><br></lf></cr>
19:15:31.636: << 250 HELP<cr><lf><br></lf></cr>
19:15:31.933: << MAIL FROM: foobar@foo.bar<cr><lf><br></lf></cr>
19:15:31.933: << Mail from foobar@foo.bar - Connection refused<cr><lf><br></lf></cr>
19:15:32.246: >> RCPT TO: barfoo@bar.foo<cr><lf><br></lf></cr>
19:15:32.246: << 554 Shunned connection - only the QUIT command will be accepted.<cr><lf><br></lf></cr>
19:15:32.543: >>
19:15:32.558: --- Connection closed normally at 25 Jul 2015, 19:15:32.558. ---
19:15:32.558:
<p>Hmmm. This does not work. Mercury 4.80beta accepts further commands. I would expect that Mercury refuses the connection.</p>
<p>01:00:14.121: &gt;&gt; EHLO<cr><lf>
01:00:14.152: &lt;&lt; 250-foo.bar Hello ; ESMTPs are:<cr><lf>250-TIME<cr><lf>
01:00:14.152: &lt;&lt; 250-SIZE 123456789<cr><lf>
01:00:14.152: &lt;&lt; 250-STARTTLS<cr><lf>
01:00:14.152: &lt;&lt; 250 HELP<cr><lf>
01:00:31.433: &gt;&gt; MAIL FROM: foobar@foo.bar<cr><lf>
01:00:31.433: &lt;&lt; 250 Sender OK - send RCPTs.<cr><lf>
01:01:01.277: &gt;&gt; RCPT TO: foobar@foo.bar<cr><lf>
01:01:01.277: &lt;&lt; 250 Recipient OK - send RCPT or DATA.<cr><lf>
01:01:11.949: &gt;&gt; DATA<cr><lf>
01:01:11.949: &lt;&lt; 354 OK, send data, end with CRLF.CRLF<cr><lf>
01:01:13.980: &gt;&gt; .<cr><lf>
01:01:13.980: &lt;&lt; 250 Data received OK.<cr><lf>
01:01:17.605: &gt;&gt; QUIT<cr><lf>
01:01:17.605: &lt;&lt; 221 foo.bar Service closing channel.<cr><lf>
01:01:17.605: --- Connection closed normally at 26 Jul 2015, 1:01:17.605. ---
01:01:17.605:</lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I will use a work-around until somebody posts a better solution. A test with the following filtering rule works as expected:</p>
<p>M, "*foobar@foo.bar*", RS, "Mail from foobar@foo.bar - Connection refused"</p>
<p>19:15:31.574: &gt;&gt; EHLO<cr><lf>
19:15:31.621: &lt;&lt; 250-foo.bar Hello ; ESMTPs are:<cr><lf>250-TIME<cr><lf>
19:15:31.636: &lt;&lt; 250-SIZE 123456789<cr><lf>
19:15:31.636: &lt;&lt; 250-STARTTLS<cr><lf>
19:15:31.636: &lt;&lt; 250 HELP<cr><lf>
19:15:31.933: &lt;&lt; MAIL FROM: foobar@foo.bar<cr><lf>
19:15:31.933: &lt;&lt; Mail from foobar@foo.bar - Connection refused<cr><lf>
19:15:32.246: &gt;&gt; RCPT TO: barfoo@bar.foo<cr><lf>
19:15:32.246: &lt;&lt; 554 Shunned connection - only the QUIT command will be accepted.<cr><lf>
19:15:32.543: &gt;&gt;&nbsp;
19:15:32.558: --- Connection closed normally at 25 Jul 2015, 19:15:32.558. ---
19:15:32.558:</lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></lf></cr></p>