From owner-ports-jp@jp.FreeBSD.org Fri Jun 25 09:29:13 2004
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id i5P0TDL04919;
	Fri, 25 Jun 2004 09:29:13 +0900 (JST)
	(envelope-from owner-ports-jp@jp.FreeBSD.org)
Received: from nm01omta023.dion.ne.jp (sns01-31-51.dion.ne.jp [61.117.3.73])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with SMTP/inet id i5P0TDI04914
	for <ports-jp@jp.FreeBSD.org>; Fri, 25 Jun 2004 09:29:13 +0900 (JST)
	(envelope-from info@otsune.com)
Received: from [127.0.0.1] (unknown[220.217.107.9])
	by nm01mta022.dion.ne.jp;
	Fri, 25 Jun 2004 09:29:12 +0900
Message-ID: <40DB71D8.4080506@otsune.com>
From: Masafumi Otsune <info@otsune.com>
User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616)
X-Accept-Language: ja, en-us, en
MIME-Version: 1.0
To: ports-jp@jp.FreeBSD.org
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit
Reply-To: ports-jp@jp.FreeBSD.org
Precedence: list
Date: Fri, 25 Jun 2004 09:29:12 +0900
X-Sequence: ports-jp 14824
Subject: [ports-jp 14824] New ports: qmail-ipv6
Sender: owner-ports-jp@jp.FreeBSD.org
X-Originator: info@otsune.com
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+040623

Masafumi Otsune$B$G$9!#(B

mail/qmail$B$K(Bhttp://pyon.org/fujiwara/$B$N(BIPv6 patch$B$rEv$F$F!"$D$$$G$K(B
http://www.qcc.ca/~charlesc/software/misc/qmail-1.03-qmtpc+mxps.patch
$B$rEv$F$?(Bports$B$r:n$C$F1?MQ$7$F$$$^$9!#(B

4$B%v7n$[$I1?MQ$7$FF0:n$7$F$$$k$N$G(Bsend-pr$B$KD)@o$7$F$_$h$&$+$H;W$$$^$7$?!#(B
$B$*$+$7$J$H$3$m$,L5$$$+65$($F$$$?$@$1$?$i9,$$$G$9!#(B

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	qmail-ipv6
#	qmail-ipv6/files
#	qmail-ipv6/files/patch-qmtpc-ipv6
#	qmail-ipv6/files/patch-qmail-remote
#	qmail-ipv6/Makefile
#	qmail-ipv6/distinfo
#	qmail-ipv6/pkg-descr
#
echo c - qmail-ipv6
mkdir -p qmail-ipv6 > /dev/null 2>&1
echo c - qmail-ipv6/files
mkdir -p qmail-ipv6/files > /dev/null 2>&1
echo x - qmail-ipv6/files/patch-qmtpc-ipv6
sed 's/^X//' >qmail-ipv6/files/patch-qmtpc-ipv6 << 'END-of-qmail-ipv6/files/patch-qmtpc-ipv6'
X--- orig/qmail-remote.c	Mon Nov  3 14:02:58 2003
X+++ ./qmail-remote.c	Mon Nov  3 14:11:32 2003
X@@ -1,4 +1,5 @@
X #include <sys/types.h>
X+#include <sys/stat.h>
X #include <sys/socket.h>
X #include <netinet/in.h>
X #include <arpa/inet.h>
X@@ -14,6 +15,7 @@
X #include "dns.h"
X #include "alloc.h"
X #include "quote.h"
X+#include "fmt.h"
X #include "ip.h"
X #include "ipalloc.h"
X #include "ipme.h"
X@@ -31,8 +33,8 @@
X
X #define HUGESMTPTEXT 5000
X
X-#define PORT_SMTP 25 /* silly rabbit, /etc/services is for users */
X-unsigned long port = PORT_SMTP;
X+unsigned long smtp_port = 25; /* silly rabbit, /etc/services is for users */
X+unsigned long qmtp_port = 209;
X
X GEN_ALLOC_typedef(saa,stralloc,sa,len,a)
X GEN_ALLOC_readyplus(saa,stralloc,sa,len,a,i,n,x,10,saa_readyplus)
X@@ -70,6 +72,8 @@
X Unable to switch to home directory. (#4.3.0)\n"); zerodie(); }
X void temp_control() { out("Z\
X Unable to read control files. (#4.3.0)\n"); zerodie(); }
X+void temp_proto() { out("Z\
X+recipient did not talk proper QMTP (#4.3.0)\n"); zerodie(); }
X void perm_partialline() { out("D\
X SMTP cannot transfer messages with partial final lines. (#5.6.2)\n"); zerodie(); }
X void perm_usage() { out("D\
X@@ -130,9 +134,9 @@
X   return r;
X }
X
X-char inbuf[1024];
X+char inbuf[1500];
X substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,sizeof inbuf);
X-char smtptobuf[1024];
X+char smtptobuf[1500];
X substdio smtpto = SUBSTDIO_FDBUF(safewrite,-1,smtptobuf,sizeof smtptobuf);
X char smtpfrombuf[128];
X substdio smtpfrom = SUBSTDIO_FDBUF(saferead,-1,smtpfrombuf,sizeof smtpfrombuf);
X@@ -281,6 +285,113 @@
X   quit("K"," accepted message");
X }
X
X+int qmtp_priority(int pref)
X+{
X+  if (pref < 12800) return 0;
X+  if (pref > 13055) return 0;
X+  if (pref % 16 == 1) return 1;
X+  return 0;
X+}
X+
X+void qmtp()
X+{
X+  struct stat st;
X+  unsigned long len;
X+  int len2;
X+  char *x;
X+  int i;
X+  int n;
X+  unsigned char ch;
X+  char num[FMT_ULONG];
X+  int flagallok;
X+
X+  if (fstat(0,&st) == -1) quit("Z", " unable to fstat stdin");
X+  len = st.st_size;
X+
X+  /* the following code was substantially taken from serialmail'ss serialqmtp.c */
X+  substdio_put(&smtpto,num,fmt_ulong(num,len+1));
X+  substdio_put(&smtpto,":\n",2);
X+  while (len > 0) {
X+    n = substdio_feed(&ssin);
X+    if (n <= 0) _exit(32); /* wise guy again */
X+    x = substdio_PEEK(&ssin);
X+    substdio_put(&smtpto,x,n);
X+    substdio_SEEK(&ssin,n);
X+    len -= n;
X+  }
X+  substdio_put(&smtpto,",",1);
X+
X+  len = sender.len;
X+  substdio_put(&smtpto,num,fmt_ulong(num,len));
X+  substdio_put(&smtpto,":",1);
X+  substdio_put(&smtpto,sender.s,sender.len);
X+  substdio_put(&smtpto,",",1);
X+
X+  len = 0;
X+  for (i = 0;i < reciplist.len;++i)
X+    len += fmt_ulong(num,reciplist.sa[i].len) + 1 + reciplist.sa[i].len + 1;
X+  substdio_put(&smtpto,num,fmt_ulong(num,len));
X+  substdio_put(&smtpto,":",1);
X+  for (i = 0;i < reciplist.len;++i) {
X+    substdio_put(&smtpto,num,fmt_ulong(num,reciplist.sa[i].len));
X+    substdio_put(&smtpto,":",1);
X+    substdio_put(&smtpto,reciplist.sa[i].s,reciplist.sa[i].len);
X+    substdio_put(&smtpto,",",1);
X+  }
X+  substdio_put(&smtpto,",",1);
X+  substdio_flush(&smtpto);
X+
X+  flagallok = 1;
X+
X+  for (i = 0;i < reciplist.len;++i) {
X+    len = 0;
X+    for (;;) {
X+      get(&ch);
X+      if (ch == ':') break;
X+      if (len > 200000000) temp_proto();
X+      if (ch - '0' > 9) temp_proto();
X+      len = 10 * len + (ch - '0');
X+    }
X+    if (!len) temp_proto();
X+    get(&ch); --len;
X+    if ((ch != 'Z') && (ch != 'D') && (ch != 'K')) temp_proto();
X+
X+    if (!stralloc_copyb(&smtptext,&ch,1)) temp_proto();
X+    if (!stralloc_cats(&smtptext,"qmtp: ")) temp_nomem();
X+
X+    while (len > 0) {
X+      get(&ch);
X+      --len;
X+    }
X+
X+    for (len = 0;len < smtptext.len;++len) {
X+      ch = smtptext.s[len];
X+      if ((ch < 32) || (ch > 126)) smtptext.s[len] = '?';
X+    }
X+    get(&ch);
X+    if (ch != ',') temp_proto();
X+    smtptext.s[smtptext.len-1] = '\n';
X+
X+    if (smtptext.s[0] == 'K') out("r");
X+    else if (smtptext.s[0] == 'D') {
X+      out("h");
X+      flagallok = 0;
X+    }
X+    else { /* if (smtptext.s[0] == 'Z') */
X+      out("s");
X+      flagallok = 0;
X+    }
X+    if (substdio_put(subfdoutsmall,smtptext.s+1,smtptext.len-1) == -1) temp_noconn();
X+    zero();
X+  }
X+  if (!flagallok) {
X+    out("DGiving up on ");outhost();out("\n");
X+  } else {
X+    out("KAll received okay by ");outhost();out("\n");
X+  }
X+  zerodie();
X+}
X+
X stralloc canonhost = {0};
X stralloc canonbox = {0};
X
X@@ -392,7 +503,7 @@
X   if (relayhost) {
X     i = str_chr(relayhost,':');
X     if (relayhost[i]) {
X-      scan_ulong(relayhost + i + 1,&port);
X+      scan_ulong(relayhost + i + 1,&smtp_port);
X       relayhost[i] = 0;
X     }
X     if (!stralloc_copys(&host,relayhost)) temp_nomem();
X@@ -453,7 +564,17 @@
X     smtpfd = socket(ip.ix[i].af,SOCK_STREAM,0);
X     if (smtpfd == -1) temp_oserr();
X
X-    if (timeoutconn46(smtpfd,&ip.ix[i],(unsigned int) port,timeoutconnect) == 0)
X+    if (qmtp_priority(ip.ix[i].pref)) {
X+      if (timeoutconn46(smtpfd,&ip.ix[i],(unsigned int) qmtp_port,timeoutconnect) == 0) {
X+       tcpto_err(&ip.ix[i],0);
X+       partner = ip.ix[i];
X+       qmtp(); /* does not return */
X+      }
X+      close(smtpfd);
X+      smtpfd = socket(AF_INET,SOCK_STREAM,0);
X+      if (smtpfd == -1) temp_oserr();
X+    }
X+    if (timeoutconn46(smtpfd,&ip.ix[i],(unsigned int) smtp_port,timeoutconnect)== 0)
X 	{
X       tcpto_err(&ip.ix[i],0);
X       partner = ip.ix[i];
END-of-qmail-ipv6/files/patch-qmtpc-ipv6
echo x - qmail-ipv6/files/patch-qmail-remote
sed 's/^X//' >qmail-ipv6/files/patch-qmail-remote << 'END-of-qmail-ipv6/files/patch-qmail-remote'
X--- qmail-remote.8.orig	Mon Jun 15 04:53:16 1998
X+++ qmail-remote.8	Mon Jul  7 12:54:00 2003
X@@ -1,6 +1,6 @@
X .TH qmail-remote 8
X .SH NAME
X-qmail-remote \- send mail via SMTP
X+qmail-remote \- send mail via SMTP or QMTP
X .SH SYNOPSIS
X .B qmail-remote
X .I host
X@@ -26,7 +26,11 @@
X or to a mail exchanger for
X .I host
X listed in the Domain Name System,
X-via the Simple Mail Transfer Protocol (SMTP).
X+via the Simple Mail Transfer Protocol (SMTP)
X+or Quick Mail Transfer Protocol (QMTP).
X+Choice of protocol in this version is done only using the MXPS
X+(Mail Exchanger Protocol Switch) convention; see http://cr.yp.to/im/mxps.html
X+for details.
X .I host
X can be either a fully-qualified domain name:
END-of-qmail-ipv6/files/patch-qmail-remote
echo x - qmail-ipv6/Makefile
sed 's/^X//' >qmail-ipv6/Makefile << 'END-of-qmail-ipv6/Makefile'
X# New ports collection makefile for:	qmail-ipv6
X# Date created:		2004-02-22
X# Whom:			Masafumi Otsune <info@otsune.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	qmail
XPORTVERSION=	${QMAIL_VERSION}.${IPV6_PATCH_DATE}
XCATEGORIES=	mail ipv6
XPKGNAMESUFFIX=	-ipv6
X
XPATCH_SITES+=	http://pyon.org/fujiwara/:ipv6 \
X		${MASTER_SITE_LOCAL:S/$/:localtime/}
XPATCH_SITE_SUBDIR+=	sada/:localtime
XPATCHFILES+=	qmail-${QMAIL_VERSION}-v6-${IPV6_PATCH_DATE}.diff:ipv6 \
X		qmail-date-localtime.patch:localtime
XPATCH_DIST_STRIP+=	-p1
XEXTRA_PATCHES+=	${QMAIL_PORT_PATCHDIR}/patch-aa \
X		${QMAIL_PORT_PATCHDIR}/patch-ab \
X		${QMAIL_PORT_PATCHDIR}/patch-ac \
X		${QMAIL_PORT_PATCHDIR}/patch-qmail-local.c
X
XMAINTAINER=	info@otsune.com
XCOMMENT=	A secure, reliable, efficient, simple, and fast MTA with IPv6 support
X
XCONFLICTS=	qmail \
X		qmail-ldap \
X		qmail-mysql \
X		qmail-tls \
X                qmail-smtp_auth+tls
X
XUSE_PERL5_BUILD=yes
XUSE_REINPLACE=	yes
X
X# Patches from the main qmail port are not wanted
XMAIN_QMAIL_PORT_WITH_OUTGOINGIP_PATCH_BARRIER=	yes
X#WITH_QMAILQUEUE_PATCH=yes
X
XIPV6_PATCH_DATE=	20021006
X
X# Using default from master port, i.e., /var/qmail
XPREFIX?=	${QMAIL_PORT_PREFIX}
X
X.if !defined(PRE_MK_INCLUDED)
X.include <bsd.port.pre.mk>
X.endif
X
XCFLAGS+=	-DINET6
X
XQMAIL_PORT=	${PORTSDIR}/mail/qmail
XQMAIL_PORT_PREFIX!=	cd ${QMAIL_PORT} && ${MAKE} -V PREFIX
XQMAIL_PORT_PATCHDIR!=	cd ${QMAIL_PORT} && ${MAKE} -V PATCHDIR
X
Xslaveport-post-patch: qmail-ipv6-post-patch
X
Xqmail-ipv6-post-patch:
X	${REINPLACE_CMD} -e 's/ip6.int/ip6.arpa/g' ${WRKSRC}/dns.c
X
X# Local overrides
XMASTERDIR=	${PORTSDIR}/mail/qmail
XPATCHDIR=	${.CURDIR}/files
XPKGDIR_LOCAL=	${.CURDIR}
XDESCR=		${PKGDIR_LOCAL}/pkg-descr
X#PKGMESSAGE=	${PKGDIR_LOCAL}/pkg-message
XMD5_FILE=	${PKGDIR_LOCAL}/distinfo
X
X.include "${MASTERDIR}/Makefile"
END-of-qmail-ipv6/Makefile
echo x - qmail-ipv6/distinfo
sed 's/^X//' >qmail-ipv6/distinfo << 'END-of-qmail-ipv6/distinfo'
XMD5 (qmail-1.03.tar.gz) = 622f65f982e380dbe86e6574f3abcb7c
XSIZE (qmail-1.03.tar.gz) = 220668
XMD5 (qmail-1.03-v6-20021006.diff) = 828cfdbdc8f43dd62f518dbefc5258f3
XSIZE (qmail-1.03-v6-20021006.diff) = 36418
XMD5 (qmail-date-localtime.patch) = 9858804d46e9eddb142fae35908f12cb
XSIZE (qmail-date-localtime.patch) = 2450
XMD5 (qmail-103.patch) = 9140ad2b03017145cd7963c84bb24f16
XSIZE (qmail-103.patch) = 2104
XMD5 (qmailqueue-patch) = 5a8d7a5863b0c56236af945dedd45754
XSIZE (qmailqueue-patch) = 2510
XMD5 (big-todo.103.patch) = 39b6f70f65056472ff97ab40c1dba7b4
XSIZE (big-todo.103.patch) = 5546
XMD5 (big-concurrency.patch) = 2ff58c3570870a8ff9a1d9eb9aec05a6
XSIZE (big-concurrency.patch) = 9331
XMD5 (outgoingip.patch) = 3c9277dcf5f9b4b6d3a270fb3abf7994
XSIZE (outgoingip.patch) = 6839
XMD5 (sendmail-flagf.patch) = 4e1f2d8315e7e2a5482798c9d19fac4d
XSIZE (sendmail-flagf.patch) = 863
END-of-qmail-ipv6/distinfo
echo x - qmail-ipv6/pkg-descr
sed 's/^X//' >qmail-ipv6/pkg-descr << 'END-of-qmail-ipv6/pkg-descr'
XThis ports includes IPv6 support in qmail.
XIPv6 patch from http://pyon.org/fujiwara/
XIt enables it to use simultaneously with IPv6 & "Quick Mail Transfer Protocol"
X(from http://www.qcc.ca/~charlesc/software/misc/qmail-1.03-qmtpc+mxps.patch)
END-of-qmail-ipv6/pkg-descr
exit




