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
Which is a problem, becuase I want to pass the contents of the subject
in single quotes to a shell script. But the single quote IN the subject
of course breaks it. I thought that's what escape was for?
Try this:
log 'Subject: $MATCH2'
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.
HTH.
Rx