From owner-freebsd-questions@freebsd.org Fri Aug 28 10:34:30 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6880F9C20AE for ; Fri, 28 Aug 2015 10:34:30 +0000 (UTC) (envelope-from bah@bananmonarki.se) Received: from feeder.usenet4all.se (1-1-1-38a.far.sth.bostream.se [82.182.32.53]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC353E4E for ; Fri, 28 Aug 2015 10:34:27 +0000 (UTC) (envelope-from bah@bananmonarki.se) Received: from kw.news4all.se (testbox.usenet4all.se [10.0.0.3]) by feeder.usenet4all.se (8.13.1/8.13.1) with ESMTP id t7SAYFNp037413; Fri, 28 Aug 2015 12:34:15 +0200 (CEST) (envelope-from bah@bananmonarki.se) Message-ID: <55E03927.9010108@bananmonarki.se> Date: Fri, 28 Aug 2015 12:34:15 +0200 From: Bernt Hansson User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Chad J. Milios" , Ernie Luzar CC: freebsd-questions@freebsd.org Subject: Re: how to change daily cron emails to go to user account instead of root References: <55DF057F.6040205@gmail.com> <21C31935-454C-4E97-8230-7059E8EAFF39@ccsys.com> In-Reply-To: <21C31935-454C-4E97-8230-7059E8EAFF39@ccsys.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2015 10:34:30 -0000 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