4 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] Escape function not w...
FromSent OnAttachments
cour...@arantius.comFeb 24, 2005 6:18 pm 
Doc WalkerFeb 24, 2005 8:56 pm 
Doc WalkerFeb 25, 2005 6:48 pm 
cour...@arantius.comFeb 27, 2005 3:51 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] Escape function not working?Actions...
From:Doc Walker (rx-m@wvfans.net)
Date:Feb 25, 2005 6:48:18 pm
List:net.sourceforge.lists.courier-maildrop

Anthony Lieuallen wrote:

Doc Walker wrote:

cour@arantius.com wrote:

The following in my filter: /Subject: *!.*/ s=escape($MATCH2) log "Escaped (?) subject: " $s Logs, i.e.: Escaped (?) subject: Comment Added: On-board Sound doesn't work

Try this: I append the following header to my maildrop'd messages as a troubleshooting tool: # File Maildrop mailing list messages: if (/^List-ID:.*courier-maildrop/) { xfilter '$REFORMAIL -A "X-Maildrop-Mailfilter: 0x0301"' xfilter '$REFORMAIL -A "X-Maildrop-Match: $MATCH"' to "$DEFAULT/.Maildrop.Inbox" }

Read the recent archives where we discussed this very same issue of passing single quotes properly; Sam V explained how the argument gets passed to the shell correctly via the way I've quoted my $MATCH statement to xfilter above. Before that, I would get a maildrop error every time my $MATCH contained a single quote. Essentially, you do not need to use the ESCAPE() function for your purpose.

Thank you but yes, I do, because the subject could contain a double quote as easily as it could contain a single quote. I need to escape it, and I tried to use the escape function. But it didn't work.

You do not need to use the ESCAPE() function to do what you are asking for (I had the same misconception from reading the man pages); the full explanation from Sam is in the archives. He describes exactly how the environment variables are passed to the shell. It does not matter whether you have unbalanced quotes (single or double). Try it and you will find that it works. The command is as follows:

log $MATCH

I was able to log subject lines containing unbalanced quotes just fine with the above statement in my .mailfilter.

Rx