On Thu, 24 Apr 1997 15:31:48 -0400 (EDT),
Bill Jenuwine <wjenuwin(_at_)ford(_dot_)com> wrote:
:0 : nuldev
* ^From.*natureplus.com
| /dev/null
However, often I get the following error in my procmail.log file
procmail: Error while writing to "/dev/null"
As a result, the message gets through my defenses. Many users on my
system use this type of recipe and we have all seen the above error
sometimes (the error seems to happen more often than a successful
filter to /dev/nul). Can anyone help me diagnose how to make my
recipe/system more robust to this error?
1) Don't use a lock, i.e. make the first line simply read ":0". The
purpose of the lock file is to guarantee the integrity of the
written data in case several processes end up writing to the same
place at roughly the same time. When writing to the bit bucket,
you don't care much about data integrity.
2) /dev/null is not a program you can pipe to; remove the pipe
character.
3) You can have a second line of defense, something like
:0
* ^From.*natureplus\.com
/dev/null
# Oops, we had a match but the write wasn't successful ...
# write to a file in /tmp instead
:0e:
/tmp/blackhole
(On the second recipe, you are writing to a file, so locking makes
sense [in a way]. You usually don't need to name a lock file
explicitly, unless you are doing something unusual.)
Hope this helps,
/* era */
--
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r. <http://www.iki.fi/~era/>
* Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>