hi all
i my cron mail are not delivering on local machine they are goign to my mail server. can any one plz help me to changeg the seeting so that all local cron mail are delivered locally insted of goign to my mail server.
i m using gentoo linux on system

thanks
Jindalarpan

Dani AI

Generated

Short answer: cron hands job output to the system sendmail binary. If that binary is a relay-only client, cron mail will be handed off to the configured SMTP relay (so it leaves the host instead of appearing in /var/mail/USER). That matches noting ssmtp is installed and pointing out ssmtp is an outgoing-only tool.

Quick checks to run locally:

which sendmail
readlink -f $(which sendmail 2>/dev/null)
ls -l $(which sendmail 2>/dev/null)
crontab -l | grep MAILTO
grep -i cron /var/log/syslog || tail -n 100 /var/log/mail.log || journalctl -t CRON -n 200

Fix options, ranked by impact/simplicity:

  • Install a local MTA (Postfix, Exim or OpenSMTPD). That provides a sendmail-compatible interface that delivers to local mail spools (/var/mail/USER). Configure the daemon to listen only on loopback (127.0.0.1) if external SMTP is not wanted.
  • If keeping an outbound relay is required, install a small local delivery agent or a proper sendmail-wrapper so cron delivers locally while other mail still relays outbound.
  • If any mail can be suppressed, change crontab entries to redirect stdout/stderr to files or set MAILTO="" in the crontab to stop sending mail.

Caution: lightweight SMTP clients like ssmtp are typically relay-only and will not perform local delivery. A full MTA must be configured carefully to avoid becoming an open relay; bind it to loopback when only local delivery is needed.

Recommended Answers

All 3 Replies

Which mail client is cron configured to use when it sends out the mail?

well have not configured cron with any of mail client but ssmtp is running there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.