Mailx bulk operations

Greeting.

How to download messages in bulk in mailx? e.g. how to download all the message received on mar-23-2017 and save as a file or download individual mailx message that received on mar-23-2017 as individual file and as a loop?

We are on HP-UX centstdb B.11.31 U ia64 3294693583 unlimited-user license

We monitor our system using some customised scripts and run it as cron jobs. The cron job will send the job status message as root. We will then logon to our server and check those messages. Is there a way we can bulk download the messages?

What we have in mind, is to bulk download, and then set up a search script for error and then send a daily report to us instead of us have to logon to the server and check manually for any failed cron jobs.

Thanks for all the help.

Hi,

I don't myself have any direct experience with HP-UX, but I know that the mailx implementation on Solaris allows you to save ranges of messages, albeit not by date. Does the HP-UX implementation allow you to do the same ? If it does, then the man page for mailx should show that the save or copy commands let you do that, and give you the syntax.

If you absolutely have to do the saving by date however, and not simply be able to save ranges of messages, then a better option here (well, perhaps better isn't the right word, but an option anyway) would be to directly monitor the user's local mailbox in your monitoring script, rather than going via an MUA like mailx . Or if there's another server you could do the processing on, you could SCP or otherwise copy the mailbox file off, parse it, then do whatever you had to do based on what you found.