Author Topic: Cron root mail  (Read 346 times)

Offline adizero

  • Member
  • **
  • Posts: 259
Cron root mail
« on: May 31, 2016, 10:11:43 AM »
Mga bro

Problem  we keep receiving this additional email  bukod sa email na dapat namin ma receive

Nilagay namin ung script sa loob ng /etc/cron.d and will run every hour

Narereceived naman namin ung email na dapat namin ma receive pero. Nakakarecosve din kami ng email from root below.  Paano namin maalis ito extra email from cron?

Kapag test mail using mutt -s etc.   Wala naman extra mail.   Nagkakaroon lang ng email below kapag nagrun thru cron

Napansin namin automatic nagkakaroon ng /etc/cron.d/sendmail kahit burahin namin
Ubuntu
Gmail mail relay using ssmtp



Subject: Cron <smmsp@AP00160> test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp

/usr/share/sendmail/sendmail: 899: /usr/share/sendmail/sendmail: /usr/sbin/sendmail-msp: not found

Online jeremypv

  • Member
  • **
  • Posts: 914
    • jeremypv.net
Re: Cron root mail
« Reply #1 on: May 31, 2016, 10:27:56 AM »
The way the default cron notification works is that it sends an email to a default configured email whenever an 'output' (either stdout or stderr) is generated, if you don't want this, you can do two things

1. disable the default mailer (e.g. check configuration, or set the MAILTO variable)
2. make sure that the cron jobs will not generate any output (e.g. redirect all output to /dev/null)
jeremypv

Offline adizero

  • Member
  • **
  • Posts: 259
Re: Cron root mail
« Reply #2 on: June 03, 2016, 09:57:30 AM »

thanks    jeremypv.

we found the solution.  since we are using ssmtp.   we just uninstall the sendmail using apt-get purge

Offline splerdu

  • Veterans
  • Member
  • ***
  • Posts: 7015
Re: Cron root mail
« Reply #3 on: June 04, 2016, 12:56:44 AM »
lol why not just set MAILTO="" in /etc/crontab?
now your cron is probably dumping mail failure warnings in /var/log/syslog
fhtagn