Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Aug 2015 12:34:15 +0200
From:      Bernt Hansson <bah@bananmonarki.se>
To:        "Chad J. Milios" <milios@ccsys.com>, Ernie Luzar <luzar722@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: how to change daily cron emails to go to user account instead of root
Message-ID:  <55E03927.9010108@bananmonarki.se>
In-Reply-To: <21C31935-454C-4E97-8230-7059E8EAFF39@ccsys.com>
References:  <55DF057F.6040205@gmail.com> <21C31935-454C-4E97-8230-7059E8EAFF39@ccsys.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2015-08-27 17:53, Chad J. Milios wrote:
> This thread has many good answers to more finely control things like periodic’s output or cron’s output or one cron entry’s output but I have not seen the simplest and most general answer.
>
> see the first few lines of /etc/mail/aliases (or if you don’t use the sendmail in base, maybe /usr/local/etc/postfix/aliases or the equivalent for your mail system):
>
> # Pretty much everything else in this file points to "root", so
> # you would do well in either reading root's mailbox or forwarding
> # root's email from here.
>
> # root: me@my.domain
>
> you uncomment that "root:" line there and obviously replace "me@my.domain" with something along the lines of "you@your.domain” to mail off-system or just “you" to redirect to a different on-system user. (root account shouldn’t be running any mail reader software that’s any more complex than `cat /var/mail/root` and even that I wouldn’t get into the habit of doing)
>
> THEN after you change that file you MUST run the `newaliases` command (or `postalias /usr/local/etc/postfix/aliases` in the case of postfix) because a database file is actually what handles lookups after it is [re-]generated from that text file.
>

Just run make install && make restart, and off you go.

> see also:
>
> man 5 aliases
> man 1 newaliases



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55E03927.9010108>