procmail
[Top] [All Lists]

Re: Extraneous ignore-write-error flag ignored

2001-11-14 17:30:45
*WHY* isn't "i" legal (and is "W"?) on a recipe whose action is
to open a left brace?

It *is* legal.  It just doesn't do anything - hence 'extraneous'.

When you are delivering, for example, to a mailbox, procmail checks that
it has successfully written the data.  If it has succeeded then it can
say "OK, I've delivered".  If it didn't succeed - if the filesystem was
full, say - then it won't say "OK, I've delivered".  Here the 'i' flag
is pointless - if you tell procmail to deliver to a mailfolder (or
forward to another mail address) and the write fails then procmail will
not ignore the error.

If you are delivering to a pipe, however, you have the option of saying
that delivery was successful, even if the program to which you are
delivering breaks the pipe before all the mail has been written.  That's
what the 'i' flag does.  Normally procmail does the 'obvious' thing...it
says to itself "hey! I was writing to this pipe and the pipe broke.
Something's gone wrong.  I won't say that I've delivered the mail so
that no mail is lost."  If you *know* that your program is doing the
correct thing the 'i' flag says "trust me - the mail has been delivered
even if the pipe was broken".

Not that this relates to *delivery*.

Here:

     PW=`gawk '/^[       ]*[Bb][Ee][Gg][Ii][Nn]/{print $2;exit}' -`

a variable is being set.  Whether or not the mail was given to gawk,
procmail is never going to have to consider at this point whether or not
a mail was delivered, because there is no delivery going on.  You can
test in a following recipe if PW is set the way you expect it to be set.
There is no need to override any default behaviour.

Note that the gawk program will not always read the entire message.
I don't know whether formail will or not.  It doesn't make sense
to me NOT to have "iW" on the recipe with the opening brace, due
to the programs executed for variable assignment within it.

Hopefully it is clear that procmail doesn't care whether or not gawk
read the entire message here.  So there is no need to tell it not to
care.  Or is there a subtlety that I've missed?  (It wouldn't be the
first time!!!)

Hope that helps,
Martin
-- 
Martin McCarthy                 /</                  PGP key available
    `Procmail Companion'        \>\  http://www.ancient-scotland.co.uk
     Addison Wesley             /</    http://www.ehabitat.demon.co.uk
_______________________________________________
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>