procmail
[Top] [All Lists]

Re: LASTFOLDER blues

2007-03-27 11:34:14
Axel Thimm wrote:
Mike Peeler wrote:
There's a lesson here: show us your code.

$ wc -l rc.*
      [ . . . ]
 2662 total

Of course I didn't mean *all* of it, unless that were the only way you
could show the *relevant* portion of it.

You made one statement that sounded wrong, to experienced procmailers:
that since a block is non-delivering, so are all the recipes inside of
it.  Now, that's false.  So everyone tried to interpret your statement
the only way that you wouldn't be making a terrible, beginner mistake.

They thought, oh, he couldn't be that dumb--he must be using ":0c" and
forgot to tell us.  Then you say you're not.  Still no one can believe
you.  We can tell you're fairly smart.  Yet, it turned out you managed
to get by quite well for a very long time carrying this misconception.

Even now, Bart is reduced to speculating what your code is doing.  So,
I told you if you had simply posted a few choice lines from your code,
we could've given you accurate, applicable answers right away.  Rather
than us all going down a rathole under a wrong assumption.  Right now,
you've wrongly concluded that the answer is to add a ":0e" after every
delivery recipe.  That might even be true if you were using ":0c", but
you've said you aren't, and I finally believe you.  That means all you
have to do is change *one* line of your existing code from, currently:

  :0
  * $ ! ${LASTFOLDER+!}
  { HOST=stop }

to this instead:

  :0  # check for failed delivery attempt
  * LASTFOLDER ?? .
  { EXITCODE=73 HOST }

Exactly as Bart already suggested.  Here are those few lines we've all
been speculating about that might've helped us a lot if you showed us:

  :0
  * condition1
  {
    :0:
    delivery1
  }

  :0
  * condition2
  {
    :0:
    delivery2
  }

Now, many people reading your question had guessed your code would be:

  :0
  * condition1
  {
    :0 c:
    delivery1
  }

Because that's a sure fire way to get in trouble.  You used the words,
"multiple deliveries" intending to mean "mutually exclusive" but ":0c"
made so much more sense to many of us that those words had just seemed
to confirm that you were indeed delivering more than once.  We misread
your words, and I apologize.  We tried to make sense out of it because
it didn't make sense, and you didn't give us the necessary information
to visualize your code.  We were reduced to imagining, and we imagined
wrong.  Your code might've saved several of us a lot of wasted effort.

FYI, with or without the 'c' flag, it turns out there is no difference
between the above nested blocks and these simpler non-nested versions:

  :0:
  * condition
  delivery

  :0 c:
  * condition
  delivery

So, no, I'm not en passant trying to be a smartass.  I've been
hammering on procmail recipes for a decade now.

And yet, it turns out, you are a smartass--who doesn't know how to get
help.  Like I said, rule 1 is show your code.  You're looking for help
precisely because you're hoping you've missed something, and you don't
already know what that might be.  In fact, if you knew in advance that
your only solution would be to convert all your code over to dropmail,
you could've skipped a step and not asked us.

But however mad at us you may be, the fact is, by asking us, you got a
good enough answer to get by with procmail for awhile.  That's been my
feeling, too, and probably half of procmail's loyal users.

The truth is that an fs issue nuked half a day of my mail which
should not happen.  And the truth is: If you want to have multiple
deliveries with different conditions/actions you need to manually
do the error checking on each recipe.  We came as far as to all
agree to that.

No, we agree that if you deliver to more than one place by using ":0c"
then you might need to protect them with ":0e".  If you don't use copy
deliveries, but only normal delivery, then you'll only fall through on
an error, never if a delivery has been made.  Thus your error checking
is already almost correct.  It was only that at that point your action
should be to recover, not discard.

-mdp


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