Discussion:
smtpd_command_filter regex help
(too old to reply)
Michael Nguyen
2016-04-15 08:04:09 UTC
Permalink
So, I'm having an issue with "Bad Sender Address Syntax" errors. The errors are from a variety of formatted email address including some strange ones like <***@domain.com/wordpress>. At first, I would shrug my shoulders to them but my customers started whining and they sort of had a good point. You see, all of the emails in question have already been processed by their mail provider and their mail host accepted these emails. The emails were only getting rejected when they got pulled into our system so it became an issue of "Why can't you handle these emails if I've already received them?"

Anyway, I looked at the old threads regarding this and I wanted to run this by you guys before trying it. Basically, I want to accept any "MAIL FROM" envelope address. The mail servers in question don't send bounces and are pure mail stores for our users so it actually doesn't matter if the envelope address is valid or not as it's never used. Would the below be correct?

/etc/postfix/main.cf:
smtpd_command_filter = pcre:/etc/postfix/sender_filter

/etc/postfix/sender_filter:

/^(MAIL\s+FROM:\s.*)/ OK

What do you guys think?


Michael
d***@gmail.com
2016-04-15 19:46:52 UTC
Permalink
Post by Michael Nguyen
Anyway, I looked at the old threads regarding this and I wanted to run this by you guys before trying it. Basically, I want to accept any "MAIL FROM" envelope address. The mail servers in question don't send bounces and are pure mail stores for our users so it actually doesn't matter if the envelope address is valid or not as it's never used. Would the below be correct?
smtpd_command_filter = pcre:/etc/postfix/sender_filter
/^(MAIL\s+FROM:\s.*)/ OK
What do you guys think?
Michael
Hi

What kind of smtp server accepts adresses like this one ?

It may be allowed in the headers but not in the smtp dialog (rfc821 and 822).

Regards

Victor
Michael Nguyen
2016-04-15 20:56:54 UTC
Permalink
Post by d***@gmail.com
Post by Michael Nguyen
Anyway, I looked at the old threads regarding this and I wanted to run this by you guys before trying it. Basically, I want to accept any "MAIL FROM" envelope address. The mail servers in question don't send bounces and are pure mail stores for our users so it actually doesn't matter if the envelope address is valid or not as it's never used. Would the below be correct?
smtpd_command_filter = pcre:/etc/postfix/sender_filter
/^(MAIL\s+FROM:\s.*)/ OK
What do you guys think?
Michael
Hi
What kind of smtp server accepts adresses like this one ?
It may be allowed in the headers but not in the smtp dialog (rfc821 and 822).
Regards
Victor
I have no idea what SMTP software they use. All I know is that these users are somehow getting these emails delivered to their mailboxes somehow. Since we post-process mail for these users and I wanted to come up with a way to where we'd stop rejecting/discarding any emails that we process for them. At first I would blame their MTA but in the end, I do see their point as a customer -- if they got the email already, who am I to reject it afterwards.

Would that regex work? Is "OK" the proper response on the right hand side?


Michael

Loading...