We use following mail command in a script. We want to modify below command in script so that we can set mail as CC, BCC and From field of mail also can be modified. Please suggest.
Moderator's Comments:
edit by bakunin: please use CODE-tags for code, data and terminal output as required by the forum rules. Thank you.
I am using aix 5.1
I am trying to put a line in a command script to e-mail myself when a command is done.
I am not sure what that is . Could somebody help me ?
Thanks (2 Replies)
i wanted to write a shell script that can automatically read unread mails and copy each one into a different file. I was trying to use the MAIL command to do it, but this command requires user input inbetween, I was wondering how that could be achieved in a shell script.
Can sumone please suggest... (0 Replies)
Hi..
How can i use mailx,mail command in Shell Script.
Suppose i gave a condition that x value is above 25 send a mail alert to abc@rediffmail.com.
How can i do this?
Regards
Sollin (16 Replies)
I apoligize for the cross-post but I'm not getting much in the way of help in the dummies forum:
I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements:
1. command line switch to specify file name containing message body in HTML format
2. command... (3 Replies)
Can someone please help me with this script, I'm trying to create system backup on AIX, for this I want to first mount the filesystem if it is not mounted, then create the backup and unmount the filesystem but I'm having problem while using the mail command to notify the status of filesystem... (9 Replies)
Hi all,
Currently in shell script i am using the following command to send mail
echo "Certain assets are not loaded properly. PFA the result of the DataLoad" | mail -s "Weekly DataLoad - Failure Notification !!" $MAILINGLIST
I need to attach a file along with that. How should i handle this... (7 Replies)
Hello
I am trying to send an email when a .KSH script is run on an AIX Machine.
This email will only include a subject line that is made up of variables from within the script, and is as follows:
CURRENT_DATE=`date +%Y%m%d`
TIME=`date`
ADMIN="myname@domain.com"
date
block ()
{
... (4 Replies)
Hello all
I'm trying to write a script to send an email, so I can be nnotified when something is going wrong with my system.
I've tried many options with no luck:
mail -s "You've got mail" somebody@example.com
echo "Mail Body" | mail -s "Subject" somebody@example.com
I tried also to... (1 Reply)
HI everyone,
I would like to have a script to run a certain linux command and mail the results or output of this command.
This shell is to be later on set as cronjob.
thanks in advance. (9 Replies)
Discussion started by: patrickminas
9 Replies
LEARN ABOUT DEBIAN
msgchk
MSGCHK(1) [nmh-1.5] MSGCHK(1)NAME
msgchk - check for messages
SYNOPSIS
msgchk [-date | -nodate] [-notify all/mail/nomail ] [-nonotify all/mail/nomail ] [-host hostname] [-user username] [-sasl] [-saslmech mech-
anism] [-snoop] [users ... ] [-version] [-help]
DESCRIPTION
The msgchk program checks all known mail drops for mail waiting for you. For those drops which have mail for you, msgchk will indicate if
it believes that you have seen the mail in question before.
The -notify type switch indicates under what circumstances msgchk should produce a message. The default is -notify all which says that
msgchk should always report the status of the users maildrop. Other values for `type' include `mail' which says that msgchk should report
the status of waiting mail; and, `nomail' which says that msgchk should report the status of empty maildrops. The -nonotify type switch
has the inverted sense, so -nonotify all directs msgchk to never report the status of maildrops. This is useful if the user wishes to
check msgchk's exit status. A non-zero exit status indicates that mail was not waiting for at least one of the indicated users.
If msgchk produces output, then the -date switch directs msgchk to print out the last date mail was read, if this can be determined.
Using POP
msgchk will normally check all the local mail drops, but if the option "pophost:" is set in the mts configuration file "mts.conf", or if
the -host hostname switch is given, msgchk will query this POP service host as to the status of mail waiting.
The default is for msgchk to assume that your account name on the POP server is the same as your current username. To specify a different
username, use the `-user username' switch.
When using POP, you will normally need to type the password for your account on the POP server, in order to retrieve your messages. It is
possible to automate this process by creating a ".netrc" file containing your login account information for this POP server. For each POP
server, this file should have a line of the following form. Replace the words mypopserver, mylogin, and mypassword with your own account
information.
machine mypopserver login mylogin password mypassword
This ".netrc" file should be owned and readable only by you.
For debugging purposes, there is also a switch -snoop, which will allow you to watch the POP transaction take place between you and the POP
server.
If nmh has been compiled with SASL support, the -sasl switch will enable the use of SASL authentication. Depending on the SASL mechanism
used, this may require an additional password prompt from the user (but the ".netrc" file can be used to store this password). The
-saslmech switch can be used to select a particular SASL mechanism.
If SASL authentication is successful, inc will attempt to negotiate a security layer for session encryption. Encrypted traffic is labelled
with `(encrypted)' and `(decrypted)' when viewing the POP transaction with the -snoop switch.
FILES
$HOME/.mh_profile The user profile
/etc/nmh/mts.conf nmh mts configuration file
/var/mail/$USER Location of mail drop
PROFILE COMPONENTS
None
SEE ALSO inc(1)DEFAULTS
`user' defaults to the current user
`-date'
`-notify all'
CONTEXT
None
MH.6.8 11 June 2012 MSGCHK(1)