Help for replying a mail using shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help for replying a mail using shell
# 1  
Old 08-14-2012
Help for replying a mail using shell

Hi,
I have tried a script which sends mail to the user and its working fine. Is there any possibility to reply to user mail which is available in the mailbox. I searched in internet but didnt find any solutions. Any help will be really useful.

Code:
 
mail -s "sample mail" abc@gmail.com < file

rogerben
# 2  
Old 08-14-2012
If you want do that automated, you can use a .forward and hand it over to procmail for example to filter out sender, subject etc. and decide by this what to do with the mail or trigger a script that sends a mail back directly.

Last edited by zaxxon; 08-14-2012 at 07:28 AM..
# 3  
Old 08-14-2012
Hi rogerben,

You can just use the mail utility on the unix system.

Just try;

Code:
mail

It should take you into the mailbox.

Regards

Dave
# 4  
Old 08-14-2012
Quote:
Originally Posted by gull04
Hi rogerben,

You can just use the mail utility on the unix system.

Just try;

Code:
mail

It should take you into the mailbox.

Regards

Dave
Dave ,
Can you provide the exact syntax of the command. The command just store some messages in /var/spool folder.
rogerben
# 5  
Old 08-14-2012
Hi,

The command should just be as above, however.

Code:
ss071a-root>mail
From root@ss071a.xxxxx.com Tue Aug 14 12:07:01 2012
Date: Tue, 14 Aug 2012 12:07:01 +0100 (BST)
From: Super-User <root@ss071a.xxxxx.com>
Message-Id: <201208141107.q7EB71qX008796@ss071a.xxxxx.com>
To: root@ss071a.xxxxx.com
Subject: Output from "cron" command
Content-Length: 183

Your "cron" job on ss071a
find /usr/lpp/tracker/tmp -name BED002\* -exec rm {} \;

produced the following output:

find: stat() error /usr/lpp/tracker/tmp: No such file or directory


? ?
?               print this help message
#               display message number #
-               print previous
+               next (no delete)
! cmd           execute cmd
<CR>            next (no delete)
a               position at and read newly arrived mail
d [#]           delete message # (default current message)
dp              delete current message and print the next
dq              delete current message and exit
h a             display all headers
h d             display headers of letters scheduled for deletion
h [#]           display headers around # (default current message)
m user          mail (and delete) current message to user
n               next (no delete)
p               print (override any warnings of binary content)
P               override default 'brief' mode and display ALL header lines
q, ^D           quit
r [args]        reply to (and delete) current letter via mail [args]
s [files]       save (and delete) current message (default mbox)
u [#]           undelete message # (default current message)
w [files]       save (and delete) current message without header
x               exit without changing mail
y [files]       save (and delete) current message (default mbox)
?

Or you could also try;

Code:
man mail

Regards

Dave

Last edited by gull04; 08-14-2012 at 08:17 AM.. Reason: Remove Company ID
This User Gave Thanks to gull04 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

2. UNIX for Dummies Questions & Answers

How to send e-mail from shell script ( C shell )?

Hi , How to send e-mail from shell script ( C shell ) . Mailx command is not working ( It didn't giving error also ). Please help me (2 Replies)
Discussion started by: arukuku
2 Replies

3. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

4. Post Here to Contact Site Administrators and Moderators

Does replying to your own message count as an additional post?

There used to be a feature whereby when one would reply to one's own post the response would be added to the previous post as opposed to posted as an additional post. This seems to have been lifted, ie a reply to one's own post is in fact an additional post. What exactly is the rule? And is it true... (2 Replies)
Discussion started by: figaro
2 Replies
Login or Register to Ask a Question