procmail
[Top] [All Lists]

Re: Problem filtering spamassasin tagged mail :(

2003-01-07 03:18:13
From: LuKreme <kremels(_at_)kreme(_dot_)com>

* ^X-Spam-Status:[      ]*Yes

No need to check for space/tab on a known header you control.  Do you 
say:

* X-loop: myloopcheck(_at_)mydomain(_dot_)net

or

* X-loop:[    ]myloopcheck(_at_)mydomain(_dot_)net


The *second*, of course!  I know you meant that as a rhetorical
question and meant to deride him who would do the second.  But
I find the position of yours tenuous.  You do *not* control
the header once you send it back into "space," which is exactly
what happens with X-Loop: headers.  Who knows what sorts of
SMTP/spam filter/server machines your mail will wend through
before coming back to you in your upstream, which is when you
will want to identify your own X-Loop.  Those other machines
are not only *not* in your control, but if they run (at least
many versions of -- all I've seen!) SpamAssassin, then your
header's whitespace has, indeed, just been changed.  Try it!
SA is known to corrupt header whitespace.  I have tested and
confirmed its action myself to solve "weird" procmail behavior
for other users at my main shell provider.  Had those other users
not made blind assumptions about spaces, the issue would never
have come up.

Actually, I wouldn't assume *any* space.  Moreover, I would quote
the dots.  Here is my actual X-Loop: tester:

 :0  # 021129 () stop mail loops
  *    !  TEST ?? ^^(y|on)
  * $    ^X-Loop:(.*\<)?${domKEY}bot$
  {
      logtext = X-Loop!
      LOG = "$doubleAngle_L $logtext $doubleAngle_R"

      :0:
       X-Loop
  }



Note: no assumptions about space.  If there were a dot, I'd
quote it.  I do check the end of the line, though, which you
didn't do in your quick sample.

I think if you assume the spaces will stay the same, you will
step on your own foot sooner or later.  The *code* in your
rc-file is where you really do have the control, however.
I suggest: don't make assumptions where they are likely to
bite.  (but don't hard-code the obvious, such as paths that
match how procmail is compiled.)

Finally, if you were going to put spaces in according to your
second example, you should at least put an asterisk or plus-
sign after the close-bracket:

        ^X-Loop:[       ]*yourLoopString


Later on, when your rc-file is in a mature state and 
50K or so in size, and a few months have gone by, are you
going to want to try to remember in your head alone just
what you coded in that was assumption, versus what is
cleanly and clearly logical?  Best to do it cleanly and
clearly the first time.  There are learned reasons why programmers
have all the conventions they do to deal with like situations
and cases . . .

</rant over>

-- 
dman


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