procmail
[Top] [All Lists]

Re: Proper comment usage

2002-12-08 13:25:49
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 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.


_______________________________________________
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>