Subject: bin/22981: rc.d/postfix doesn't check mailer.conf
To: None <gnats-bugs@gnats.netbsd.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-bugs
Date: 09/27/2003 20:27:52
>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 UTC 2003
>Closed-Date:
>Last-Modified:
>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:
>Unformatted: