procmail
[Top] [All Lists]

Re: In the process of compiling

1998-07-03 12:14:18
Sean Straw wrote in reply to lineman(_at_)deltanet(_dot_)com,

| ...  you're really up a creek (AFAIK) if
| the system uses procmail for a local delivery agent - since the older
| system copy will be used, not your personal one.

Here is a way around it, though it's a bit inefficient.  Assumption: the
defined LDA will always be specified by a full path.  (Procmail's $0 returns
the name under which procmail was called, unlike $_, which always gives a
full absolute path.)

At the very top of your .procmailrc,

BINARY=$0

:0
* BINARY ?? ^^/
* ! $ BINARY ?? ^^()$HOME
| $HOME/bin/procmail # or whatever your path

Translation: if procmail is called by an absolute path but that path does
not begin with your $HOME, feed the message to your own procmail binary.  If
procmail is called with just a basename or a relative path, we assume that
it's you at a shell prompt or another script of yours doing the invoking and
that we already are using the version earliest in your $PATH or the one you
named on the command line, so we stick with whatever is running.

If you ever specifically do want to run the system copy, you can invoke
it like this (with however many ../ it takes to get from your current
directory to the root directory, and too many can't hurt),

 ../../../usr/local/bin/procmail

If my assumption is wrong, here's an alternative.  When you compile your
personal copy, set the default rcfile name to something different from
$HOME/.procmailrc.  Then link your .procmailrc to that name and check which
binary is running this way:

 RCFILE = $_

 :0
 * RCFILE ?? ^^(.*/)?\.procmailrc^^
 | $HOME/bin/procmail # or whatever the path to your own copy

Either way, the problem is that there is no good way to find out whether the
system version already running on that message is is the same version as your
personal copy or a newer version than yours.  If it is, you'll want to handle
your recipes in it instead of forking your personal copy.  [Yet another rea-
son to have a $PROCMAIL_VERSION variable built in.]  You can extract it from
the output of procmail -v, but then you're always running an extra process.

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