From 6e6d72df655343c07b97be38b3876fb10bc2cc03 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Mon, 31 Aug 2009 12:05:51 +0200 Subject: [PATCH] improve fromemail parsing --- procmail/defines | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 -- 2.39.5