Path: utzoo!attcan!uunet!decwrl!elroy.jpl.nasa.gov!ncar!mephisto!bbn.com!mips2!mips2.cr.bull.com!peters From: peters@mips2.cr.bull.com (Dan Peters) Newsgroups: comp.unix.questions Subject: Programmatic Mail reader Message-ID: <1990Jul26.155303.15563@mips2.cr.bull.com> Date: 26 Jul 90 15:53:03 GMT Sender: peters@mips2.cr.bull.com (Dan Peters) Organization: Bull HN Information Systems Inc. Lines: 38 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