Gestudio Cloud
Gestudio Cloud

Reputation: 290

POSTFIX header checks with TO and FROM conditions

I would like to add a new action in the headers check file of my postfix server with 2 conditions: FROM and TO at the same time.

I already have a few lines checking the FROM or the SUBJECT like this:

/^FROM:.*[email protected]/ REDIRECT [email protected]

This rule works fine, but redirects all mail from [email protected] to the [email protected]

The thing is that I need the redirect only if the TO was a given mailbox, not all.

THANKS!!!!

Upvotes: 0

Views: 3599

Answers (1)

Ralf Hildebrandt
Ralf Hildebrandt

Reputation: 541

Sorry, but that's not possible.

Each message header or message body line is compared against a list  of
patterns.   When a match is found the corresponding action is executed,
and the matching process is repeated for the  next  message  header  or
message body line.

Meaning, you can check the To: header and you can check the From: headerm but not at the same time.

Upvotes: 1

Related Questions