I'm running OpenSUSE 10.3 on a server with SAMBA providing file and printer services to PCs in my house (XP & Linux). I have a CRON entry starting a PERL program I wrote to backup the shared SAMBA files and other data to DVD on a weekly basis.

Currently the messages from this PERL program go to me via UNIX mail on that server. What do I need to do to get those messages sent to an Email account outside my home network? I'm not looking to put a full-function email server on this file server - I just want to get the CRON process messages sent to an Email account.

Thanks!

Dani AI

Generated

As later noted, the cron/email issue was resolved. Below is a concise checklist and practical options that explain how cron output is normally delivered off-box and what to check if similar problems appear later.

Cron delivers a job's stdout/stderr to the system mailer (it calls the sendmail-compatible interface). To have that mail arrive at an external address instead of only local UNIX mail, one of the following must be in place:

  • A working sendmail-compatible MTA configured to relay outbound mail (Postfix, Exim, etc.). Many installations prefer configuring the MTA with a relayhost (SMTP server) so mail goes out through an ISP or authenticated SMTP provider.
  • A lightweight sendmail wrapper (msmtp, nullmailer, ssmtp) configured to forward to an external SMTP server. These avoid running a full MTA and satisfy cron’s sendmail call.
  • Sending mail directly from the script using an SMTP-capable library (Perl’s Net::SMTP, for example) or by piping output to an SMTP-aware mailer.

A few practical notes and checks:

  • A simple crontab header like the following makes cron send job output to a remote address:

    MAILTO=admin@example.com
    0 3 * * 1 /path/to/backup.pl

    MAILTO only works if the system can actually deliver mail (MTA or wrapper configured).

  • Ensure the job isn’t silently discarding output (look for > /dev/null 2>&1 in the crontab).

  • Test delivery with a quick send via the local sendmail wrapper (e.g., echo test | sendmail -v user@example.com) and inspect mail logs for errors.

  • Inspect the mail queue (mailq or the MTA-specific queue tool) and system logs (/var/log/mail* or /var/log/maillog) for delivery failures. Common blockers: firewall/ISP blocking outbound port 25, missing SMTP auth/TLS requirements (Gmail and many providers require auth and TLS), or a missing sendmail binary.

For minimal setups where a full MTA is unwanted, msmtp or nullmailer configured to relay through an authenticated SMTP server is usually the simplest and most reliable solution.

Never mind! I had a brain fart. It's working now!

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.