Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Mail with Script

SOLVED
Go to solution
Scott Frye_1
Super Advisor

Reading Mail with Script

If I were wanting to read mail with a script and put that output in an html file, where would I find the mail?

HP-UX 11.0 and HP-UX 11.11

Thanks

Scott
3 REPLIES
Jeff_Traigle
Honored Contributor
Solution

Re: Reading Mail with Script

Mailboxes have been in /var/mail since 10.20 (maybe even since 10.01). Each user's mailbox is a text file named with the username, owned by the user and mail group with 660 permissions.
--
Jeff Traigle
Scott Frye_1
Super Advisor

Re: Reading Mail with Script

Perfect.

Thank you.
Cesare Salvioni
Trusted Contributor

Re: Reading Mail with Script

Hi
using aliases you can also read a mail as soon as it arrives.

Add a line like:

myname: |/absolute_path/script_name

and run the command newaliases

Now when the mailer receive a mail addressed to myname, it start the script /absolute_path/script giving him the mail as standard input, so you can process directly the mail as they arrive.

Remember to declare in the script the shell to use (first line must be something like #!/usr/bin/sh)

Hope it helps