[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: crontab mails to external smtp host



Steven wrote:
> I manage several Debian servers (etch and squeeze), not related to one
> another, and they all have some crontab jobs scheduled such as backup
> scripts. When these cronjobs are run, the output is e-mailed to the
> local admin account on the system. Is it possible to configure these
> e-mails to be delivered to an external address over an external SMTP
> server instead of locally?

You can set up an alias for root in /etc/aliases to point to another
host.  Then all email to root will forward to the other address.

  root: root@other.example.com

Normally after changing the aliases file you need to run 'newaliases'
to rebuild the cache file.  But I think exim does not need this.

Alternatively if you only want to change the crontab output and
nothing else then Vixie Cron (the default for most GNU/Linux distros)
enables you to set the MAILTO variable.  If your system has a default
install of exim then very likely you can simply set the address.  Put
this in your crontab file and it will only affect that particular
crontab.

  MAILTO = "root@other.example.com"

> All systems where I would want to do this run Squeeze and use exim4 in a
> default configuration as none of them are e-mail servers.

But of course exim4 in a default configuration is an email server even
if you are not thinking of it that way.

The other suggestion to use nullmailer to simplify the MTA seems
reasonable to me.  I always use nullmailer for chroots.

The other suggestion to reconfigure exim to use a smarthost is
reasonable too.  But I think probably more complicated than you need
to do for what you are asking.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: