[net.mail] rerouting mail after a timeout

mp@allegra.UUCP (Mark Plotnick) (01/14/86)

All the systems in our lab use a common aliases file, with an entry
for each user in the lab so that all mail for a given user goes to
exactly one machine.

Many users here do most of their work on Suns, using the central vaxes
only for reading mail and netnews.  I've gotten quite a few requests
from some users wondering if it's possible to change their aliases to
route their mail to their Suns (since this would save them the trouble
of having to manually copy saved mail messages from the vaxes to the
Suns) yet be assured that if they turn off their Suns for a long period
of time without telling anyone (e.g. to go on vacation) that their mail
will then be automatically rerouted to a vax rather than being returned
to the sender.  Has anyone enhanced sendmail's timeout mechanism (or
written a separate tool that grovels through the queue files) to do
something like this?

	Mark Plotnick
	allegra!mp

ggr@packard.UUCP (Guy Riddle) (01/16/86)

) Many users here do most of their work on Suns, using the central vaxes
) only for reading mail and netnews.  I've gotten quite a few requests
) from some users wondering if it's possible to change their aliases to
) route their mail to their Suns (since this would save them the trouble
) of having to manually copy saved mail messages from the vaxes to the
) Suns) yet be assured that if they turn off their Suns for a long period
) of time without telling anyone (e.g. to go on vacation) that their mail
) will then be automatically rerouted to a vax rather than being returned
) to the sender.

At the cost of some inefficiency, you could normally route the users
mail to their VAX-addresses where those users that wished their mail delivered
to their SUNs could create a .forward file on the VAX to route their mail
to their SUN-addressese.

They could then remove the .forward when they went on vacation, leaving
their mail on the VAX (or modify it to run their mail through the infamous
vacation(1) program).

		=== Guy Riddle == AT&T Bell Laboratories Liberty Corner ===

sid@linus.UUCP (Sid Stuart) (01/20/86)

>Many users here do most of their work on Suns, using the central vaxes
>only for reading mail and netnews.  I've gotten quite a few requests
>from some users wondering if it's possible to change their aliases to
>route their mail to their Suns (since this would save them the trouble
>of having to manually copy saved mail messages from the vaxes to the
>Suns) yet be assured that if they turn off their Suns for a long period
>of time without telling anyone (e.g. to go on vacation) that their mail
>will then be automatically rerouted to a vax rather than being returned
>to the sender.  Has anyone enhanced sendmail's timeout mechanism (or
>written a separate tool that grovels through the queue files) to do
>something like this?
>
>	Mark Plotnick
>	allegra!mp


	The nicest solution to this problem would be to have only one
/usr/spool/mail directory across your network of computers.
Having only one /usr/spool/mail directory means that whatever computer
you log into, you read the same mail.  I don't think it would take more than
a week or two of work to do, unfortunatly I haven't had a week or two to do it
yet. I am hoping Sun will do it in Release 3.0. Here is the idea,

		1) Sendmail.cf changes:
		 Have the computers route all their mail to a main machine,
		lets call it the mailhost. This would mean that the
		subsidiary machines, lets call them nomailhosts, would
		not have a local mailer specified in their sendmail.cf.
		The mailhost would also rewrite the addresses coming
		from the nomailhosts to make it appear as if the mail
		was sent from the mailhost. The mailhost would also
		accept mail sent to the nomailhosts and deliver it
		via the local mailer.


		2) Directory changes:
		Set up the mailhost's /usr/spool/mail directory
		normally. Have the mailhost's /usr/spool/mail mounted
		on the nomailhost machines through the NFS.

		3) Software changes:
		This is the hard part. Sendmail, /bin/mail and
		/usr/ucb/mail and probably any other mail readers/deliverers
		want to coordinate spooled mailfile activity through lockfiles.
		They have a timeout check on the creation date of the
		lockfile. To make sure that that time skew on different
		machines doesn't burp on this feature and to fix any posible
		wierd race problems that I don't want to consider, one
		needs a lock server. It would be easy to implement the lock
		server using Sun's RPC, but it would take a week or so for me
		to do it.(Which I don't have.)

		
	The above changes require that you have NFS running on your Vax. This
is available from Mt. Xinu.


	You can also have your users read news on the Suns, just mount the
news spool directory with the NFS and install the news reader on the Suns.


						sid at linus

woof@psivax.UUCP (Hal Schloss) (01/23/86)

In article <132@linus.UUCP> sid@linus.UUCP (Sid Stuart) writes:
>>Many users here do most of their work on Suns, using the central vaxes
>>only for reading mail and netnews.
>>
>>      Mark Plotnick
>>      allegra!mp
>
>
>       The nicest solution to this problem would be to have only one
>/usr/spool/mail directory across your network of computers.
>Having only one /usr/spool/mail directory means that whatever computer
>you log into, you read the same mail.  I don't think it would take more than
>a week or two of work to do, unfortunatly I haven't had a week or two to do it
>yet. I am hoping Sun will do it in Release 3.0. Here is the idea,
>
>                                               sid at linus


I did it. What I have done is to have two vaxes both appear as the same machine
for mail and netnews purposes. As sid suggests latter is his message the Mt.
Xinu NFS port is required to accomplish this. If you have this what you can do
is have all the machines use just one mail directory and one netnews directory.

For mail I set it up so that /usr/spool/mail is actually the same directory by
using a symbolic link on the new machine to point to the old machines directory.
This requires NFS. Thus to read the mail a user must only run mail on either
machine and things go fine. To send mail I force sendmail to run only on the
old machine. The new machine has the following script for sendmail.

#!/bin/sh
cat << EOF > /vax/tmp/rsh$USER$$
#!/bin/sh
PATH="$PATH"
export PATH
rm /tmp/rsh$USER$$
exec $0 $*
EOF
chmod u+x /vax/tmp/rsh$USER$$
exec rsh psivax /tmp/rsh$USER$$

This forces sendmail to run on psivax.

For the netnews, I have set up /usr/spool/news to be named identically on
both machines, and run inews only on one of the machines. I use a similar
script for inews.
--
                Hal Schloss
                (from the Software Lounge at) Pacesetter Systems Inc.
 {sdcrdcf|ttdica|group3|scgvaxd|nrcvax|bellcore|logico|rdlvax|ihnp4}!psivax!woof
 ARPA: ttidca!psivax!woof@rand-unix.arpa

earle@smeagol.UUCP (Greg Earle) (01/30/86)

> 		1) Sendmail.cf changes:
>		(Route mail to mailhost)

I was thinking of doing this (i.e., having one mail location for all machines
on the net) for my Sun Net (10 Sun-2's; 6 running 2.0); why
is this necessary if you do (2)??

> 		2) Directory changes:
>		(NFS mount /usr/spool/mail)

> 		3) Software changes:
>		(Add a lock server to avoid clock skew problems on timeout
>		reads of lock files)

Is this really necessary, if you avoid the clock skew problems?  I have a
script, which I call "settime", that runs 4 times a day on one machine.
It does an rdate(8) from the host which has the best time value (in JPL's
case, the machine in question has a UTC box that runs off a Lab-wide cable,
so when certain software is running on it, that machine's clock is 
automatically set to proper UTC from the box - the advantages of being @ JPL),
and then it propagates this time to all the other machines via 
	rsh machine-n rdate this-machine
This script runs on the machine that has the best hardware clock (i.e. least
clock drift over a weekend, with all clocks set identical Friday Eve.), so
in case the first rdate times out because the UTC grabber machine is down,
it is likely to still have the closest-to-correct clock.  This was necessitated
because I found 2 machines to be more than *2 minutes* ahead of correct time
at the end of the weekend.  I run this script out of cron(8), and now no
machine gets out of whack enough for this to be a problem.

> 						sid at linus

	Greg Earle
	sdcrdcf!smeagol!earle (UUCP)
	ia-sun2!smeagol!earle@csvax.caltech.edu (ARPA)