From: martin f. krafft Date: Mon, 31 Aug 2009 10:05:51 +0000 (+0200) Subject: improve fromemail parsing X-Git-Url: https://git.madduck.net/etc/mailfilter.git/commitdiff_plain/6e6d72df655343c07b97be38b3876fb10bc2cc03?ds=sidebyside improve fromemail parsing --- diff --git a/procmail/defines b/procmail/defines index 218ba89..569a7df 100644 --- a/procmail/defines +++ b/procmail/defines @@ -72,6 +72,7 @@ RE_SPACE_NEWLINE="(^|$RE_SPACE)" RE_FIRSTNAME="martin($RE_SPACE_NEWLINE+f(\.?|elix))?" RE_LASTNAME="kraff?t" RE_EXTRACT_HEADER_VALUE="$RE_SPACE*\/$RE_NOT_SPACE.*" +RE_EMAILADDRESS="${RE_NOT_SPACE}+@${RE_NOT_SPACE}+\.[^ >]+" DEJAVU_HEADER=X-Deja-Vu @@ -122,15 +123,20 @@ INCLUDERC=$PMDIR/get-msgid { FROM="$MATCH" } :0 -*$ FROM ?? ^\/${RE_NOT_SPACE}+@${RE_NOT_SPACE}+ +* FROM ?? ^.+ <\/.+@[^>]+ { FROMEMAIL="$MATCH" } :0 E -* FROM ?? ^.+ <\/[^>]+ +* FROM ?? ^.+ \(\/.+@[^\)]+ { FROMEMAIL="$MATCH" } :0 E -* FROM ?? ^.+ \(\/[^\)]+ +*$ FROM ?? ^\/$RE_EMAILADDRESS +{ FROMEMAIL="$MATCH" } + +:0 +* FROMEMAIL ?? ^".+"$ +* FROMEMAIL ?? ^"\/[^"]+ { FROMEMAIL="$MATCH" } # if $SENDER is undefined or not an email address, get it from the message