Programmatic Mail reader

Dan Peters peters at mips2.cr.bull.com
Fri Jul 27 01:53:03 AEST 1990


	This is my first post to this newsgroup, I hope it is appropriate.
What is the easiest way to programmaticly do the following:

	read mail,
	dump it to a file (i.e. log)
	delete the messages read (so they arn't logged again),
	quit mail


I have tried to programmaticly read mail with MAILX on a Hewlett Packard
machine running HP-UX (BSD 4.3 based i believe) with the following .mailrc
file:
	if r
	set autoprint
	save * dlog
	delete *
	quit
	endif

This is my first attempt to programmaticly read mail, log it to file dlog and
then delete the mail from the mailbox and exit mailx.
Mailx is called form this script:

	if mailx -e
	then
		echo :Logging please wait.."
		mails
		/usr/bin/pg dlog
	fi

Why won't mailx exit programmatically via the .mailrc file (it does everything
else)?
I must be doing this the hard way (you usually do until you learn the easy
way :-) any help out there?
Thanks for you time.

Dan



More information about the Comp.unix.questions mailing list