9 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] fetchmail + maildrop = ?
FromSent OnAttachments
Eric d'AlibutJun 6, 2007 12:41 pm 
Jeronimo ZuccoJun 6, 2007 12:45 pm 
Eric d'AlibutJun 6, 2007 12:55 pm 
Matthias AndreeJun 7, 2007 9:04 am 
Eric d'AlibutJun 7, 2007 11:19 am 
Sam VarshavchikJun 7, 2007 3:25 pm 
Eric d'AlibutJun 7, 2007 10:33 pm 
Sam VarshavchikJun 8, 2007 4:02 am 
Eric d'AlibutJun 8, 2007 10:19 am 
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] fetchmail + maildrop = ?Actions...
From:Sam Varshavchik (mrs@courier-mta.com)
Date:Jun 8, 2007 4:02:39 am
List:net.sourceforge.lists.courier-maildrop

Eric d'Alibut writes:

On 6/7/07, Sam Varshavchik <mrs@courier-mta.com> wrote:

Eric d'Alibut writes:

if (/^Delivered-To:.*zoidberg/) if (/^Subject:\s(.*)/) xfilter "reformail -I'Subject: Z "$MATCH1"'"

Take out a piece of paper, and pencil, and figure out what happens to that xfilter statement when someone sends you a message with the following header:

Subject: How I blew my last $20 at Johnny's pub

You get:

xfilter "reformail -I'Subject: Z How I blew my last $20 at Johnny's pub '"

which must totally confuse xfilter.

Not xfilter, but the shell, which parses a syntax error.

This works, I think:

xfilter 'reformail -I "Subject: Z $MATCH1"'

Is there a 'best practice' approach to quoting vars in such a situation?

That's the best practice: understand how quoting and shell expansion works. Recognize that all variables get exported into the shell's environment, and let the shell do environment substitution.