I configured postfix to relay mail to Amazon SAS, following their integration guide, and sending email works without problems.
However, I recently wrote a PHP application using the framework that created the wrong email message.
SES rejects the email with "Transaction Error 554: Expected MIME Type Received =", which is acceptable.
However, my local postfix server then tries to send a sender non-delivery notification with the address from = <>, which gets to the relay address.
SES rejects the message "501 Invalid MAIL FROM address (in response to the MAIL FROM command)), and the postfix removes the failure message from the queue.
The question is, what is an easier way to ensure that I get the original 554 error message sent to me? I donβt see a way for the SES relay to accept empty fields, so I believe that the solution will be to configure the postfix to deliver the bounce message directly to me.
Note. I use the term "mail bounce", possibly incorrectly. The letter may have been rejected, but I am not sure of the correct nomenclature of this scenario. The key point is that the message is not received by the SES relay, so it did not actually go out of the door, so to speak.
Jun 12 03:11:21 myserver postfix / smtp [6353]: 411BA21795: to = < valid@validdomain.com >, relay = email-smtp.us-east-1.amazonaws.com [54.243.192.132]: 25, delay = 0.29, delays = 0.05 / 0.02 / 0.15 / 0.07, dsn = 5.0.0, status = bounced (host email-smtp.us-east-1.amazonaws.com [54.243 .192.132] said: 554 Transaction failed: Expected MIME type, got = (in reply to end of DATA command))
Jun 12 03:11:21 myserver postfix / cleanup [6351]: 93F202179B: message-id =
Jun 12 03:11:21 myserver postfix / qmgr [895]: 93F202179B: from = <>, size = 4673, nrcpt = 1 (queue active)
Jun 12 03:11:21 myserver postfix / bounce [6354]: 411BA21795: sender non-delivery notification: 93F202179B
Jun 12 03:11:21 myserver postfix / qmgr [895]: 411BA21795: removed
Jun 12 03:11:21 myserver postfix / smtp [6353]: 93F202179B: to = < valid@validdomain.com >, relay = email-smtp.us-east-1.amazona ws.com [23.21.161.144]: 25 , delay = 0.17, delays = 0.01 / 0 / 0.15 / 0, dsn = 5.0.0, status = bounced (host email-smtp.us-east-1.amazonaws.com [23. 21.161.144] said: 501 Invalid MAIL FROM address provided (in reply to MAIL FROM command))
Jun 12 03:11:21 myserver postfix / qmgr [895]: 93F202179B: removed