[maildropl] filtering based on a specific received header [SOLVED]
Brought to you by:
mrsam
From: Pollywog <li...@sh...> - 2005-09-29 17:22:26
|
I was having difficulty getting Maildrop to examine the second "Received:" header, or even ALL the "Received:" headers (that would be fine too) for mail that is sent to me by my secondary MX. I could not find an easy solution to this, one that did not involve invoking an external script of some sort (PERL, PHP, etc) and I later thought I could get around this problem by having Postfix remove the first "Received:" header for mail received from my secondary MX. I am using header_checks in Postfix for this and my maildrop filter looks like this: FILTERS=$HOME/.filters if ( /^Received:.*by.*\.mysecondarymxhost\.example\.com!.*/ && lookup( $MATCH2, "$FILTERS/dat.badrc vd" )) { to "$HOME/Maildir/.Spam/" } (line wrapping has sort of messed that up) and this seems to work. Too bad I could not find a simpler way to do it, but this seems to work. After Postfix removes the first "Received:" header, the second header becomes the topmost header and that is the "Received:" header that is examined by Maildrop. 8) |