procmail
[Top] [All Lists]

Re: Trimming the end of a string

2009-11-22 22:10:00
On 22-Nov-2009, at 20:03, Professional Software Engineering wrote:
# 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.
:0E
* ^Sender:[     ]*\/[-A-Z0-9_+]+-owner
* MATCH ?? ^^\/.+-
* MATCH ?? ^^\/([^-]|-[^-])+
{
       LISTNAME=$MATCH
}

Ah yes, that looks familiar. thanks for the prod.

-- 
'That's blasphemy,' said the vampire.
He gasped as Vimes shot him a glance like sunlight. 'That's what people say 
when the voiceless speak.' --Feet of Clay


____________________________________________________________
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>