Mail delivery methods (was: Mail servers)

Chip Salzenberg chip at ateng.ateng.com
Wed Feb 1 07:30:30 AEST 1989


According to bernsten at phoenix.Princeton.EDU (Dan Bernstein):
>Huh? Did I say that .mailserver didn't do the appropriate locking? Of
>course it does. Good shell programmers never assume that their script
>will be run by only one program at once.

Sorry about the assumption.

>> Instead, use my "deliver" program, available at many fine archive sites.
>> You can configure deliver to use any combination of kernel locking and/or
>> file creation locking, and you can vary delivery behavior based on just
>> about anything.  Fcntl() or lockf(), for example.
>
>Seriously, to advertise well, why don't you tell us what deliver can do.
>Does it make sure to mark From: lines?

I don't know what this means.  In general, however, deliver does not modify
a mail message at all, with the exception of the UUCP envelope line.

>Does it handle various problem
>situations correctly and have features to break infinite locks?

Deliver is paranoid; it checks system call return statuses as a matter of
course.

>Can you program it to delete all mail coming from idiot at work or
>idiot at across the street that mentions ``marr[iy]'' at the beginning of a
>word?

	# sample delivery file --
	# trash proposals from idiot
	case "$SENDER" in
	*!work!idiot)
	    if deroff <$BODY | grep '^[Mm]arry' >/dev/null
	    then
		exit
	    fi
	esac

	echo "$1"

>Does it replace biff's message announcement with more
>intelligent, programmable informing?

A user delivery file may call any program; this could, of course, include
a nice notification program.

>Can you completely rework what it does to save messages
>completely differently, or does it assume the usual mailer?

You may handle a message yourself, in which case deliver will do nothing
further.  This is handled by deliver's requirement that a user delivery
file echo the final destination of a message, even if it is simply the
user who owns the delivery file.  If nothing is echoed, deliver does not
put the message into the default mailbox.

>And does all of the above fit in your directory in as little space
>as does a comparable fourteen-line sh script?

An given thing can, of course, be done with a shell script.  If you have
a solution you like, stick with it, of course.  Deliver is just one more
alternative.

Deliver is most useful for those who use Smail 2.5 or who use SCO Xenix.  It
was designed to be a local mail agent for the former, and a drop-in
replacement for /usr/lib/mail/mail.local for the latter.
-- 
Chip Salzenberg             <chip at ateng.com> or <uunet!ateng!chip>
A T Engineering             Me?  Speak for my company?  Surely you jest!
	  "It's no good.  They're tapping the lines."



More information about the Comp.unix.wizards mailing list