Re: recepient's email address truncated
"@lbutlr" <[email protected]> Mon, 14 Mar 2016 10:32:24 -0600
| Newsgroups | gmane.mail.procmail |
|---|---|
| Message-ID | <[email protected]> |
> On Mar 11, 2016, at 8:25 AM, Zhiliang Hu <[email protected]> wrote: > > I use a procmail recipe like the following for a number of small lists: This is what I use that covers every mailing list I have: [ ] is <tab><space> LISTNAME :0 * 9876543210^0 ^(List-Post:[ ]*(<mailto:)?|List-Owner:[ ]*(<mailto:)?owner-)\/[-A-Z0-9_+]+ * 9876543210^0 ^(List-Id:.*<|X-Mailing-List:[ ]*)\/[-A-z0-9_+]+ * 9876543210^0 ^(Sender:[ ]*owner-|X-BeenThere:[ ]*|Delivered-To:[ ]*mailing list )\/[-A-Za-z0-9_+]+ * 9876543210^0 ^Sender:.* List"? <(mailto:)?\/[-A-Z0-9_+]+ { LISTNAME=$MATCH } # OK, that didn't work, let's try List-Subscribe :0E * ^List-(un)?Subscribe:.*<mailto:\/[-A-Z0-9_+]+-(digest|on|(un)?subscribe)@ * MATCH ?? ^^\/.+- * MATCH ?? ^^\/.+[^-] { LISTNAME = $MATCH } # The second and third conditions were found in posts from Bart Schaefer # dated 2002-07-18 - these optimize this fallback recipe so that it # doesn't require the use of a shell, pipe, and sed to eliminate the -owner # suffix. # first, get the owner address (if the sender follows that syntax) # Grab everything up through the last hyphen # Grab everything except that last hyphen # This is optimized to be one recipe, since MATCH will assume the set value # after each condition line, and if the FIRST condition matches, the two that # follow it definatley should. :0 * LISTNAME ?? ()\/[-A-Z0-9_+]+-(users|user) * MATCH ?? ^^\/.+- * MATCH ?? ^^\/([^-]|-[^-])+ { LISTNAME=$MATCH } LOG=$LISTNAME$NL # Process some lists specially (change reply-to mostly) INCLUDERC=$HOME/.list_local # Don’t sort mail to list tagged “NO” :0 * LISTNAME ?? NO { SWITCHRC } # Deliver mail to custom mailbox :0 * ! LISTNAME ?? ^^^^ .$LISTNAME/ Sean wrote nearly all of that, except for any parts that are wrong. I did those. :) -- "Rosa sat, so Martin could walk. Martin walked, so Obama could run. Obama ran, so our children can fly." (paraphrased from NPR) ____________________________________________________________ procmail mailing list Procmail homepage: http://www.procmail.org/ [email protected] http://mailman.rwth-aachen.de/mailman/listinfo/procmail