procmail
[Top] [All Lists]

Re: Problem with very long OR recipe.

2002-03-15 12:20:13
At 17:59 2002-03-15 +0000, Frank Liney did say:
:0:
  ^Subject:.*HIGH YIELD*|\
  ^Subject:.*Boost your cell phone reception*|\
[snip]

You could break it out into "chunks" of several subject lines, formatted just how you have them, but do one group, then another, etc, as separate recipes. This keeps them all smaller and more manageable. If you're going to manually maintain a lot of subjects, doing this will make it a bit easier to diagnose script problems, as it won't seem to just choke on a huge recipe somewhere.

Slightly more efficient (and compact) would be to use:

* ^Subject:.*(first string|second string|third string|\
        fourth string|fifth string|nauseating string)

Easier to read and modify (AND not subject to the problem you're describing):

* 9876543210^0 ^Subject:first string
* 9876543210^0 ^Subject:second string
* 9876543210^0 ^Subject:third string

(This is "scoring" - see 'man procmailsc' - scoring is also useful for triggering on a "threshold" of junk-like keywords, rather than the exact phrases themselves.) The scoring one will also be a LOT more readable in your verbose log (versus one big honkin' concatenated line which is what you're doing now will log as).

For a touch more optimization, be sure to order the lines so that the most frequently occuring key phrases appear first - that way, when spam if spotted, it'll get ditched with a slight bit less processing. For non-spam messages though, you'll incur the full processing load anyway.

But when I have several entries in the recipe, ie a few hundred subject
lines, it fails. Mail neither goes to the spam mail box, or to my inbox.

What does the VERBOSE log say about it? That's the FIRST thing you should do with a recipe which is acting up (besides running it in a sandbox).

My gut reaction is that you're overflowing LINEBUF. See 'man procmailrc' and search for LINEBUF. Figure with the default at 2048, a hundred lines would be about 20 characters apiece. You could bump linebuf up, but I'd suggest you consider revising the scheme you use for matching, as suggested above.

Can anyone advise what might be the problem, from the list archives I
understand there no limit on the length of a recipe.

But there is a limit on the LINE LENGTH.


This email and any attachments may be confidential and the subject of legal
[snip]

You aught to turn that off when posting to list. Such disclaimers are rather silly when the message itself it posted to a public forum which is archived on many servers worldwide.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

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