From owner-freebsd-questions@freebsd.org Tue Sep 1 13:43:55 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 6F3B59C8FC7 for ; Tue, 1 Sep 2015 13:43:55 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from bede.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "fileserver.home.qeng-ho.org", Issuer "fileserver.home.qeng-ho.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EC2B31918 for ; Tue, 1 Sep 2015 13:43:54 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.home.qeng-ho.org (8.15.2/8.15.2) with ESMTP id t81Dhk6v037729; Tue, 1 Sep 2015 14:43:46 +0100 (BST) (envelope-from freebsd@qeng-ho.org) Subject: Re: how to change daily cron emails to go to user account instead of root To: Ernie Luzar References: <55DF057F.6040205@gmail.com> <55DF0C75.5000907@qeng-ho.org> <55DF0DB3.3040400@qeng-ho.org> <55E2F727.2040804@gmail.com> <55E2FDFA.7090301@qeng-ho.org> <55E59B36.1050606@gmail.com> Cc: freebsd-questions From: Arthur Chance Message-ID: <55E5AB92.20005@qeng-ho.org> Date: Tue, 1 Sep 2015 14:43:46 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55E59B36.1050606@gmail.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: Tue, 01 Sep 2015 13:43:55 -0000 On 01/09/2015 13:33, Ernie Luzar wrote: > Руслан Бурханов wrote: >> Ernie, look: >> >> Open you rc.conf, copy string and modify flags for cron daemon: >> >> cron_flags="-j 60 -m 'YOU@MAIL'" >> >> Then, restart cron daemon (it is not necessary reboot system): >> >> /etc/rc.d/cron restart >> >> Then take a look on cron process: >> >> ps auxww | grep cron >> >> If you doing all okey, it will be something like: >> >> root 561 0.0 0.1 7984 1528 ?? Is 3:16PM 0:00.01 >> /usr/sbin/cron -j 60 -m YOU@MAIL -s >> > Thank you Руслан Бурханов for the informative reply. > I did as you said and still the cron email went to root.instead of to bob. > > I edited rc.conf and added this cron_flags="-m 'bob@mydomain'" followed > by "service cron restart" console command. > ps auxww console command showed > root 1953 0,0 0.2 10184 1940 - Is 1:05PM 0:00.30 /usr/sbin/cron -m > bob@mydomain -s > > I am running version 10.2 on the host. In the /var/log/maillog file I > can see postfix messages showing root receiving the emails. > rc.conf hostname= option value is the same as the mydomain value in the > cron_flags= option. > Looks and acts like cron is not processing the over ride destination at > daily cron security check time. > Other than this problem of over ridding the cron email destination every > thing seems to be working as one would expect. > Is this enough to declare this a bug and submit a bug report? > Can you suggest other tests I can do to help debug this problem? In the case of mail from periodic (the usual source of mail to root) there is no bug. I've already explained to you that periodic reroutes its output independent of cron's settings, and I've shown you how to deal with that. You've also had the suggestion of using aliases to ensure that any mail to root *whatever its origins* goes to some other user. Have you tried either of those techniques? -- Those who do not learn from computing history are doomed to GOTO 1