When I wrote,
T> Here's an idea: include $HOST as well as $$ in the name of the logfile.
T> Then you can't possibly get a conflict.
W. Wesley Groleau answered,
G> I didn't mention before that if two hosts have the same log _directory_,
G> probably only one of them handles mail for that network. Here, each user
G> has a particular host that handles his/her mail. Mail to that user at
G> another host is forwarded to the users "oficial" mail host, and only there
G> would procmail get called, even though the .forward file is visible on
G> many hosts and the MUA (reader) can run on many hosts.
If any given user's incoming mail is all processed on one host, then two
simultaneous procmail processes for that user will never have the same PID in
the first place; yet in your earlier post you brought up the case where, if
procmail processes on two different machines for the same user put their log-
files into the same directory, there could be a naming conflict if by weird
coincidence they had the same PID.
But then the two procmail processes would have different values for $HOST,
and that could distinguish between their two logfiles.
You're now saying that it can't happen at your site because each user's mail
is handled by only one machine. OK; then in your earlier post you were
allowing for something that could happen elsewhere. So I don't understand
why you're objecting now.
In my own case, mail sent to dattier(_at_)wwa(_dot_)com or
processed on anago.wwa.com, which shares no directories with any other
machines. My .procmailrc on anago forwards some of it to miso.wwa.com by my
choice, so a significant amount of my mail, though it is addressed without
naming a machine within the domain, is handled by miso.
Mail sent to dattier(_at_)miso(_dot_)wwa(_dot_)com or
dattier(_at_)sashimi(_dot_)wwa(_dot_)com is processed
by the respective machine, but I have one $HOME (with one .procmailrc in
it and one $MAILDIR under it) residing on miso but used by both. Since the
mail transports here don't realize that, I'd get two copies of a single
letter addressed to both dattier(_at_)miso(_dot_)wwa(_dot_)com and
and they might very well trip over each other's feet in the logfile, espe-
cially because I file mail handled on miso and mail handled on sashimi in
different directories [both of which reside on miso], so neither procmail
process would be delayed waiting for the other to give up a local lockfile.
(Mail addressed to
I believe, to anago, but the MTAs know that, so if you send mail to
dattier(_at_)wwa(_dot_)com, dattier(_at_)anago(_dot_)wwa(_dot_)com, and
dattier(_at_)anyWWAmachinewhereIhavenologin(_dot_)wwa(_dot_)com, I think only
one copy will
So if I want one logfile per message, there will never be a timestamp-and-PID
conflict for my logs and folders on anago, but there could for my logs and
folders on miso, because either sashimi or miso might be delivering to them.