Mail is not sent by cron daemon

Hello All,

In SunOS 10, I have some cron jobs and it is running fine but the cron job outputs are not mailing to any acount of the system.

In other OS, we have option like MAILTO variable or /dev/null to disable but in Sun I have no idea how it is disabled by default and how do I enable.
Please help me.

Thank you.

clarify these: "acount of the system"
Are you now referring to the script or he cron entry? pls be specific bro :slight_smile:

checked /var/cron/log file for errors ?

Solaris does NOT use the MAILTO variable. You can use the mail command to send E-mail output of cron jobs. For example, to mail the output of a script to a user, you can format the cron command similarly to the following (keeping everything on a single line in your crontab).

or write a to run your job and send an email, see the example in my below comment.

===========================================

SUPERVISOR="root, you@somewhere"
....
mail ${SUPERVISOR} < $LOGFILE

make your crontable looks like:

5 * * * * /path-to/yourscript >/dev/null 2>&1

ave a look at this nice cron FAQ:
Unix FAQ - Cron

What I want to say is "users of the system" i.e by default specific cron job owner should receive email or atleast the root if there is any in error in system/cron daemon.

:slight_smile: Yup.. I guessed right.. see my comments :slight_smile:

Sorrry for the confusion. I elaborate my problem as below:
If I run a script through cron then cron should send a output and error messages of the script by default to the owner of the cron job that is not working in my system.

Yes dude, that's not an issue I can see of, since this can be done within your script , by using mailx for example...

It would be helpful if cron does this job instead of configuring mail for each and every script and it is working fine in some other systems. Moreover my cron job is running in a child zone.

Yes bro, that's taken care by your script infact :slight_smile:

Hi Brother,
Cron automatically sends cron job output mail to user in other systems. I want the same in my system or atleast I would like to know how to enable since anyhow it will be useful to users.

Thank you.

Are you talking about a fresh configuration of sendmail? (you sound so.. :confused: )
BigAdmin Feature Article: Configuring Sendmail on the Solaris 9 Platform

Like any Unix and Unix-like OS, Solaris cron is sending mails to users when relevant and the default sendmail configuration is sufficient for this to work.

Are you sure you haven't disabled the sendmail service ?

# svcs -xv sendmail

After re-configuring sendmail, this problem has been solved.

Thanks to the members incredible, jlliagre & all.