From oleg@core.zp.ua  Tue Jul  2 14:15:05 2002
Return-Path: <oleg@core.zp.ua>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 008A337C5E9
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  2 Jul 2002 14:13:17 -0700 (PDT)
Received: from core.zp.ua (core.zp.ua [193.108.112.7])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B161844BD2
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  2 Jul 2002 13:04:41 -0700 (PDT)
	(envelope-from oleg@core.zp.ua)
Received: from core.zp.ua (oleg@localhost [127.0.0.1])
	by core.zp.ua with ESMTP id g62K4SSa078969
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 2 Jul 2002 23:04:28 +0300 (EEST)
	(envelope-from oleg@core.zp.ua)
Received: (from oleg@localhost)
	by core.zp.ua  id g62K4RAo078968;
	 Tue, 2 Jul 2002 23:04:27 +0300 (EEST)
Message-Id: <200207022004.g62K4RAo078968@core.zp.ua>
Date: Tue, 2 Jul 2002 23:04:27 +0300 (EEST)
From: "Oleg V. Naumann" <oleg@reis.zp.ua>
Reply-To: "Oleg V. Naumann" <oleg@reis.zp.ua>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Existing rc.sendmail in -STABLE doesn't allow to load mail filters before sendmail
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         40120
>Category:       conf
>Synopsis:       Existing rc.sendmail in -STABLE doesn't allow to load mail filters before sendmail
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gshapiro
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 02 14:20:07 PDT 2002
>Closed-Date:    Sun Feb 09 10:38:41 PST 2003
>Last-Modified:  Sun Feb 09 10:38:41 PST 2003
>Originator:     Oleg V. Naumann
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
ReIS Ltd.
>Environment:
System: FreeBSD core.zp.ua 4.6-STABLE FreeBSD 4.6-STABLE #1: Sat Jun 29 10:41:35 EEST 2002 root@core.zp.ua:/usr/obj/usr/src/sys/core i386
>Description:
	I have some milter-written mail filters, which I need to load
	before sendmail. Existing /etc/rc.sendmail doesn't have any capabilities
	for this purpose. So I have patch for /etc/rc.sendmail, which allows load any
	sendmail companions from /etc/rc.sendmail.early just before sendmail.
>How-To-Repeat:
	Try to load any milter-written filters before sendmail.
>Fix:
*** /etc/rc.sendmail	Thu Jun 20 14:10:34 2002
--- rc.sendmail	Tue Jul  2 13:12:56 2002
***************
*** 54,77 ****
--- 54,103 ----
  sendmail_pidfile=${sendmail_pidfile:-/var/run/sendmail.pid}
  sendmail_mspq_pidfile=${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid}
  
+ sendmail_early="NONE"
+ 
  start_mta()
  {
  	case ${sendmail_enable} in
  	[Nn][Oo][Nn][Ee])
  		;;
  	[Yy][Ee][Ss])
+ 		if [ -r /etc/rc.sendmail.early ]; then
+ 		    sh /etc/rc.sendmail.early
+ 		fi
+ 		sendmail_early="YES"
  		echo -n ' sendmail'
  		${sendmail_program} ${sendmail_flags}
  		;;
  	*)
  		case ${sendmail_submit_enable} in
  		[Yy][Ee][Ss])
+ 			case ${sendmail_early} in
+ 			[Nn][Oo][Nn][Ee])
+ 			    if [ -r /etc/rc.sendmail.early ]; then
+ 				sh /etc/rc.sendmail.early
+ 			    fi
+ 			    sendmail_early="YES"
+ 			    ;;
+ 			*)
+ 			    ;;
+ 			esac
  			echo -n ' sendmail-submit'
  			${sendmail_program} ${sendmail_submit_flags}
  			;;
  		*)
  			case ${sendmail_outbound_enable} in
  			[Yy][Ee][Ss])
+ 			    case ${sendmail_early} in
+ 			    [Nn][Oo][Nn][Ee])
+ 				    if [ -r /etc/rc.sendmail.early ]; then
+ 					sh /etc/rc.sendmail.early
+ 				    fi
+ 				    sendmail_early="YES"
+ 				    ;;
+ 				*)
+ 				    ;;
+ 				esac
  				echo -n ' sendmail-outbound'
  				${sendmail_program} ${sendmail_outbound_flags}
  				;;


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gshapiro 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Sat Jul 6 01:05:18 PDT 2002 
Responsible-Changed-Why:  

Over to Mr. Sendmail. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40120 
State-Changed-From-To: open->feedback 
State-Changed-By: gshapiro 
State-Changed-When: Sat Feb 8 15:04:19 PST 2003 
State-Changed-Why:  
Your method could break post-boot rc.sendmail calls (e.g., using 
`/etc/rc.sendmail restart` would run rc.sendmail.early every time). 

Instead, I suggest putting this in your /etc/rc.conf: 

mta_start_script="/etc/rc.mta"		# (or pick a different name) 

Then create /etc/rc.mta which starts your filters and at the end, runs 
/etc/rc.sendmail to start sendmail. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=40120 
State-Changed-From-To: feedback->closed 
State-Changed-By: gshapiro 
State-Changed-When: Sun Feb 9 10:38:26 PST 2003 
State-Changed-Why:  
Submitter accepted solution. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40120 
>Unformatted:
