I am using postfix on a Debian server, primarily to send outgoing email for websites and notifications, and have run into an issue where outgoing email to a certain mailing list provider is rejected but email to "normal" individual email addresses goes through just fine.
I've been informed this is due to an empty MAIL FROM, since that typically indicates a bounce or a spammer, which mailing lists don't accept. However, this isn't a bounce - it's the initial outgoing message. However, it does seem if I debug the SMTP session, MAIL FROM is empty:
May 14 12:41:49 mail postfix/smtp[13274]: > REDACTED[REDACTED]:25: MAIL FROM:<>
May 14 12:41:49 mail postfix/smtp[13274]: smtp_stream_setup: maxtime=300 enable_deadline=0
May 14 12:41:49 mail postfix/smtp[13274]: < REDACTED[REDACTED]:25: 250 2.0.0 OK
May 14 12:41:49 mail postfix/smtp[13274]: > REDACTED[REDACTED]:25: RCPT TO:<[email protected]>
May 14 12:41:49 mail postfix/smtp[13274]: smtp_stream_setup: maxtime=300 enable_deadline=0
May 14 12:41:49 mail postfix/smtp[13274]: < REDACTED[REDACTED]:25: 500 Bad bounce
The mail itself is queued locally on the same sever using the mail
function in PHP. It contains both From
and Sender
headers.
I don't know why postfix isn't sending a MAIL FROM, but I suspect it could be due to this other reason:
almost all bounce messages use this as well as certain other circumstances, to indicate they do not wish to receive a bounce message in the event of a delivery error
https://lists.debian.org/debian-isp/2004/01/msg00259.html
However, in this case, indicating that it doesn't want a bounce is breaking outgoing email to certain destinations that require a non-empty MAIL FROM.
How can I force it to send a MAIL FROM, such as from a specific address if necessary?