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