5 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] Req for help adding h...
FromSent OnAttachments
Doc WalkerFeb 7, 2005 7:56 pm 
denis moellerFeb 8, 2005 12:28 am 
Sam VarshavchikFeb 8, 2005 4:19 am 
Doc WalkerFeb 9, 2005 10:52 am 
Sam VarshavchikFeb 9, 2005 4:07 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] Req for help adding header with $MATCH pattern containing single quoteActions...
From:Sam Varshavchik (mrs@courier-mta.com)
Date:Feb 9, 2005 4:07:25 pm
List:net.sourceforge.lists.courier-maildrop

Doc Walker writes:

Sam Varshavchik said:

Try this:

Get rid of escape(). Change the command to:

xfilter '$REFORMAIL -A "X-WVFans-Match: $MATCH"'

All maildrop variables are exported in the environment. The above string gets evaluated by maildrop as:

No variable substitution occurs inside apostrophes. The above string is passed verbatim to the shell, to execute.

All maildrop variables are now in the environment, and the shell will perform variable expansion.

Many thanks Sam. This works perfectly.

Two questions related to this:

- What is the appropriate use of the escape() command?

An example is given in the maildropfilter man page. If you want to search for something that's already in the variable, you need to escape the special characters used by regular expressions.

- How would I go about getting the full multi-line $MATCH header to be added to my maildrop'd email. The first line of the $MATCH result gets added to my header fine.

You probably need to write something tricky using the foreach statement.