procmail
[Top] [All Lists]

formail can't see $_

2004-06-22 12:47:08
In one, and only one, of my debugging recipes, I get nonsense printed
in the output of formail -A ...  It's near the end of a substantial
recipe file, so possibly something subtle above (like the H flag bug)
is causing the problem.  Naturally it only occurs in my ISP's
environment running procmail v3.22, not at home on procmail 3.15.1.
Here's the problem recipe; the first formail is what fails:

:0
* $!${debug:+!}
{
    :0 fwh
    | formail -A "X-Diagnostic: `basename $_`: before `basename 
${Spamsummaryrc}`; `date`"
    :0 fwh
    | formail -A "X-Diagnostic: `basename $_`: spamscore is: \"$SPAMSCORE\""
}

here's some log output:

------good log output, from a similar recipe earlier in that file:----------
procmail: Match on ""
procmail: Executing "basename,/home/jimo/testing/virusrc"
procmail: Executing "date"
procmail: [746] Tue Jun 22 08:23:08 2004
procmail: Executing "formail,-A,X-Diagnostic: entering virusrc Tue Jun 22 
08:23:08 PDT 2004"
-----------------------------------------------

------bad log output, from recipe above:------------
procmail: Match on ""
procmail: Executing " formail -A "X-Diagnostic: `basename $_`: before `basename 
${Spamsummaryrc}`; `date`""
procmail: [746] Tue Jun 22 08:23:10 2004
procmail: Executing "basename,/home/jimo/testing/spamrc"
procmail: [746] Tue Jun 22 08:23:10 2004
procmail: Executing "formail,-A,X-Diagnostic: spamrc: spamscore is: "NOSUBJECT, 
BCC, MSGID, NOBODY""
------------------------------------------------

The top Executing line is strange, instead of comma-separated components
of the command, we have a space after the initial double quote, and just
a verbatim display of the source text.  There are no Executing lines for the
basename or date components.

All the other Executing "formail...  log lines have the variables
parsed, and I see Executing lines for any `cmd` components.  Even the
second formail in the recipe shown above works correctly. 

Here's what formail adds to the header:

X-Diagnostic: entering virusrc Tue Jun 22 08:23:08 PDT 2004
...
X-Diagnostic: s00: before spamsummaryrc; Tue Jun 22 08:23:10 PDT 2004
X-Diagnostic: spamrc: spamscore is: "NOSUBJECT, BCC, MSGID, NOBODY"
---------------------------------------------------

The "s00" is nonsense, the failed result of the `basename $_` bit,
but the second filename and the `date` are correct, fwiw.

I tried increasing LINEBUF, and adding w flags to prior recipes, all
to no avail.  It's just a debugging recipe, a small failure in a
large sea of otherwise working recipes.  But it is a failure, and I'd
like to know what the problem is and fix it.  Failures can be welcome
gifts when you spot them. 

Does the format of that log output look familiar to anyone?

TIA,

Jim

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>