Article View: comp.mail.sendmail
Article #102Re: Reliable mail delivery in fileserver/workstation environment?
From: Eric Wassenaar
Date: Sat, 08 Aug 1992 13:03
Date: Sat, 08 Aug 1992 13:03
106 lines
4004 bytes
4004 bytes
In article <1992Aug8.021202.6182@cs.ucla.edu>, wales@valeria.cs.ucla.edu (Rich Wales) writes:
> However, if Fred is using a ".forward" file, there is the possibility
> that mail delivery might not go as planned
> ...
> the sources, it should be possible to add a test to see whether Fred's
> home directory is currently accessible; if yes, delivery would proceed,
> but if not, delivery would be delayed until the next queue run. This
> should presumably fix things . . . .
I am using exactly such a scheme, and it seems to serve the purpose
well enough in most practical cases.
An example of a simple possible fix is attached below (context diff
against 5.65c+IDA1.4.4, your mileage may vary).
> Well, not quite. If Fred is invoking a program amongst his own files
> from inside his ".forward" -- and/or if Fred is using some scheme that
> pre-sorts his incoming mail among a group of "folders" or files in his
> home directory -- there could still be trouble if the fileserver F man-
> ages to go down immediately after the workstation W's sendmail checks
> for Fred's directory and finds it's there.
I think that it has now become the responsibility of Fred's mail filters,
and not of sendmail any more, to postpone delivery by returning an
EX_TEMPFAIL or such status, if they decide that for some reason they
cannot act as desired.
*** sendmail.h Sat Aug 8 14:20:48 1992
--- sendmail.h.new Sat Aug 8 14:22:22 1992
***************
*** 150,155 ****
--- 150,156 ----
# define QPRIMARY 000010 /* set from argv */
# define QQUEUEUP 000020 /* queue for later transmission */
# define QSELFREF 000040 /* self-reference in alias/forward expansion */
+ # define QMUSTQUEUE 000100 /* force queueup instead of delivery */
/*
** Mailer definition structure.
** Every mailer known to the system is declared in this
*** alias.c Sat Aug 8 14:20:52 1992
--- alias.c.new Sat Aug 8 14:26:28 1992
***************
*** 689,694 ****
--- 689,695 ----
ADDRESS **sendq;
{
char buf[60];
+ struct stat stb;
if (tTd(27, 1))
printf("forward(%s)\n", user->q_paddr);
***************
*** 701,706 ****
--- 702,715 ----
/* good address -- look for .forward file in home */
define('z', user->q_home, CurEnv);
expand("\001z/.forward", buf, &buf[sizeof buf - 1], CurEnv);
+
+ /* force queueup if home directory unavailable */
+ if (stat(user->q_home, &stb) < 0)
+ {
+ user->q_flags |= QMUSTQUEUE;
+ return;
+ }
+
if (!safefile(buf, user->q_uid, S_IREAD))
return;
*** deliver.c Sat Aug 8 14:20:58 1992
--- deliver.c.new Sat Aug 8 14:24:55 1992
***************
*** 182,187 ****
--- 182,203 ----
#endif /* BIT8 */
/*
+ ** We may have decided earlier that this recipient must be queued.
+ ** Used if the home directory of a local recipient is unavailable.
+ */
+
+ if (bitset(QMUSTQUEUE, to->q_flags))
+ {
+ to->q_flags |= QQUEUEUP|QDONTSEND;
+ e->e_to = to->q_paddr;
+ message(Arpa_Info, "queued");
+ if (LogLevel > 4)
+ logdelivery("queued");
+ e->e_to = NULL;
+ return (0);
+ }
+
+ /*
** If this mailer is expensive, and if we don't want to make
** connections now, just mark these addresses and return.
** This is useful if we want to batch connections to
Eric Wassenaar
--
Organization: NIKHEF-H, National Institute for Nuclear and High-Energy Physics
Address: Kruislaan 409, P.O. Box 41882, 1009 DB Amsterdam, the Netherlands
Phone: +31 20 592 5012, Home: +31 20 6909449, Telefax: +31 20 592 5155
Internet: e07@nikhef.nl
Technical Details
Message-ID:
<1716@nikhefh.nikhef.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!nikhefh!e07References:
<1992Aug8.021202.6182@cs.ucla.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!nikhefh!e07 From: e07@nikhefh.nikhef.nl (Eric Wassenaar) Newsgroups: comp.mail.sendmail Subject: Re: Reliable mail delivery in fileserver/workstation environment? Message-ID: <1716@nikhefh.nikhef.nl> Date: 8 Aug 92 13:03:43 GMT References: <1992Aug8.021202.6182@cs.ucla.edu> Organization: Nikhef-H, Amsterdam (the Netherlands). Lines: 106