Path: utzoo!mnetor!uunet!husc6!mailrus!nrl-cmf!ames!necntc!linus!heart-of-gold!jc From: jc@heart-of-gold (John M Chambers x7780 1E342) Newsgroups: comp.mail.uucp Subject: Re: Rerouting of explicit paths Message-ID: <132@heart-of-gold> Date: 24 Mar 88 20:14:35 GMT Distribution: na Organization: Mitre Corp, Bedford, MA, USA Lines: 58 Keywords: simple > I think that Mark's proposal is OK but like a similar proposal I made a > while back, I think it only applies to sites with the source to their > mailer and I would guess they are in the minority. Nah, you don't always need the source. If you are running uucp, it's pretty easy to do what I've often done: su # Always useful (;) mv /bin/rmail /bin/rmail.real vi /bin/rmail ... chmod +x /bin/rmail The script you put in to replace rmail gets the recipient(s) as args, and the message is on the standard input. You can do with these as you wish. I usually do something like: SMARTHOST=rutgers!seismo!ihnp4 # First, put the message into a named file. cat >/tmp/Mail$$ # Next, learn what we can about the recipients. echo 'To: "$* >/tmp/To.$$ grep '^To:" /tmp/Mail$$ >>/tmp/To.$$ ... [Assorted lookups and recipient-munging] [Leave list of recipients in $*] ... for r do # Try a list of mailers for each recipient. ... if [ $? -ne 0 ]; then # As a last resort, hand it back to uucp mail. /bin/rmail.real $r