NetBSD Problem Report #22981
Received: (qmail 7564 invoked by uid 605); 28 Sep 2003 00:27:55 -0000
Message-Id: <200309280027.h8S0RqG13047@lowden.schemamania.org>
Date: Sat, 27 Sep 2003 20:27:52 -0400 (EDT)
From: "James K. Lowden" <jklowden@schemamania.org>
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: jklowden@schemamania.org
To: gnats-bugs@gnats.netbsd.org
Subject: rc.d/postfix doesn't check mailer.conf
X-Send-Pr-Version: 3.95
>Number: 22981
>Category: bin
>Synopsis: postfix docs and rc.d script don't mailer.conf(5)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Sep 28 00:28:00 +0000 2003
>Closed-Date:
>Last-Modified: Fri Oct 06 23:02:59 +0000 2006
>Originator: James K. Lowden
>Release: 1.6.1
>Organization:
personal person
>Environment:
System: NetBSD home.equatejobs.com 1.6.1 NetBSD 1.6.1 (GENERIC) #0:
Tue Apr 8 12:05:52 UTC 2003
autobuild@tgm.daemon.org:/autobuild/netbsd-1-6/i386/OBJ/
autobuild/netbsd-1-6/src/sys/arch/i386/compile/GENERIC i386
>Description:
The postfix docs, taken straight from the postfix distribution,
don't mention NetBSD's /etc/mailer.conf. It's easy to set up
postfix by following the documentation, and fairly intuitive to
set "postfix=YES" in rc.conf. Postfix will then start and run,
without compliant but sendmail(8) will still invoke
/usr/libexec/sendmail/sendmail. Likewise, mailq(8) will check
sendmail's queue, not invoke "postqueue -p".
http://mail-index.netbsd.org/tech-userlevel/2003/09/24/0003.html
>How-To-Repeat:
Configure /etc/postfix/alias.db to send root's mail somewhere
undeliverable. Wait for cron to run /etc/daily. Use mailq to
see the undelivered mail. Attempt to flush with postqueue.
Remain puzzled for at least one afternoon.
>Fix:
IMO NetBSD should maintain a patch that adds mailer.conf(5) under
FILES on the postfix man page. In addition, here is a patch to
/etc/rc.d/postfix that issues a warning if postfix is started
while mailer.conf doesn't refer to postfix.
--- rc.d/postfix-orig Sun Oct 1 21:09:25 2000
+++ rc.d/postfix Sat Sep 27 19:33:52 2003
@@ -20,5 +20,13 @@
reload_cmd="postfix reload"
extra_commands="reload"
+if [ "$1" = "start" ]
+then
+ grep /postfix/ /etc/mailer.conf >/dev/null || \
+ (MSG="$0: postfix started, but /etc/mailer.conf doesn't point to it. See mailer.conf(5)."; \
+ logger $MSG; \
+ echo $MSG )
+fi
+
load_rc_config $name
run_rc_command "$1"
>Release-Note:
>Audit-Trail:
From: "Jeremy C. Reed" <reed@reedmedia.net>
To: "James K. Lowden" <jklowden@schemamania.org>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/22981: rc.d/postfix doesn't check mailer.conf
Date: Sat, 27 Sep 2003 17:34:59 -0700 (PDT)
"pkg_info -D postfix" should already remind the admin this.
(Your ideas seem excellent to me too.)
Jeremy C. Reed
http://www.reedmedia.net/
From: Robert Elz <kre@munnari.OZ.AU>
To: jklowden@schemamania.org
Cc: gnats-bugs@gnats.netbsd.org, source-changes@netbsd.org
Subject: Re: bin/22981: rc.d/postfix doesn't check mailer.conf
Date: Mon, 29 Sep 2003 04:58:52 +0700
Date: Sat, 27 Sep 2003 20:27:52 -0400 (EDT)
From: "James K. Lowden" <jklowden@schemamania.org>
Message-ID: <200309280027.h8S0RqG13047@lowden.schemamania.org>
| +if [ "$1" = "start" ]
| +then
| + grep /postfix/ /etc/mailer.conf >/dev/null || \
| + (MSG="$0: postfix started, but /etc/mailer.conf doesn't point to it. See mailer.conf(5)."; \
| + logger $MSG; \
| + echo $MSG )
| +fi
| +
If you want to do this, which is probably a reasonable thing to do,
you probably also want to make sure that you're not finding the magic
string in a comment line.
So, perhaps make it be
egrep '^[^#]*/postfix/' /etc/mailer.conf
It could also be a reasonable idea to use the -c option, and check
that there is more than one (probably at least about 3 or 4) postscript
lines in there before starting - or better check that at least the
"sendmail" line is there
grep '^sendmail.*/postscript/'
There's also no real need for a subshell there, use { } for grouping
instead of ( ) and start it on the same line as the || and avoid the \
(the other two \'s aren't needed in any case).
kre
State-Changed-From-To: open->closed
State-Changed-By: elad@netbsd.org
State-Changed-When: Fri, 06 Oct 2006 22:49:04 +0000
State-Changed-Why:
postfix is now the default and only mailer in base
State-Changed-From-To: closed->open
State-Changed-By: elad@netbsd.org
State-Changed-When: Fri, 06 Oct 2006 23:02:59 +0000
State-Changed-Why:
jnemeth@ wants to fix up docs
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.