Hi,
I have a problem when using the check_recipient_access parameter to restrict specified recipients on postfix. Mailflow behaves as expected generally, but the issue arises when a specific application sends mails to postfix to both an "allowed recipient" and a "disallowed recipient" in the same SMTP transaction. I can replicate similar behaviour if testing with the MS SmtpDiag Tool or smtpProber as I see a "quit" command , no data and no message sent to either the allowed recipient or the disallowed recipient. I also see similar if using an smtp relay except it reports RSET rather than quit. However, if i repeat the test with sendSMTP, Telnet or socketlabs SMPT Console then the message gets processed correctly, i.e. mail is sent to the allowed user and is not sent to the disallowed user. It would appear to be a client issue, but can not seem to work around it - anyone have any ideas or any postfix config that can be changed?
example output:
"problem" tests:
Connecting to mail server.
Connected.
220 mydomain.local ESMTP Postfix (Ubuntu)
EHLO TESTSERVER
250-mydomain.local
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
RSET
250 2.0.0 Ok
MAIL FROM: <admin@mydomain.com>
250 2.1.0 Ok
RCPT TO: <user@allowedrecipient.com>
250 2.1.5 Ok
RCPT TO: <user@disallowedrecipient.com>
554 5.7.1 <user@disallowedrecipient.com>: Recipient address rejected: Access denied
Error: SMTP protocol error. 554 5.7.1 <user@disallowedrecipient.com>: Recipient address rejected: Access denied.
Failed to send messageForcing disconnection from SMTP server.
QUIT
221 2.0.0 Bye
Disconnected.
Out: 220 mydomain.local ESMTP Postfix (Ubuntu)
In: EHLO TESTSERVER
Out: 250-mydomain.local
Out: 250-PIPELINING
Out: 250-SIZE 10240000
Out: 250-VRFY
Out: 250-ETRN
Out: 250-STARTTLS
Out: 250-ENHANCEDSTATUSCODES
Out: 250-8BITMIME
Out: 250 DSN
In: RSET
Out: 250 2.0.0 Ok
In: MAIL FROM:<admin@mydomain.com>
Out: 250 2.1.0 Ok
In: RCPT TO:<user@allowedrecipient.com>
Out: 250 2.1.5 Ok
In: RCPT TO:<user@disallowedrecipient.com>
Out: 554 5.7.1 <user@disallowedrecipient.com>: Recipient address rejected: Access denied
In: QUIT
Out: 221 2.0.0 Bye
successful test:
Stat Connected.
Recv 04/06/2018 21:48:46: 220 mydomain.local ESMTP Postfix (Ubuntu)<EOL>
Sent 04/06/2018 21:48:46: EHLO SendSMTPv2.19.0.1<EOL>
Recv 04/06/2018 21:48:46: 250-mydomain.local<EOL>250-PIPELINING<EOL>250-SIZE 10240000<EOL>250-VRFY<EOL>250-ETRN<EOL>250-STARTTLS<EOL>250-ENHANCEDSTATUSCODES<EOL>250-8BITMIME<EOL>250 DSN<EOL>
Sent 04/06/2018 21:48:46: STARTTLS<EOL>
Recv 04/06/2018 21:48:46: 220 2.0.0 Ready to start TLS<EOL>
Sent 04/06/2018 21:48:46: EHLO SendSMTPv2.19.0.1<EOL>
Recv 04/06/2018 21:48:46: 250-mydomain.local<EOL>250-PIPELINING<EOL>250-SIZE 10240000<EOL>250-VRFY<EOL>250-ETRN<EOL>250-ENHANCEDSTATUSCODES<EOL>250-8BITMIME<EOL>250 DSN<EOL>
Sent 04/06/2018 21:48:46: MAIL FROM:<admin@mydomain.com><EOL>
Recv 04/06/2018 21:48:46: 250 2.1.0 Ok<EOL>
Sent 04/06/2018 21:48:46: RCPT TO:<user@allowedrecipient.com><EOL>
Recv 04/06/2018 21:48:46: 250 2.1.5 Ok<EOL>
Sent 04/06/2018 21:48:46: RCPT TO:<user@disallowedrecipient.com><EOL>
Recv 04/06/2018 21:48:46: 554 5.7.1 <user@disallowedrecipient.com>: Recipient address rejected: Access denied<EOL>
Sent 04/06/2018 21:48:46: DATA<EOL>
Recv 04/06/2018 21:48:46: 354 End data with <CR><LF>.<CR><LF><EOL>
Sent 04/06/2018 21:48:46: From: "admin@mydomain.local" <admin@mydomain.local><EOL>Subject: this is an smtpsend test<EOL>To: user@allowedrecipient.com, user@disallowedrecipient.com<EOL>Content-Type: multipart/mixed; charset=utf-8<EOL>MIME-Version: 1.0<EOL>Content-Transfer-Encoding: 8bit<EOL>Date: Mon, 4 Jun 2018 21:48:46 +0100<EOL>X-Mailer: SendSMTP Version 2.19 Release 0 Build 1<EOL>
Sent 04/06/2018 21:48:46: <EOL>
Sent 04/06/2018 21:48:46: <EOL>
Sent 04/06/2018 21:48:46: .<EOL>
Recv 04/06/2018 21:48:46: 250 2.0.0 Ok: queued as 69365E144D<EOL>
Sent 04/06/2018 21:48:46: QUIT<EOL>
Recv 04/06/2018 21:48:46: 221 2.0.0 Bye<EOL>
Stat Disconnected.
I have a problem when using the check_recipient_access parameter to restrict specified recipients on postfix. Mailflow behaves as expected generally, but the issue arises when a specific application sends mails to postfix to both an "allowed recipient" and a "disallowed recipient" in the same SMTP transaction. I can replicate similar behaviour if testing with the MS SmtpDiag Tool or smtpProber as I see a "quit" command , no data and no message sent to either the allowed recipient or the disallowed recipient. I also see similar if using an smtp relay except it reports RSET rather than quit. However, if i repeat the test with sendSMTP, Telnet or socketlabs SMPT Console then the message gets processed correctly, i.e. mail is sent to the allowed user and is not sent to the disallowed user. It would appear to be a client issue, but can not seem to work around it - anyone have any ideas or any postfix config that can be changed?
example output:
"problem" tests:
Connecting to mail server.
Connected.
220 mydomain.local ESMTP Postfix (Ubuntu)
EHLO TESTSERVER
250-mydomain.local
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
RSET
250 2.0.0 Ok
MAIL FROM: <admin@mydomain.com>
250 2.1.0 Ok
RCPT TO: <user@allowedrecipient.com>
250 2.1.5 Ok
RCPT TO: <user@disallowedrecipient.com>
554 5.7.1 <user@disallowedrecipient.com>: Recipient address rejected: Access denied
Error: SMTP protocol error. 554 5.7.1 <user@disallowedrecipient.com>: Recipient address rejected: Access denied.
Failed to send messageForcing disconnection from SMTP server.
QUIT
221 2.0.0 Bye
Disconnected.
Out: 220 mydomain.local ESMTP Postfix (Ubuntu)
In: EHLO TESTSERVER
Out: 250-mydomain.local
Out: 250-PIPELINING
Out: 250-SIZE 10240000
Out: 250-VRFY
Out: 250-ETRN
Out: 250-STARTTLS
Out: 250-ENHANCEDSTATUSCODES
Out: 250-8BITMIME
Out: 250 DSN
In: RSET
Out: 250 2.0.0 Ok
In: MAIL FROM:<admin@mydomain.com>
Out: 250 2.1.0 Ok
In: RCPT TO:<user@allowedrecipient.com>
Out: 250 2.1.5 Ok
In: RCPT TO:<user@disallowedrecipient.com>
Out: 554 5.7.1 <user@disallowedrecipient.com>: Recipient address rejected: Access denied
In: QUIT
Out: 221 2.0.0 Bye
successful test:
Stat Connected.
Recv 04/06/2018 21:48:46: 220 mydomain.local ESMTP Postfix (Ubuntu)<EOL>
Sent 04/06/2018 21:48:46: EHLO SendSMTPv2.19.0.1<EOL>
Recv 04/06/2018 21:48:46: 250-mydomain.local<EOL>250-PIPELINING<EOL>250-SIZE 10240000<EOL>250-VRFY<EOL>250-ETRN<EOL>250-STARTTLS<EOL>250-ENHANCEDSTATUSCODES<EOL>250-8BITMIME<EOL>250 DSN<EOL>
Sent 04/06/2018 21:48:46: STARTTLS<EOL>
Recv 04/06/2018 21:48:46: 220 2.0.0 Ready to start TLS<EOL>
Sent 04/06/2018 21:48:46: EHLO SendSMTPv2.19.0.1<EOL>
Recv 04/06/2018 21:48:46: 250-mydomain.local<EOL>250-PIPELINING<EOL>250-SIZE 10240000<EOL>250-VRFY<EOL>250-ETRN<EOL>250-ENHANCEDSTATUSCODES<EOL>250-8BITMIME<EOL>250 DSN<EOL>
Sent 04/06/2018 21:48:46: MAIL FROM:<admin@mydomain.com><EOL>
Recv 04/06/2018 21:48:46: 250 2.1.0 Ok<EOL>
Sent 04/06/2018 21:48:46: RCPT TO:<user@allowedrecipient.com><EOL>
Recv 04/06/2018 21:48:46: 250 2.1.5 Ok<EOL>
Sent 04/06/2018 21:48:46: RCPT TO:<user@disallowedrecipient.com><EOL>
Recv 04/06/2018 21:48:46: 554 5.7.1 <user@disallowedrecipient.com>: Recipient address rejected: Access denied<EOL>
Sent 04/06/2018 21:48:46: DATA<EOL>
Recv 04/06/2018 21:48:46: 354 End data with <CR><LF>.<CR><LF><EOL>
Sent 04/06/2018 21:48:46: From: "admin@mydomain.local" <admin@mydomain.local><EOL>Subject: this is an smtpsend test<EOL>To: user@allowedrecipient.com, user@disallowedrecipient.com<EOL>Content-Type: multipart/mixed; charset=utf-8<EOL>MIME-Version: 1.0<EOL>Content-Transfer-Encoding: 8bit<EOL>Date: Mon, 4 Jun 2018 21:48:46 +0100<EOL>X-Mailer: SendSMTP Version 2.19 Release 0 Build 1<EOL>
Sent 04/06/2018 21:48:46: <EOL>
Sent 04/06/2018 21:48:46: <EOL>
Sent 04/06/2018 21:48:46: .<EOL>
Recv 04/06/2018 21:48:46: 250 2.0.0 Ok: queued as 69365E144D<EOL>
Sent 04/06/2018 21:48:46: QUIT<EOL>
Recv 04/06/2018 21:48:46: 221 2.0.0 Bye<EOL>
Stat Disconnected.