procmail
[Top] [All Lists]

.forward and procmail

1996-04-18 01:11:52
We have an interesting problem with our mail setup here. I've looked
through mail archives and have not found anything that addresses this
problem.

We have multiple sets of machines of different architectures. eg we have
about 40 DECstations, some suns, 20 or so Indy's, etc.

We each share one home directory across all these machines.

Each machine has its own /usr/spool/mail or /var/mail.

This leads to interesting problems. If you use the standard procmail
.forward file then you have no idea which architecture it will be running
on. This is ok in most cases since procmail is always in the same spot and
most of my recipies are handled by procmail, run system binaries or run
scripts. BUT I (and many others) like all the non-special mail to be
appended to $mail. For this reason we want to ensure that procmail runs on
a particular host.

So my first stab at this was as follows.
I put: HOST=fangorn.cs.monash.edu.au 
in .procmailrc (or HOST=indy03 or whatever the machine in question is).

And I put:
kevinl(_at_)fangorn(_dot_)cs(_dot_)monash(_dot_)edu(_dot_)au,"|IFS=' '&& exec 
/usr/monash/bin/procmail -f-||exit 75 #kevinl"

in .forward.

My thinking was that sendmail (ah, I should have mentioned that) will not
try forward to itself if it sees user(_at_)host and is running on host. 
Unfortunately, the above results in procmail never doing anything except on
fangorn (good!) but sendmail appends the mail to $mail on fangorn. Which
means I get duplicates of anything procmail appends to $mail and I get to
see all that mail that I use procmail to hide away from me.

My current solution to the problem is ugly. I pipe my mail through a script
that tests which machine it is on. If it is on the wrong machine, it
'encodes' the message by taking the 'From ' line and turning it into an
X-Orig-From: line and piping that to sendmail to deliver it to myself at
the right machine. If it is running on the right machine, it takes an
X-Orig-From: line if it finds it, replaces the 'From ' line it finds (which
always says me since it was forwarded by me in the first incantation of the
script) and pipes that to procmail.

The above system works fine. Only problem is that it is ugly.

Anybody got any ideas on how to do this right? There must be people out
there who have the following properties:
1) Shared home directories on machines of differing architecture
2) Separate mail directories on ALL machines
3) Like to keep unread, unprocessed mail in /usr/spool/mail

-- 
[=======================================================================]
[ Kevin Lentin                 |finger 
kevinl(_at_)fangorn(_dot_)cs(_dot_)monash(_dot_)edu(_dot_)au| ]
[ K(_dot_)Lentin(_at_)cs(_dot_)monash(_dot_)edu(_dot_)au    |for PGP public key 
block. Fingerprint | ]
[ Macintrash: 'Just say NO!'   |6024308DE1F84314  811B511DBA6FD596    | ]
[=======================================================================]

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