From nobody@FreeBSD.org  Wed Sep  4 06:02:59 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 348227E0
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  4 Sep 2013 06:02:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 22F912303
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  4 Sep 2013 06:02:59 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r8462wIK029628
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 4 Sep 2013 06:02:58 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r8462w6Q029608;
	Wed, 4 Sep 2013 06:02:58 GMT
	(envelope-from nobody)
Message-Id: <201309040602.r8462w6Q029608@oldred.freebsd.org>
Date: Wed, 4 Sep 2013 06:02:58 GMT
From: Karl Pielorz <kpielorz@tdx.co.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Periodic daily/500.queuerun doesn't check 'sendmail_enable' in rc.conf
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         181795
>Category:       misc
>Synopsis:       Periodic daily/500.queuerun doesn't check 'sendmail_enable' in rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 04 06:10:01 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Karl Pielorz
>Release:        9.2-BETA2 amd64
>Organization:
>Environment:
FreeBSD somehost.somedomain.com 9.2-BETA2 FreeBSD 9.2-BETA2 #0 r253951M: Mon Aug 12 09:39:57 BST 2013     kpielorz@somehost.somedomain.com:/sys/amd64/compile/GENERIC  amd64
>Description:
The periodic script '/etc/periodic/daily/500.queuerun' doesn't check any values from '/etc/rc.conf'.

e.g. If in '/etc/rc.conf' you set 'sendmail_enable="NONE"' - 500.queuerun will still blindly fire up sendmail to do the 'daily queue run' by default, even if your system isn't using sendmail - or worse, even if you have set 'sendmail_enable="NONE"' - and have a very large queue of mail on there, 'on hold' - having not started any sendmail queue runners.

500.queuerun will start a queue runner for you - regardless when it runs, thus draining the queues over night (which is not what you'd expect if 'sendmail_enable="NONE"' is set?)

The script does check for the presence of a sendmail executable - but not if the system has sendmail effectively 'disabled'.
>How-To-Repeat:
Set '/etc/rc.conf' so 'sendmail_enable="NONE"' - make sure no sendmail queue runner is running, and put a lot of mail on the host.

When 500.queuerun runs, it will dequeue all the mail - even though rc.conf has 'sendmail_enable="NONE"'.
>Fix:
Make '/etc/periodic/daily/500.queurun' check/honour the value of 'sendmail_enable' in /etc/rc.conf.

>Release-Note:
>Audit-Trail:
>Unformatted:
