Unix Programming - How to read mail in HP UX through Command line

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > May 2006 > How to read mail in HP UX through Command line





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to read mail in HP UX through Command line
Ajay

2006-05-11, 7:18 am

Hi,

I want to read a mail coming in from my Windows machine to unix
machine.

I am able to send the mail by using the following command:

echo "Hello" | mailx -s "Test Mail" "abc@xyz.com"

I want a similar command for reading the file? If some body can plz
help me out....

Why I need this is because I want to read the mail through a script.

Thanks in Advance..

Ajay

Rick Jones

2006-05-11, 1:17 pm

Ajay <ajay.khurana1234@gmail.com> wrote:
> I want to read a mail coming in from my Windows machine to unix
> machine.


> I am able to send the mail by using the following command:


> echo "Hello" | mailx -s "Test Mail" "abc@xyz.com"


> I want a similar command for reading the file? If some body can plz
> help me out....


> Why I need this is because I want to read the mail through a script.


Well, there is elm, pine, mutt - iirc all are CUI mail readers. Not
sure how scriptable they are. IIRC mail/mailx may also be able to
read mail.

Of course, for the "really" bare bones stuff you could simply read the
inbox directly with something like cat etc. /var/mail/<name> IIRC.
Would probably need to do some stuf with creating and honoring lock
files to make sure you and sendmail etc don't step on one another.

You might want to consider installing procmail or read what the
"vacation" program does and/or how to add things to a sendmail config
file. With that you could get email messages piped to a command
automagically as they arrive.

rick jones
--
No need to believe in either side, or any side. There is no cause.
There's only yourself. The belief is in your own precision. - Jobert
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Dave Denholm

2006-05-12, 1:15 pm

"Ajay" <ajay.khurana1234@gmail.com> writes:

> Hi,
>
> I want to read a mail coming in from my Windows machine to unix
> machine.
>
> I am able to send the mail by using the following command:
>
> echo "Hello" | mailx -s "Test Mail" "abc@xyz.com"
>
> I want a similar command for reading the file? If some body can plz
> help me out....
>
> Why I need this is because I want to read the mail through a script.
>


I use mh (actually nmh) which is a suite of small programs, designed
for scripting.

http://www.nongnu.org/nmh/

dd
--
Dave Denholm <ddenholm@esmertec.com> http://www.esmertec.com
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com