Score:0

Warning Message after Postmap Header_Checks with Postfix

us flag

I'm using postfix-pcre on my Ubuntu Server. If I test my header_checks configuration with the following command

postmap -q 'To: "Markus Schlei" <[email protected]>' regexp:/etc/postfix/header_checks

I get the following warning message:

postmap: warning: regexp map /etc/postfix/header_checks, line 36: Invalid preceding regular expression.

Also it's not reject my test. On Line 36 I got this code:

/^To:.*\@(?!(gmail\.com)).*/ REJECT Test-Nr-1

I want to reject all messages which not match with gmail.com

Edit 1: I found out that, if I remove the "(?!(..)" the warning message gone away, but it do the inverse what I want.

anx avatar
fr flag
anx
Be careful about enforcing policy in anything but a rfc5322-aware parser: Address headers can contain group names and comments. What you are matching here is not just not necessarily where the message is delivered (envelope != headers), but also possibly not part of what would be displayed in a typical mail client.
Score:0
in flag

You should know that there is POSIX regular expression and PCRE regular expression.

You are using a negative lookahead (?!) with a regexp table. This type of regular expression is only supported by PCRE regex tables.

To find out what types of lookup tables your Postfix system supports use the "postconf -m" command.

If pcre is listed then just switch to pcre tables instead of regexp tables. If not, you have to install postfix-pcre.

cn flag
Yes, using `pcre:` instead of `regexp:` should work just fine.
us flag
PCRE is listed. I'm stuck in my head about how to switch from regexp table to pcre. I was thinking every time already use a pcre table. On my main.cf file I put this param: `header_checks = pcre:/etc/postfix/header_checks`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.