1748178 Members
4389 Online
108758 Solutions
New Discussion юеВ

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 3
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