mail from Cronjob

Hi,
I'm having a HP UX 11i and 11.0 . I've given the cron access to one of the user. Now he is getting mails on errors only and not on success on execution of the command. How can i make sure that the mail is sent in both the cases of success and failure. Also the mail is going to the lotus notes mailbox. Where can i change it, and sent the mail to his unix mail box only?
Thanks
Dhanish

Provide us with more information.. the command and all...

Is the mail (or mailx) command issued from crontab or command line?

Cheers!
Vishnu.

No crond I've ever seen mails on success, just failures.
You can set up the program/script/command to mail on success...

For the other issue, try reading the results of the command "man crontab"

I'm not mentioning about any specific command. I get the mail only on faliure, regardless on the command i use. Now i want to know where can i change this, like say if i want to change the failure mails to be sent to user@hostname.com rather than to user@company.com ? I was not able to find it in the man pages as well. Hope it clear this time

Do your cron entries have 2>&1 in them? If so, this is telling it to send email only on failure. Cron usually sends email on success or failure. Most people don't want the successful ones, only wanting to know when it failed. Or they just send output to a log file to look at it later (or mail the log file after the job is completed).

To change where the email goes, either set it up that the output goes to a log file and email the results after the job is done to the different user, OR you can change the alias for user@hostname to send mail to user@company.com.

Or someone can give another option -

take a look in the following places:

/etc/crontab
/etc/aliases

The following sends email to a loguser with the output from the "command".

crontab entry for the user:

          • /path/command 2>&1 | mail -s "command report rc=4?" logmaster

/etc/aliases file directing email to root at the local host:
logmaster: root@localhost

compile the aliases file with sendmail -bi