ttroxell ([info]ttroxell) wrote,

Or-ing procmail rules

Is there no better way to OR procmail rules than these horrid kludges?

For now I'm going with the DeMorgan Rule method, because it's more efficient and to the point that the alternative kludges. I still feel a little dirty writing things this:
      :0
      * ! condition1
      * ! condition2
      { }             # official procmail no-op. MUST LEAVE SPACE
      :0 E
      action_on_condition1_or_condition2    
It would be nice to have a recipe flag that means "OR the conditions below"

  • Post a new comment

    Error

    Your IP address will be recorded 

  • 16 comments

[info]skx

January 30 2007, 23:13:30 UTC 5 years ago

I have to admit thats what I use too, and it still irks me.

[info]dossy

January 31 2007, 03:55:05 UTC 5 years ago

Exactly what are you doing where "* condition1|condition2" won't work?

[info]xtat

February 1 2007, 01:28:48 UTC 5 years ago

I have a recipe where I want it delivered if a program returns true, OR if a regex matches, which is not possible using that syntax.

Even if it were, I'd still be annoyed that I can't just specify an "or" flag-- it just seems more intuitive to me.

[info]dossy

February 1 2007, 12:03:20 UTC 5 years ago

As is often said: you have the source, go make it so. :-)

Add an "o" flag that makes all conditions listed OR'ed rather than AND'ed.

Heck, if this is such a problem, *I'll* implement it and post the patch. I've obviously never needed this--or cared enough--but if you're telling me other people do, maybe I'll make time to do it.

If I needed to do an OR, I'd likely do it like this:

ACTION=whatever

:0 c
* condition1
$ACTION

:0 E
* condition2
$ACTION


It's readable to me, and doesn't violate DRY, IMHO.

[info]kelseykoxil

July 17 2008, 00:58:54 UTC 3 years ago

Doesn't this violate the DRY principle. Why is the src directory not included and what is with the trailing .

[info]anitastraley

October 9 2008, 16:10:46 UTC 3 years ago

- Grayhawk The concept of "if you know it's coming, stay dry" doesn't really work, though. Marijuana has a half-life in the body of two weeks.

[info]missymoxel

July 16 2008, 03:07:18 UTC 3 years ago

# LOG = "Score for condition xxxx was: [david] If you want to save the score of a recipe even if it is zero or negative, :0 condition-related flags * conditions { } # official procmail no-op SCORE = $= :0A action-related flags action_if_positive If other recipes that clobber the references for the A flag intervene, this will work: :0 condition-related flags * conditions { } # official procmail no-op SCORE = $=.

[info]jmtd

January 31 2007, 13:37:12 UTC 5 years ago

You should feel dirty writing procmail at all :)

[info]xtat

February 1 2007, 01:32:16 UTC 5 years ago

hah, yeh good point :)

[info]mackvaught

October 9 2008, 15:13:42 UTC 3 years ago

20 Order of the procmail recipes When you start writing a lot of procmail recipes, you soon find out that it matters a great deal in which order your put your recipes.

Anonymous

May 21 2007, 15:48:15 UTC 5 years ago

Hi!

pta.zwit.org gives users access to some of the best games and reviews online. No need to waste your time looking for your arcade fix. pta.zwit.org is the hub of online gaming. Flash, Java and Shockwave powered high-quality games, 24 hours a day, 7 days a week!
If you're not sure, you can choose trial!!!
Vizit http://pta.zwit.org/

Anonymous

November 28 2007, 21:23:26 UTC 4 years ago

naisioxerloro

Hi.
Good design, who make it?

Anonymous

January 3 2008, 21:09:22 UTC 4 years ago

raisbubre about acne

For reasons no one completely understands, follicles, often called pores, sometimes get blocked.
Sebum (oil) which normally drains to the surface gets blocked and bacteria begins to grow. Both whiteheads and blackheads start out as a microcomedone.

[info]wendyfewut

July 16 2008, 13:45:23 UTC 3 years ago

Sebum (oil), which normally drains to the surface get blocked, and bacteria begins to grow. Both whiteheads and blackheads start out as a "microcomedone".

Anonymous

March 23 2008, 07:42:38 UTC 4 years ago

Snx for you job!

Snx for you job!
It has very much helped me!

Anonymous

April 13 2011, 06:51:40 UTC 1 year ago

Hoping to make a contribution

Hey - I am certainly delighted to discover this. Good job!
Create an Account
Forgot your login or password?
Facebook Twitter More login options
English • Español • Deutsch • Русский…