procmail
[Top] [All Lists]

more on limiting stdin

1997-03-29 13:53:22
Philip Guenther wrote,

| The only way to have procmail
| write nothing is to cheat and execute the program from a *condition*
| which has a "var ??" special on it that refers to an empty variable.

That's a very good idea, Philip, and I wouldn't call it cheating at all.

| HOWEVER, you then lose the locking, so I would *not* do this.  You
| aren't saving yourself anything.

You could still have locking with a little extra code:

  :0i
  * real condition
  action_that_needs_no_stdin

becomes

  :0
  * real condition
  {
    LOCKFILE=name.of.lock
    KEEP_ME_UNSET

    :0i
    * KEEP_ME_UNSET ?? ? action_that_needs_no_stdin
    { }

    LOCKFILE
  }

or perhaps,
 
  :0cw:name.of.lock # w may not always be needed
  * real condition
  {
   KEEP_ME_UNSET

   :0i
   * KEEP_ME_UNSET ?? ? action_that_needs_no_stdin
   { }

   TRAP
   HOST
  }

though I think that the version without the clone is preferable.

| Anyway, procmail stops writing as soon as it gets a write error, so I
| probably wouldn't bother even putting the 'h' flag on the recipe, as it
| will probably only save the copying of something like
| PIPE_BUF-sizeof(header) bytes inside the kernel, and that's nothing.

Does procmail stop writing on the first write error even if there is an `i'
flag?

| If someone really cares about this, they should appeal to Stephen to add
| a new flag, say, 'I', that causes procmail to not write anything at all.

Stephen, sadly, has been MIA from here.

<Prev in Thread] Current Thread [Next in Thread>