Wednesday, May 21, 2014

Analyse header and create email forwarding

For redirect emails before sending or receiving you can search the header of a file for keywords and create a rule for it.
The keywords can be a part of the email adress.
With this solution you can intercept emails or create a vacation representation.

I add the following line to main.cf:
header_checks = regexp:/etc/postfix/header_checks

At the file header_checks are the keywords and the forward/redirect destinations stored.
/^(To|From|Cc|Reply-To):.*DASISTDASSUCHWORT*/ REDIRECT andre@nitschke-marl.de
 
This line search for the key "DASISTDASSUCHWORT" and if it is found the mail is redirected to the email andre@nitschke-marl.de

No comments:

Post a Comment