Topic: Closed ticket not answered

Hi Zhang,

You closed a Pro thread that was not finished:

https://forum.iredmail.org/topic16990-a … dress.html

You stated:

Add your line ABOVE those 2 lines.
First match wins.

I replied:

But I am confused by the "first match wins" theory. If the problem IP address matched my line (and not the included sendgrid.net one), why didn't Postfix keep processing and then get to my line when it was after the Sendgrid line? So with my line above the Sendgrid line, how would a Sendgrid email be accepted?

Let me try again.

The two (three with the comment) lines in /etc/postfix/helo_access.pcre look like this:

# bypass some HELOs which contains IP address
/^o\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}\.unifiedlayer\.com$/ DUNNO
/^o\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}\.outbound-mail\.sendgrid\.net$/ DUNNO

You replied as above and I moved the "unifiedlayer" line above the "sendgrid" line and it worked as expected. However, if 99 to 99.99999% of emails are not from Sendgrid, then they do not match that line, so then the next line (which *was* the "unifiedlayer" line) should be compared. When the "unifiedlayer" line was the second line, it would have been the "first match". Now with the "sendgrid" line second, I wonder if any emails from Sendgrid will not match and they will be bounced.

Why wasn't the "unifiedlayer" layer line being compared when it was the second line? A link as an answer will be fine.




Re: Closed ticket not answered

About the "first match wins", my original reply is not accurate, i apologize.

Check Postfix official documents here:
http://www.postfix.org/postconf.5.html# … strictions

If one rule matched, AND the action is NOT "DUNNO", then postfix will stop investigating further rules (because it's either rejected or bypassed, relayed, etc which doesn't need further investigation anymore), in this case, it's indeed first match wins (first matched and stopped).

If one rule matched AND action is "DUNNO", postfix will continue investigating further rules until a non-"DUNNO" action returned.


Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee


Re: Closed ticket not answered

OK, thanks. This answer makes more sense. However, it's still not clear to me why my unifiedlayer line was not matched when it was under the sendgrid line.

However, I will try studying the Postfix documentation you linked to to see where things went wrong and run some experiments.