Subject: Re: smtpfeed & mailer.conf [was: Re: CVS commit: pkgsrc]
To: None <>
From: None <>
List: tech-pkg
Date: 12/28/1999 13:49:08
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <>
Content-Transfer-Encoding: 7bit

>>	smtpfeed wants sendmail with specific patch, so this is a bit
>>	separate problem - pkgsrc/mail/smtpfeed needs to build sendmail
>>	anyways (or make it depend to pkgsrc/mail/wide-patched-sendmail).
>	oops, we already have mail/sendmail...
>	I'll be making mail/wide-sendmail for use with smtpfeed (and IPv6).

	The patch creates mail/wide-sendmail from mail/sendmail.
	Is it better to unify it into mail/sendmail, or should we maintain it
	separately?  For reference documents for WIDE extension is attached.

	Note: most of WIDE changes are imported into sendmail 8.10.


------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <>
Content-Transfer-Encoding: 7bit

diff -cr -x CVS -N sendmail/Makefile wide-sendmail/Makefile
*** sendmail/Makefile	Sat Dec 25 18:20:44 1999
--- wide-sendmail/Makefile	Mon Dec 27 20:42:19 1999
*** 1,10 ****
  # $NetBSD: Makefile,v 1.10 1999/12/01 21:55:12 tron Exp $
  DISTNAME=	sendmail.8.9.3
! PKGNAME=	sendmail-8.9.3
--- 1,18 ----
  # $NetBSD: Makefile,v 1.10 1999/12/01 21:55:12 tron Exp $
  DISTNAME=	sendmail.8.9.3
! PKGNAME=	wide-sendmail-8.9.3
! \
! PATCHFILES=	sendmail893+3.2W.patch.gz
! .if !(defined(PATCH_DEBUG) || defined(PKG_VERBOSE))
! PATCH_DIST_ARGS+=--forward --quiet
! .endif
*** 17,26 ****
  OBJDIR!=	echo obj.`uname -srm | tr \  .`
  .include "../../mk/"
  USE_DB2?=	NO
  .if ${USE_DB2} == YES
--- 25,40 ----
  OBJDIR!=	echo obj.`uname -srm | tr \  .`
! WRKSRC=		${WRKDIR}/${PKGNAME:S/wide-//}
  .include "../../mk/"
+ .if defined(USE_INET6) && ${USE_INET6} == YES
+ MAKE_ENV+=	CONFIG="-f ${WRKSRC}/site.config-v6"
+ .endif
  USE_DB2?=	NO
  .if ${USE_DB2} == YES
*** 31,36 ****
--- 45,55 ----
+ .endif
+ post-patch:
+ .if defined(USE_INET6) && ${USE_INET6} == YES
+ 	@(cp ${FILESDIR}/site.config-v6 ${WRKSRC})
diff -cr -x CVS -N sendmail/files/md5 wide-sendmail/files/md5
*** sendmail/files/md5	Thu Apr  8 16:00:33 1999
--- wide-sendmail/files/md5	Mon Dec 27 20:29:01 1999
*** 1,3 ****
! $NetBSD: md5,v 1999/04/08 23:00:33 tron Exp $
  MD5 (sendmail.8.9.3.tar.gz) = efedacfbce84a71d1cfb0e617b84596e
--- 1,4 ----
! $NetBSD$
  MD5 (sendmail.8.9.3.tar.gz) = efedacfbce84a71d1cfb0e617b84596e
+ MD5 (sendmail893+3.2W.patch.gz) = 77e2183c40e304a2b1410a5bb041cd46
diff -cr -x CVS -N sendmail/files/site.config-v6 wide-sendmail/files/site.config-v6
*** sendmail/files/site.config-v6	Wed Dec 31 16:00:00 1969
--- wide-sendmail/files/site.config-v6	Mon Dec 27 20:35:44 1999
*** 0 ****
--- 1 ----

------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <>
Content-Transfer-Encoding: 7bit

            Patch kit for R8 sendmail (3.2W) by WIDE Project
							  Motonori NAKAMURA
							       WIDE Project


This patch-kit provides some enhancement for the sendmail. Please apply
this patch if you want to use "smtpfeed", which is an external SMTP mailer.

Current original sendmail includes many features, especially for Japanese
workstations, which had been offered with patch kit 2.xW by WIDE Project.
Many normal workstations (non-mail-servers), therefore, will not need
features offered by this patch-kit. Be sure on features offered by
this patch-kit if you apply it to the sendmail.


Each features are enabled/disabled with the following flags in conf.h.

	Configuration information of sendmail at compile time (generated
	by will be logged with syslog when deamon sendmail
	is started.

	When sendmail is executed with -odq switch from rmail program,
	bounce mails will also be queued. If feature is enabled, bounce
	mails will not be queued and sent immediately (not well tested).

	This feature allows multiple description of the triple in a rule
	for mailer dispatching in ruleset 0 or its sub-rulesets like:
		R$*<@dom>$*	$#smtp$@dom$:$1<@dom>$2 $#uucp$@dom$:$1<@dom>$2
	The above rule will try smtp mailer at first and then try uucp
	mailer if smtp mailer fails.
	Lower number limit of recipients can be defined at *= equate
	in definition line of a mailer which will be used at first.
	If number of recipients is less than the value defined at *=
	equate, first mailer will be skipped without trial.
	Message size limitation defined by M= equate will also be treated
	like the above -- if size of message is larger than the value
	defined, first mailer will be skipped without trial.
	If there is a flag '!' in F= equate, the mailer will be skipped
	when queue processing (in case following mailer is found).
	If there is a flag '-' in F= equate, the following mailer will
	not be used when the mailer (having '-' flag) is tried and
	failed with TEMPFAIL response code.

	This feature supplies "aliasing" in ruleset 5 (ruleset 5 is
	applied after aliases expansuin).
	The following rule will forward messages for user-a to multiple
	recipients, user-a and user-b. In other words, this feature
	provides aliasing by rules of the
		R user-a	$# local $@ alias $: user-a, user-b
	A mailer specified at $# must have 'l' in F= equate (local mailer).
	host portion specified at $@ must be 'alias'.
	You can specify multiple addresses separated with ',' at $:

	Number of recipients passed in a SMTP transaction is limited by
	size of tobuf[] (TOBUFSIZE) with current implementation of the
	sendmail(tobuf[] is used for logging recipients to syslog).
	The DYNAMIC_TOBUF feature uses dynamic allocation technique
	to relax this limitation so that a SMTP transaction not be
	splited into many small transactions which takes long time to
	finish a sequence of deliveries in case the message has many
	recipients on an identical host. Default of the maximum number
	of recipients which can be passed at a time is 100 since it is
	limited up to 100 by RFC821. But you can change the value par
	mailer using &= equate in mailer definition lines.

	Mailer preference can be defined in configuration file to determine
	order of mailers to be executed. If a message which has multiple
	recipients will be delivered with multiple mailers, order of mailers
	is determined by preference values. For example, if you define 10
	for local mailer and 20 for smtp mailer, delivery with local mailer
	will be done first and then smtp mailer will be used. Preference
	values can be defined at %= equate on mailer definition lines.
	Lower values are more preferred like MX RRs. Default value is 0
	in case %= equate is missing. Negative values can be specified.
	If there is a flag '%' in F= equate of a mailer definition,
	list of destination addresses for the mailer will be sorted by
	domain part. This feature will be effective if number of recipients
	to be processed in one transaction is limited with &= equate.

	3 parameters of client-side SMTP connection can be configured.
	Parameters are:
		FQDN: FQDN used as a hostname with SMTP HELO
		SrcIPaddr: source IP address for client-side SMTP (
		SrcPort: source port number for client-side SMTP
	Define these parameters at @= equate on IPC mailer definition lines
	Default value will be used if a parameter omitted.
	When a '@' is specified at FQDN part, a hostname which is resolved
	from source IP address of SMTP connection dynamically is used.
	If any hostname can not be obtained with DNS or etc., [IP.addres]
	notation will be used.
	When a '@' is specified at SrcIPaddr part, an IP address associated
	with FQDN will be used. If multiple IP addresses are defined for the
	FQDN, the first found address will be used.

	Manage incorrect "Content-Transfer-Encoding: 8bit" header label
	(having such a header without 8bit data in message body).
	To enable this feature, CTE8BitCheck option should be defined in
	configuration file.
		O CTE8BitCheck=correct	(correct CTE label to "7bit")
		O CTE8BitCheck=reject	(reject such messages)

	Show reason of permanent fatal errors on each address reported
	in bounced message.

	Set NULL sender envelope address (<>) on messages delivered to
	the alias entry "owner-owner" to avoid loops.

	Even if recipient list of a message includes multiple identical
	address, only one copy of the message will be sent to the address.
	If you define MF_SEPARATE and set flag '+' to a mailer, the
	address will not be unified and equal number of copies will be
	sent to the address.

	Traditional class-macro matching in sendmail is just a tokenized
	character string pattern matching. But this type of matching does
	not support masked IP address matching, so you must list up every
	host addresses as elements of a class. It is complicated especially
	for IP address authentication in check_* rulesets.
	If you define MASKED_ADDR, masked IP address matching feature can
	be used. For example, if you describe the following lines in your, an IP address between and
	will be matched to $=C in a rule.


	Note that you must include the keyword _MASKED_ADDRESS_MATCH_ to
	a class to enable masked IP address matching for the class.

	If you define MASKED_ADDR, maskedaddr map is also enabled.
	For example, if you create a map file /etc/ with
	the following content:		OK

	and describe the following lines in your, an IP
	address between and will match to
	the entry in the map file, and the address pattern will be
	changed to "OK".

		Kma maskedaddr -t /etc/

		R $-.$-.$-.$-	$: $( ma $1.$2.$3.$4 $)

	This map file is not DB style but TEXT style, so the file will
	be open and read at every matching processing. If you set option
	-t as avobe example, the file will be read only once at startup
	time of sendmail. In this case, you must restart sendmail when
	you modified the map file.

	Enables "define" map. If you describe as follows in your
	file, content of $1 will be defined to macro ${Macro} dynamically.
	/dev/null is just a dummy.

		Kdef define /dev/null

		R $*		$: $(def $1 $@ {Macro} $)

	This feature supplies connection-caching control par mailer basis.
	You can use mailer flag ';' at F= equate of mailer definition.
	If your set the mailer flag ';', connection-caching feature for
	the mailer is disabled.

	This feature supplies privilege control on execution of programs
	via ~/.forward file. With this feature, only users defined in
	class macro 'f' can execute programs via ~/.forward. To enable
	this feature you must also define a character '@' in the class
	macro 'f', or every users can execute programs via ~/.forward.

	With this feature, you can control message timeout (how long
	an unsent message will be kept in the mqueue) par mailer basis.
	To specify timeout value for a mailer, use ?= equate like:
		Msmtp ...., ?=7d,....

	This enables a feature to control whether a queue-warning
	(unsent yet, but still trying) notification should be sent to
	sender or not. For decision, envelope sender address is processed
	with "check_warning" ruleset and if it reaches to an error mailer,
	a notification will be sent. Of course, notifications to messages
	whose value in Precedence: header field is negative or envelope
	sender address is <> are not sent as before. If "check_warning"
	ruleset is not defined, notifications are sent as before.
	An example of check_warning ruleset:
		R $* - request@$*	$@ OK
		R $* - ctl@$*		$@ OK
		R owner - $*@$*		$@ OK
		R $* @ mydomain		$#error$:warning
		R $*			$@ OK
	Note: in check_warning ruleset, character '-' is also treated as
	an OperaterChar. But it should be surrounded by spaces.


Development of this patch-kit has been supported by WIDE Project, Kyoto
University, Ritsumeikan University, TDI Co., Ltd., and many contributors.

------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <>
Content-Transfer-Encoding: 7bit

IPv6 (IPv4/IPv6 dual-stack) support for sendmail 8.9.x

* How to compile

	1. Create sendmail-8.9.x/BuildTools/Site/site.config.m4 file

	   There are 2 sample files included:
		site.config-v6.kame -- for KAME (
		site.config-v6.v6d  -- for IPv6 daemon

	   If you do not want to place site.config.m4 file in BuildTools/Site/
	   directory, specify site.config.m4 file with -f switch after
	   "sh Build" like "sh Build -f site.config.m4" at the next step.

	2. Type "sh Build"

	   If you want to edit generated Makefile in obj.*/ before
	   compilation, type "sh Build nocompile" just to generate it,
	   edit it and type "sh Build" again (or type "make" in obj.*/). 

	3. Prepare /etc/

	   Patched sendmail will read /etc/ just for
	   separation from IPv4 version.

* How to start as a daemon which accepts IPv6 connection

	There are some ways to start a daemon sendmail with a IPv6 socket:
	 a) Type "/path/sendmail6 -bd"
	 b) Type "/path/sendmail -bd6"
	 c) Describe "O DaemonPortOptions=Family=inet6" in
	    and just type "/path/sendmail -bd"

	Patched sendmail can listen with multiple daemon sockets in a process.
	Family/address/port for a daemon socket can be defined with
	DaemonPortOptions option. One option line corresponds to one daemon
	socket. If your plathome has separated port spaces for IPv4 and IPv6,
	and you must prepare IPv4 socket and IPv6 socket for accept connection
	over both protocols, you can describe as follows in
		O DaemonPortOptions=Family=inet
		O DaemonPortOptions=Family=inet6

	If you describe as follows, connections only to specified address
	can be accepted:

		O DaemonPortOptions=Family=inet,Address=
		O DaemonPortOptions=Family=inet,Address=
		O DaemonPortOptions=Family=inet6,Address=::1
		O DaemonPortOptions=Family=inet6,Address=3ffe::1

* How to utilize new macro ${family} in your file

	If SMTP connection is made over inet6 protocol, a string "IPv6"
	is stored in a new macro ${family}. If SMTP connection is made
	over inet(4) family, a string "IPv4" is stored in it.
	You can refer value of ${family} in your file.

	Example 1: you can record used protocol family on Received:
	           header line with the following definition:

	HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
		$.by $j ($v/$Z)$?r with $r$.$?{family}/${family}$. id $i$?u
		for $u; $|;                 ^^^^^^^^^^^^^^^^^^^^^^
		(envelope-from $g)$.

	Example 2: You can switch rules to parse IP address in check_* like
		   as follows:

		R $*			$: $&{family} $| $1
		R IPv4 $| $*		$: $>Check_v4 $1
		R IPv6 $| $*		$: $>Check_v6 $1
		R $* $| $*		$: $>Check_others $1

* Other changes to support IPv6

	IPv6 addressing supported by @= equate like:
	Traditional IPv4 style @=FQDN/SrcIPaddr/SrcPort will be treated
	as same as @=inet:FQDN/SrcIPaddr/SrcPort.

	IPv6 notation like 3ffe:501::1 also supported.


- Motonori Nakamura <>

------- =_aaaaaaaaaa0--