From owner-freebsd-questions@freebsd.org Thu Aug 27 16:03:12 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 19CE99C38C4 for ; Thu, 27 Aug 2015 16:03:12 +0000 (UTC) (envelope-from milios@ccsys.com) Received: from cargobay.net (cargobay.net [198.178.123.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF2581EE3 for ; Thu, 27 Aug 2015 16:03:11 +0000 (UTC) (envelope-from milios@ccsys.com) Received: from [192.168.0.2] (cblmdm72-240-160-19.buckeyecom.net [72.240.160.19]) by cargobay.net (Postfix) with ESMTPSA id 06B87D08; Thu, 27 Aug 2015 15:50:13 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: how to change daily cron emails to go to user account instead of root From: "Chad J. Milios" In-Reply-To: <55DF057F.6040205@gmail.com> Date: Thu, 27 Aug 2015 11:53:56 -0400 Cc: freebsd-questions@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <21C31935-454C-4E97-8230-7059E8EAFF39@ccsys.com> References: <55DF057F.6040205@gmail.com> To: Ernie Luzar X-Mailer: Apple Mail (2.2104) 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: Thu, 27 Aug 2015 16:03:12 -0000 This thread has many good answers to more finely control things like = periodic=E2=80=99s output or cron=E2=80=99s output or one cron entry=E2=80= =99s 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=E2=80=99t = 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=E2=80=9D= to mail off-system or just =E2=80=9Cyou" to redirect to a different = on-system user. (root account shouldn=E2=80=99t be running any mail = reader software that=E2=80=99s any more complex than `cat = /var/mail/root` and even that I wouldn=E2=80=99t 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. see also: man 5 aliases man 1 newaliases > On Aug 27, 2015, at 8:41 AM, Ernie Luzar wrote: >=20 > Hello list; >=20 > How do I change the daily cron emails to go to user account instead of = root? I don't want any cron email going to root any more. >=20 > man 5 crontab says the cron environment variable MAILTO =3D "account = user name" is way to change the cron email from the default of "root" to = the "account user name" you want. >=20 > The part that is not clear is where do I place this MAILTO environment = variable? Do I edit /etc/crontab and pace it next to the PATH variable = or maybe in /etc/periodic.conf or /etc/csh.cshrc or /boot/loader.conf? >=20 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to = "freebsd-questions-unsubscribe@freebsd.org"