procmail
[Top] [All Lists]

Re: Misunderstanding $=

2001-08-17 13:38:35
"David W. Tamkin" <dattier(_at_)ripco(_dot_)com> writes:
Philip advised Jim,

| :0
| * 500000^1 > 500000
| {
|    LOG="Huge mail received: $=
| `formail -XFrom`
| "
|    LOGABSTRACT=all
|    :0
|    $TRASH
| }
|
| According to the formula on the procmailsc(5) manpage, the conditon
| * 500000^1 > 500000
| will generate a score equal to the size of the message.

Yes, but won't it be positive for any non-empty message?  If the message is
600 bytes,

w * (M/L)^x = 500000 * (600/500000)^1 = 600 > 0

so it will be logged as huge and filed in $TRASH, won't it?

Whoops!

I knew there was a reason to put the size calculation in a separate recipe:

        :0
        * > 500000
        {
            :0
            * 1^1 > 1
            { }
            LOG="Huge mail received: $=
`formail -XFrom`
"
            ...etc
        }

Or at least a separate condition:

        :0
        * > 500000
        * 1^1 > 1
        {
            LOG="Huge mail received: $=
`formail -XFrom`
"
            ...etc
        }


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