procmail
[Top] [All Lists]

Re: Proper comment usage

2002-12-08 22:47:36
On Sun, 8 Dec 2002, David W. Tamkin wrote:

Justin asked,

| Howdy all.  Quick question for you.  Can I use a # comment within a
| multi-line command?  exp (note, the sed line will proably wrap):
|
|         :0f
|         # Run it through spamassassin -d to remove the X-Spam* headers
|         | $SA -d | \
|           # Munge the userid(_at_)*(_dot_)sktc(_dot_)net
|           $SED -e
"s/\<[-+_a-zA-Z0-9]*(_at_)[-_a-zA-Z0-9\(_dot_)]*sktc\(_dot_)net/MUNGED(_at_)sktc(_dot_)net/gi"
 \
|                # Remove the subject line ***SPAM*** string
|                -e "s/\*\*\*SPAM\*\*\* *//gi" | \
|           # Remove the ReSent, X-Envelope-To, and X-Scanned-By headers
|           $FORMAIL -I ReSent \
|                    -I X-Envelope-To: \
|                    -I X-Scanned-By:

You can't get a backslash continuation to jump over a comment line, sorry.

Comments are allowed between recipes or assignments, to the right of action
lines, to the right of flag lines, and to the right of exitcode-test condition
lines.  In newer versions of procmail, whole-line comments are also allowed
between the flag line and the first condition, between conditions, and between
the last condition and the action.  But if you're breaking up a condition or
an action into screen lines with backslash continuations, you can't make them
jump over comments.

That's what I was starting to think after I noticed the errors.  I
probably should have noticed that before.

That's why "# Run it through ..." isn't causing a problem, but "# Munge ..."
is and the two "# Remove ..." lines would if procmail got that far.  I
recommend that you put the three interrupting comments before the action
starts, immediately below the first comment, or put them above the flag line
altogether.

I've made the changes and the errors have gone away.  My recipe still
doesn't work but at least I'm not getting errors. Ha! :-)

Thanks for the help
Justin


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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