procmail
[Top] [All Lists]

setting or unsetting HOST

1996-08-21 20:23:45
Alan Stebbens wrote,

|     :0
|     * Alan *Stebbens
|     { HOST }
| 
| This will silently drop any mail with my name in it, and not even log it.

One way to get it logged without writing to /dev/null is this:

     LOGABASTRACT = all

     :0hic
     * conditions
     LASTFOLDER=| echo deleted
      :0A
      { HOST }

But I guess that running /bin/echo is probably worse.

| **** Note to the Author of Procmail: Stephen R. van den Berg:
| 
|    Why don't you create an alias for the HOST variable, call it "QUIT",
|    and document it by saying: "if the QUIT variable is set to anything
|    but the current hostname, then procmail will stop processing
|    instantly." This usage makes much more intuitive sense.

Take a step back, please.

Setting $HOST to something other than the current host name (or technically,
something whose first nine characters don't match those of the current host
name) does not exactly make procmail stop instantly.  Its function is to
make procmail jump to the next rcfile named on the command line or, if the
current rcfile is the last one on the command line, to stop procmail in its
tracks.

The usage of naming more than one rcfile on the command line is rare but
legal.  Usually procmail is called in one of three ways:

1. without a specific rcfile named (implying that it's $HOME/.procmailrc
   unless you took the second unusual step of changing the default rcfile
   name at compile time);

2. with ONE rcfile named on the command line (relative paths are assumed
   to be from $HOME); or

3. with the -m option to name an rcfile (relative paths are assumed to
   be from the current directory), in which case only one rcfile can be
   named on the command line because additional arguments are set as
   positional parameters.

In all of those cases, unsetting or missetting HOST will cause an exit. 
IMHO, when Stephen added the INCLUDERC facility, the usefulness of specifying
more than one rcfile on the command line dropped significantly.  To be hon-
est, I think SmartList's flist utility is probably the only thing out there
invoking procmail with more than one rcfile named on the command line.

|    ...  never, ever set HOST unless
|    I want to instantly *quit* procmail.

Again, that is not *exactly* what setting HOST does, though it almost always
is what happens.  But it isn't really right to say that getting procmail to
quit is a guaranteed result.

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