# 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: # # opensmtpd # opensmtpd/files # opensmtpd/files/patch-combined # opensmtpd/files/opensmtpd.in # opensmtpd/Makefile # opensmtpd/distinfo # opensmtpd/pkg-descr # opensmtpd/pkg-plist # echo c - opensmtpd mkdir -p opensmtpd > /dev/null 2>&1 echo c - opensmtpd/files mkdir -p opensmtpd/files > /dev/null 2>&1 echo x - opensmtpd/files/patch-combined sed 's/^X//' >opensmtpd/files/patch-combined << '7ea8a278e563f20cf4df3cd78eb1f54d' XIndex: aliases.c X=================================================================== XRCS file: /cvs/src/usr.sbin/smtpd/aliases.c,v Xretrieving revision 1.22 Xdiff -N -u aliases.c X--- aliases.c 12 Oct 2009 23:57:44 -0000 1.22 X+++ aliases.c 14 Oct 2009 16:04:33 -0000 X@@ -30,7 +30,11 @@ X #include X #include X #include X-#include X+#if defined(__FreeBSD__) X+# include X+#else X+# include X+#endif X X #include "smtpd.h" X XIndex: authenticate.c X=================================================================== XRCS file: /cvs/src/usr.sbin/smtpd/authenticate.c,v Xretrieving revision 1.1 Xdiff -N -u authenticate.c X--- authenticate.c 7 Aug 2009 19:02:55 -0000 1.1 X+++ authenticate.c 14 Oct 2009 16:04:33 -0000 X@@ -22,7 +22,12 @@ X #include X #include X X-#include X+#if defined(USE_OPENPAM) X+# include X+# include X+#else X+# include X+#endif X #include X #include X #include X@@ -37,5 +42,26 @@ X int X authenticate_user(char *username, char *password) X { X+#if defined(USE_OPENPAM) X+ static struct pam_conv conv = { &openpam_nullconv, NULL }; X+ pam_handle_t *pamh = NULL; X+ X+ if (pam_start("auth-smtp", username, &conv, &pamh) != PAM_SUCCESS) { X+ return 0; X+ } X+ X+ if (pam_set_item(pamh, PAM_AUTHTOK, password) != PAM_SUCCESS) { X+ return 0; X+ } X+ X+ if (pam_authenticate(pamh, 0) != PAM_SUCCESS) { X+ return 0; X+ } X+ X+ pam_end(pamh, PAM_SUCCESS); X+ X+ return 1; X+#else X return auth_userokay(username, NULL, "auth-smtp", password); X+#endif X } XIndex: dns.c X=================================================================== XRCS file: /cvs/src/usr.sbin/smtpd/dns.c,v Xretrieving revision 1.16 Xdiff -N -u dns.c X--- dns.c 3 Sep 2009 08:19:13 -0000 1.16 X+++ dns.c 14 Oct 2009 16:04:33 -0000 X@@ -344,7 +344,11 @@ X free_mxlist(mx0); X X if (success == 0) X+#if defined(__FreeBSD__) X+ query->error = EAI_NONAME; X+#else X query->error = EAI_NODATA; X+#endif X X end: X log_debug("lookup_mx %s", query->error ? "failed" : "success"); X@@ -504,7 +508,11 @@ X hints.ai_flags = AI_NUMERICHOST; X X if (getaddrinfo(query->host, NULL, &hints, &res) == 0) { X+#if defined(__FreeBSD__) X+ query->error = EAI_NONAME; X+#else X query->error = EAI_NODATA; X+#endif X freeaddrinfo(res); X } X end: XIndex: makemap.c X=================================================================== XRCS file: /cvs/src/usr.sbin/smtpd/makemap.c,v Xretrieving revision 1.21 Xdiff -N -u makemap.c X--- makemap.c 12 Oct 2009 18:19:46 -0000 1.21 X+++ makemap.c 14 Oct 2009 16:04:33 -0000 X@@ -34,7 +34,11 @@ X #include X #include X #include X-#include X+#if defined(__FreeBSD__) X+# include X+#else X+# include X+#endif X X #include "smtpd.h" X XIndex: parse.y X=================================================================== XRCS file: /cvs/src/usr.sbin/smtpd/parse.y,v Xretrieving revision 1.40 Xdiff -N -u parse.y X--- parse.y 11 Oct 2009 17:40:49 -0000 1.40 X+++ parse.y 14 Oct 2009 16:04:34 -0000 X@@ -1526,7 +1526,11 @@ X hints.ai_family = PF_UNSPEC; X hints.ai_socktype = SOCK_DGRAM; /* DUMMY */ X error = getaddrinfo(s, NULL, &hints, &res0); X+#if defined(__FreeBSD__) X+ if (error == EAI_AGAIN || error == EAI_NONAME) X+#else X if (error == EAI_AGAIN || error == EAI_NODATA || error == EAI_NONAME) X+#endif X return (0); X if (error) { X log_warnx("host_dns: could not parse \"%s\": %s", s, XIndex: smtp.c X=================================================================== XRCS file: /cvs/src/usr.sbin/smtpd/smtp.c,v Xretrieving revision 1.62 Xdiff -N -u smtp.c X--- smtp.c 18 Sep 2009 00:04:26 -0000 1.62 X+++ smtp.c 14 Oct 2009 16:04:34 -0000 X@@ -24,6 +24,10 @@ X #include X #include X X+#if defined(__FreeBSD__) X+# include X+#endif X+ X #include X #include X #include XIndex: smtpd.c X=================================================================== XRCS file: /cvs/src/usr.sbin/smtpd/smtpd.c,v Xretrieving revision 1.86 Xdiff -N -u smtpd.c X--- smtpd.c 7 Oct 2009 18:19:39 -0000 1.86 X+++ smtpd.c 14 Oct 2009 16:04:34 -0000 X@@ -1365,8 +1365,12 @@ X if (chdir(pw->pw_dir) == -1 && chdir("/") == -1) X fatal("chdir"); X X+#if defined(__FreeBSD__) X+ closefrom(STDERR_FILENO + 1); X+#else X if (closefrom(STDERR_FILENO + 1) == -1) X fatal("closefrom"); X+#endif X X /* avoid hangs by setting a 5m timeout */ X alarm(300); X@@ -1448,10 +1452,17 @@ X X bzero(&args, sizeof(args)); X X+#if defined(__FreeBSD__) X+ closefrom(STDERR_FILENO + 1); X if (setgroups(1, &pw->pw_gid) || X setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || X+ setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) { X+#else X+ if (setgroups(1, &pw->pw_gid) || X+ setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || X setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) || X closefrom(STDERR_FILENO + 1) == -1) { X+#endif X unlink(path); X _exit(1); X } XIndex: makemap/Makefile X=================================================================== XRCS file: /cvs/src/usr.sbin/smtpd/makemap/Makefile,v Xretrieving revision 1.7 Xdiff -N -u makemap/Makefile X--- makemap/Makefile 23 Mar 2009 15:14:54 -0000 1.7 X+++ makemap/Makefile 14 Oct 2009 16:04:34 -0000 X@@ -14,9 +14,15 @@ X CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes X CFLAGS+= -Wmissing-declarations X CFLAGS+= -Wshadow -Wpointer-arith -Wcast-qual X-CFLAGS+= -Wsign-compare -Wbounded X+CFLAGS+= -Wsign-compare X X SRCS= parse.y makemap.c aliases.c map.c log.c util.c X DPADD+= ${LIBUTIL} X LDADD+= -lutil X+ X+# FreeBSD-specific. X+CFLAGS+= -I/usr/local/include -D__dead= X+LDFLAGS+= -L/usr/local/lib X+LDADD+= -levent X+ X .include XIndex: smtpctl/Makefile X=================================================================== XRCS file: /cvs/src/usr.sbin/smtpd/smtpctl/Makefile,v Xretrieving revision 1.10 Xdiff -N -u smtpctl/Makefile X--- smtpctl/Makefile 15 Sep 2009 16:50:07 -0000 1.10 X+++ smtpctl/Makefile 14 Oct 2009 16:04:34 -0000 X@@ -14,11 +14,15 @@ X CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes X CFLAGS+= -Wmissing-declarations X CFLAGS+= -Wshadow -Wpointer-arith -Wcast-qual X-CFLAGS+= -Wsign-compare -Wbounded X+CFLAGS+= -Wsign-compare X CFLAGS+= -DCLIENT_NO_SSL X X SRCS= smtpctl.c parser.c buffer.c imsg.c log.c enqueue.c \ X queue_shared.c util.c client.c X LDADD+= -lutil X DPADD+= ${LIBUTIL} X+ X+# FreeBSD-specific. X+CFLAGS+= -I/usr/local/include -D__dead= X+ X .include XIndex: smtpd/Makefile X=================================================================== XRCS file: /cvs/src/usr.sbin/smtpd/smtpd/Makefile,v Xretrieving revision 1.13 Xdiff -N -u smtpd/Makefile X--- smtpd/Makefile 4 Sep 2009 11:49:23 -0000 1.13 X+++ smtpd/Makefile 14 Oct 2009 16:04:34 -0000 X@@ -16,9 +16,14 @@ X CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes X CFLAGS+= -Wmissing-declarations X CFLAGS+= -Wshadow -Wpointer-arith -Wcast-qual X-CFLAGS+= -Wsign-compare -Wbounded X+CFLAGS+= -Wsign-compare X #CFLAGS+= -Werror # during development phase (breaks some archs) X YFLAGS= X+ X+# FreeBSD-specific. X+CFLAGS+= -I/usr/local/include -DUSE_OPENPAM=1 -D__dead= X+LDFLAGS+= -L/usr/local/lib X+LDADD+= -lpam -levent X X .PATH: ${.CURDIR}/.. X 7ea8a278e563f20cf4df3cd78eb1f54d echo x - opensmtpd/files/opensmtpd.in sed 's/^X//' >opensmtpd/files/opensmtpd.in << '5a14b5501965f07bedba669aada44c3a' X#!/bin/sh X X# PROVIDE: smtpd X# REQUIRE: LOGIN X# KEYWORD: shutdown X X# Add the following lines to /etc/rc.conf to enable opensmtpd: X# X# opensmtpd_enable="YES" X# opensmtpd_flags="" X# X# See smtpd(8) for opensmtpd_flags X X. "%%RC_SUBR%%" X Xname="opensmtpd" Xrcvar=`set_rcvar` X Xextra_commands="reload" Xcommand="%%PREFIX%%/sbin/smtpd" Xrequired_files="%%PREFIX%%/etc/smtpd.conf" X Xreload_cmd="opensmtpd_reload" X Xopensmtpd_reload() { X %%PREFIX%%/sbin/smtpctl reload X} X Xload_rc_config "$name" X: ${opensmtpd_enable="NO"} X Xrun_rc_command "$1" 5a14b5501965f07bedba669aada44c3a echo x - opensmtpd/Makefile sed 's/^X//' >opensmtpd/Makefile << 'c219f4adbc1268eede6dc81df27591e7' X# New ports collection makefile for: opensmtpd X# Date created: Oct 14 2009 X# Whom: Florent Thoumie X# X# $FreeBSD$ X# X XPORTNAME= opensmtpd XSNAPSHOT= 20091014 XPORTVERSION= 0.${SNAPSHOT} XCATEGORIES= mail XMASTER_SITES= http://people.freebsd.org/~flz/distfiles/${PORTNAME}/ XDISTNAME= ${PORTNAME}-${SNAPSHOT} X XMAINTAINER= flz@FreeBSD.org XCOMMENT= Free implementation of the SMTP protocol X XLIB_DEPENDS= event-1.4.3:${PORTSDIR}/devel/libevent X X# Add the following line to UIDs. X# _smtpd:*:129:129::0:0:SMTP Daemon User:/var/empty:/usr/sbin/nologin X# Add the following line to GIDs. X# _smtpd:*:129: X XUSERS= _smtpd XGROUPS= _smtpd X XMAN5= smtpd.conf.5 XMAN8= makemap.8 newaliases.8 smtpctl.8 smtpd.8 X XMAKE_ENV= BINDIR="${PREFIX}/sbin" \ X MANDIR="${PREFIX}/man/man" X#COPTS="-I${LOCALBASE}/include -D__dead= -DUSE_OPENPAM=1" \ X XMANCOMPRESSED= yes XUSE_RC_SUBR= opensmtpd X Xpost-patch: X @${REINPLACE_CMD} -e '/^BINDIR=/d' \ X ${WRKSRC}/makemap/Makefile \ X ${WRKSRC}/smtpctl/Makefile \ X ${WRKSRC}/smtpd/Makefile X X.include c219f4adbc1268eede6dc81df27591e7 echo x - opensmtpd/distinfo sed 's/^X//' >opensmtpd/distinfo << '4467575278d73b2e61cd5f4bb0160812' XMD5 (opensmtpd-20091014.tar.gz) = a6c590946ca8a11a444b7913c28a658d XSHA256 (opensmtpd-20091014.tar.gz) = 6c86579b1cbe4931d9503c417fa4a154649b5411296aefed3ac75ba8a98e3dc2 XSIZE (opensmtpd-20091014.tar.gz) = 102457 4467575278d73b2e61cd5f4bb0160812 echo x - opensmtpd/pkg-descr sed 's/^X//' >opensmtpd/pkg-descr << 'cf06583815bbc46dbac1107de4bd5257' XBlank for now. Come back later. X XWWW: http://www.openbsd.org/ X X- Florent Thoumie Xflz@FreeBSD.org cf06583815bbc46dbac1107de4bd5257 echo x - opensmtpd/pkg-plist sed 's/^X//' >opensmtpd/pkg-plist << '3de4f1498e78c15cd2e1900abffadb20' Xsbin/makemap Xsbin/smtpctl Xsbin/smtpd 3de4f1498e78c15cd2e1900abffadb20 exit