changing mail directory

Marc W. Mengel mmengel at cuuxb.ATT.COM
Thu Oct 13 00:49:28 AEST 1988


In article <484 at genesis.ATT.COM> andys at shlepper.ATT.COM (a.b.sherman) writes:
>In article <1162 at mrspoc.UUCP> itkin at mrspoc (Steven M. List) writes:
>>In article <305 at mccc.UUCP> pjh at mccc.UUCP (Pete Holsberg) writes:
>>> In article <390 at westmark.UUCP> dave at westmark.UUCP (Dave Levenson) writes:
>>> > You will probably need to re-compile rmail to accomplish what you
>>> > want.
>>> That'll be hard without source code!
>>Not if you use smail. 
>
>Ah, but what was the original question?  How can one change the mailbox
>directory from /usr/mail to /foo/bar?  Smail does *NOT* handle local
>mail delivery.  Local mail delivery is passed to a program usually
>called /bin/lmail.  "What is /bin/lmail?" I hear you ask.
>/bin/lmail is the original /bin/[r]mail that came with your system.
>To change local delivery, you still need the source to the vanilla
>/bin/mail that ships with your operating system.

Well, actually, for local mail deleivery only you could just use
the following script, made complicated only by the mail lock file.
(You might want to modify it to forcibly remove the lock if it spins
in the until loop enough times...)

	fromname=$LOGNAME
	maildir=/usr/mail
	for toname in $*
	do
		umask 222
		until > ${maildir}/${toname}.lock
		do
			sleep 5
		done
		umask 077
		echo From ${fromname} `date` >> ${maildir}/${toname}
		sed -e 's/^From />&/'        >> ${maildir}/${toname}
		rm -f ${maildir}/${toname}.lock
	done



More information about the Comp.unix.questions mailing list