procmail
[Top] [All Lists]

Re: recepient's email address truncated

2016-03-14 11:36:09

On Mar 11, 2016, at 8:25 AM, Zhiliang Hu <hu(_at_)animalgenome(_dot_)org> 
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/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>