procmail
[Top] [All Lists]

Re: Problems with space

2005-11-24 07:08:38
Frank wrote:

Real code:

#############################
LOGFILE=/var/adm/procmail.log
SPACE=" "
VSSS=3000
NL="
"


  LOGFILE = '/var/adm/procmail.log'
  SPACE   = ' '
  VSSS    = '3000'
  NL      = '
'


###  Spam
:0 BE

Why the E-flag?


* < $VSSS

Should be:

  *$ < $VSSS


* -1^0
* 1^0 .*\/trigger1

  * 1^0 ()\/trigger1

* 1^0 .*\/trigger2
* 1^0 .*\/trigger3
* 1^0 .*\/trigger4
* 1^0 .*\/ trigger5
*$ 1^0 .*\/${SPACE}trigger6
{
  LOG="Match = Porno ${MATCH}${NL}"
    :0
    /var/spool/mail/spam
}
#################################


'trigger5' is considered, 'trigger6' is not.

Unless there's something obviously wrong with the above, I'll do
verbose logging later on.

There are a few things wrong, others are awkward. Replace each '.*\/' by
'()\/'.

Make 'trigger6' equal to 'trigger5'.

Each of the regex-conditions wades through the whole maybe 3 KB body,
but you only need 2 matches, so that could be done more efficiently. You
might replace each ' 1^0' by ' 1073741824^0' (that is half the maximum,
plus 0.5).

If the same pattern may be counted twice, you could use ' 1^1', or this:

  TEST = '(trigger1|trigger2|trigger3|trigger4| trigger5)'
  :0
  *$ B < $VSSS
  *$ B ?? $TEST.*\/$TEST
  { LOG...
    :0
    !spam
  }

Alternative:

  HALFMAX = '1073741824'

  ###  Spam
  :0 B
  *$ < $VSSS
  *$  $HALFMAX ^ 0 ()\/trigger1
  *$  $HALFMAX ^ 0 ()\/trigger2
  *$  $HALFMAX ^ 0 ()\/trigger3
  *$  $HALFMAX ^ 0 ()\/trigger4
  *$  $HALFMAX ^ 0 ()\/${SPACE}trigger5
  *$ -$HALFMAX ^ 0
  {
    LOG="Match = Porno ${MATCH}${NL}"
      :0
      /var/spool/mail/spam
  }


Please post to the procmail-list, with the latest code, and (a URL of)
the verbose log.
Best use Sean's sandbox approach for testing.

-- 
Grtz, Ruud


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