1748181 Members
3498 Online
108759 Solutions
New Discussion юеВ

Cron is sending mail.

 
vinu1
New Member

Cron is sending mail.

My sendmail service is stopped and cron sends mail, those mail get queued up in clientmqueue directory. I want to stop cron from sending mails. All jobs run under root. And cron sends mail to root. I have tried to set MAILTO="", but its not working. Is there any other way to stop mails from cron to root? Thanks in advance.
7 REPLIES 7
Johnson Punniyalingam
Honored Contributor

Re: Cron is sending mail.

can you check from root crontab "any entry" for sendmail ?

you can comment that line.

HTH,

Regards,
Johnson
Problems are common to all, but attitude makes the difference
vinu1
New Member

Re: Cron is sending mail.

Hi, I have checked there is no entry in crontab file regarding sendmail. There are variabels like path, shell, mailto etc. and scheduled jobs like cron.dailly, cron.weekly etc.

Vinu
Aneesh Mohan
Honored Contributor

Re: Cron is sending mail.

vinu1
New Member

Re: Cron is sending mail.

Hi Aneesh,
I have tried that, but its not working,
and my /etc/crontab looks as :

MAILTO=""
01 * * * * root run-parts /etc/cron.hourly >> /var/log/cron 1 <&2
etc.

And I dont want mails from cron. What should i do?

Thanks
Vinu

Aneesh Mohan
Honored Contributor

Re: Cron is sending mail.

Hi,

can you change the entry in crontab like below and let me know

01 * * * * root run-parts /etc/cron.hourly >> /var/log/cron 2>&1


Aneesh
Tingli
Esteemed Contributor

Re: Cron is sending mail.

Try
01 * * * * root run-parts /etc/cron.hourly > /dev/null 2>>&1
Dennis Handly
Acclaimed Contributor

Re: Cron is sending mail.

>Is there any other way to stop mails from cron to root?

By redirecting stdout and stderr in root's crontab, for each entry, either to a file or /dev/null.
Or for each script, do it inside.

>MAILTO=""

This doesn't exist for HP-UX.

>Aneesh: Please see the below thread.

That's Linux only.