pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

(mail/courie-imap) Candidate to update version 5.0.7



Module Name:	pkgsrc-wip
Committed By:	Makoto Fujiwara (mef) <makoto%ki.nu@localhost>
Pushed By:	mef
Date:		Mon Nov 9 12:56:55 2020 +0900
Changeset:	f78939b354208859322d49344cb51dc01e238ed2

Added Files:
	courier-imap/DEINSTALL
	courier-imap/DESCR
	courier-imap/Makefile
	courier-imap/PLIST
	courier-imap/distinfo
	courier-imap/files/courierimap.sh
	courier-imap/files/courierimaps.sh
	courier-imap/files/courierpop.sh
	courier-imap/files/courierpops.sh
	courier-imap/files/smf/courier-imap.sh
	courier-imap/files/smf/manifest.xml
	courier-imap/options.mk
	courier-imap/patches/patch-aa
	courier-imap/patches/patch-ad
	courier-imap/patches/patch-ae
	courier-imap/patches/patch-af
	courier-imap/patches/patch-ag
	courier-imap/patches/patch-ah
	courier-imap/patches/patch-ak
	courier-imap/patches/patch-ao

Log Message:
(mail/courie-imap) Candidate to update version 5.0.7

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f78939b354208859322d49344cb51dc01e238ed2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 courier-imap/DEINSTALL                 |  20 ++++++
 courier-imap/DESCR                     |  18 +++++
 courier-imap/Makefile                  | 103 ++++++++++++++++++++++++++++
 courier-imap/PLIST                     |  36 ++++++++++
 courier-imap/distinfo                  |  14 ++++
 courier-imap/files/courierimap.sh      |  68 ++++++++++++++++++
 courier-imap/files/courierimaps.sh     |  84 +++++++++++++++++++++++
 courier-imap/files/courierpop.sh       |  68 ++++++++++++++++++
 courier-imap/files/courierpops.sh      |  84 +++++++++++++++++++++++
 courier-imap/files/smf/courier-imap.sh | 122 +++++++++++++++++++++++++++++++++
 courier-imap/files/smf/manifest.xml    |  42 ++++++++++++
 courier-imap/options.mk                |  37 ++++++++++
 courier-imap/patches/patch-aa          |  35 ++++++++++
 courier-imap/patches/patch-ad          |  14 ++++
 courier-imap/patches/patch-ae          |  20 ++++++
 courier-imap/patches/patch-af          |  20 ++++++
 courier-imap/patches/patch-ag          |  20 ++++++
 courier-imap/patches/patch-ah          |  20 ++++++
 courier-imap/patches/patch-ak          |  28 ++++++++
 courier-imap/patches/patch-ao          |  19 +++++
 20 files changed, 872 insertions(+)

diffs:
diff --git a/courier-imap/DEINSTALL b/courier-imap/DEINSTALL
new file mode 100644
index 0000000000..7735903e02
--- /dev/null
+++ b/courier-imap/DEINSTALL
@@ -0,0 +1,20 @@
+# $NetBSD: DEINSTALL,v 1.8 2006/06/09 22:12:10 jlam Exp $
+
+case ${STAGE} in
+DEINSTALL)
+	#
+	# Note some additional files that may be created by the sysadmin
+	# that can probably be removed.
+	#
+	if ${TEST} -x ./+FILES; then
+		for file in						\
+			${PKG_SYSCONFDIR}/imapd.pem			\
+			${PKG_SYSCONFDIR}/imapd.rand			\
+			${PKG_SYSCONFDIR}/pop3d.pem			\
+			${PKG_SYSCONFDIR}/pop3d.rand
+		do
+			${ECHO} "# FILE: $file . /dev/null" >> ./+FILES
+		done
+	fi
+	;;
+esac
diff --git a/courier-imap/DESCR b/courier-imap/DESCR
new file mode 100644
index 0000000000..e79e619dd8
--- /dev/null
+++ b/courier-imap/DESCR
@@ -0,0 +1,18 @@
+Courier-IMAP is a server that provides IMAP access to maildirs. This
+IMAP server does NOT handle traditional mailbox files (/var/spool/mail,
+and derivatives), it was written for the specific purpose of providing
+IMAP access to maildirs.
+
+"Maildir" is a directory-based mail storage format originally introduced
+in the Qmail mail server, and adopted as an alternative mail storage
+format by both Exim and Postfix.  Courier-IMAP is popular on
+Qmail/Exim/Postfix sites that are configured to use maildirs.  The
+primary advantage of maildirs is that multiple applications can access
+the same maildir simultaneously without requiring any kind of locking
+whatsoever.  It is a faster and more efficient way to store mail.  It
+works particularly well over NFS, which has a long history of
+locking-related woes.
+
+This package differs from a vanilla Courier-IMAP installation in that
+the files are installed at locations that more closely correspond to
+a Courier installation.
diff --git a/courier-imap/Makefile b/courier-imap/Makefile
new file mode 100644
index 0000000000..852fb1462f
--- /dev/null
+++ b/courier-imap/Makefile
@@ -0,0 +1,103 @@
+# $NetBSD: Makefile,v 1.89 2020/08/31 18:09:54 wiz Exp $
+
+DISTNAME=	courier-imap-5.0.7
+CATEGORIES=	mail
+MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=courier/}
+EXTRACT_SUFX=	.tar.bz2
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+COMMENT=	IMAP server for access to maildir-style mailboxes
+HOMEPAGE=	https://www.courier-mta.org/imap/
+
+DEPENDS+=	courier-maildir>=0.65.0:../../mail/courier-maildir
+DEPENDS+=	couriertcpd>=0.65.0:../../net/couriertcpd
+
+USE_TOOLS+=		env gmake perl pkg-config
+USE_LANGUAGES=		c c++
+USE_LIBTOOL=		yes
+
+.include "options.mk"
+
+.include "../../mail/courier-mta/Makefile.common"
+
+CONFIGURE_ARGS+=	--datadir=${DATADIR}
+CONFIGURE_ARGS+=	--libexecdir=${LIBEXECDIR}
+CONFIGURE_ARGS+=	--with-mailuser=${REAL_ROOT_USER}
+CONFIGURE_ARGS+=	--with-piddir=${COURIER_STATEDIR}/tmp
+CONFIGURE_ARGS+=	--program-transform-name='s/\.rc$$//'
+CONFIGURE_ARGS+=	--with-notice=unicode
+CONFIGURE_ENV+=		CERTTOOL=${COURIER_CERTTOOL:Q}
+CONFIGURE_ENV+=		OPENSSL=${COURIER_OPENSSL:Q}
+
+# The rfc1035 and tcpd bits are built and installed by net/couriertcpd.
+# However, we still need to build in these directories because there
+# are some convenience libraries built and used by other parts of the
+# imap code.  We configure without IPv6 support because those necessary
+# convenience libraries don't have any IPv6 code, and we want to avoid
+# breakage due to IPv6 mis-detection.
+CONFIGURE_ARGS+=	--without-ipv6
+
+INSTALL_AM_MAKEFLAGS=	sysconfdir=${EGDIR:Q}
+INSTALL_MAKE_FLAGS=	${MAKE_FLAGS} AM_MAKEFLAGS=${INSTALL_AM_MAKEFLAGS:Q}
+
+REQD_DIRS+=		${DATADIR} ${DOCDIR} ${EGDIR} ${LIBEXECDIR}
+MAKE_DIRS+=		${COURIER_STATEDIR}
+MAKE_DIRS_PERMS+=	${COURIER_STATEDIR}/tmp				\
+			${COURIER_USER} ${COURIER_GROUP} 0770
+
+.for _file_ in		imapd.cnf imapd.dist imapd-ssl.dist		\
+			pop3d.cnf pop3d.dist pop3d-ssl.dist
+CONF_FILES_PERMS+=	${EGDIR}/${_file_}				\
+			${PKG_SYSCONFDIR}/${_file_:S/.dist$//}		\
+			${COURIER_FILE_PERMS}
+.endfor
+RCD_SCRIPTS=		courierimap courierimaps courierpop courierpops
+SMF_METHODS=		courier-imap
+
+SUBST_CLASSES+=		courier
+SUBST_FILES.courier=	libs/imap/imapd-ssl.dist.in
+SUBST_FILES.courier+=	libs/imap/imapd.8.in
+SUBST_FILES.courier+=	libs/imap/imapd.dist.in
+SUBST_FILES.courier+=	libs/imap/mkpop3dcert.html.in
+SUBST_FILES.courier+=	libs/imap/pop3d-ssl.dist.in
+SUBST_FILES.courier+=	libs/imap/pop3d.dist.in
+SUBST_FILES.courier+=	imapd-ssl.rc.in
+SUBST_FILES.courier+=	imapd.rc.in
+SUBST_FILES.courier+=	pop3d-ssl.rc.in
+SUBST_FILES.courier+=	pop3d.rc.in
+SUBST_SED.courier=	-e "s|^IMAPDSTART=.*|IMAPDSTART=YES|g"
+SUBST_SED.courier+=	-e "s|^IMAPDSSLSTART=.*|IMAPDSSLSTART=YES|g"
+SUBST_SED.courier+=	-e "s|^POP3DSTART=.*|POP3DSTART=YES|g"
+SUBST_SED.courier+=	-e "s|^POP3DSSLSTART=.*|POP3DSSLSTART=YES|g"
+SUBST_SED.courier+=	-e "s|@mydatadir@|@sysconfdir@|g"
+SUBST_SED.courier+=	-e "s|@datadir@/imapd.pem|@sysconfdir@/imapd.pem|g"
+SUBST_SED.courier+=	-e "s|@datadir@/imapd.rand|@sysconfdir@/imapd.rand|g"
+SUBST_SED.courier+=	-e "s|@datadir@/pop3d.pem|@sysconfdir@/pop3d.pem|g"
+SUBST_SED.courier+=	-e "s|@datadir@/pop3d.rand|@sysconfdir@/pop3d.rand|g"
+SUBST_SED.courier+=	-e "s|@libexecdir@/couriertcpd|@sbindir@/couriertcpd|g"
+SUBST_SED.courier+=	-e "s|@sbindir@/imaplogin|@libexecdir@/imaplogin|g"
+SUBST_SED.courier+=	-e "s|@sbindir@/pop3login|@libexecdir@/courierpop3login|g"
+SUBST_SED.courier+=	-e "s|@bindir@/pop3d|@libexecdir@/courierpop3d|g"
+SUBST_STAGE.courier=	pre-configure
+
+# configure: Cannot obtain information for user courier: Undefined error: 0
+NOT_FOR_UNPRIVILEGED=	yes
+
+.include "../../security/courier-authlib/buildlink3.mk"
+
+post-install:
+	${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR}
+	${INSTALL_DATA_DIR} ${DESTDIR}${DOCDIR}/imap
+	${INSTALL_DATA} ${WRKSRC}/imap/BUGS.html ${DESTDIR}${DOCDIR}/imap
+	${INSTALL_DATA} ${WRKSRC}/imap/README.html ${DESTDIR}${DOCDIR}/imap
+	${INSTALL_DATA} ${WRKSRC}/imap/README.proxy.html ${DESTDIR}${DOCDIR}/imap
+	${INSTALL_DATA} ${WRKSRC}/imap/courierpop3d.html ${DESTDIR}${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/imap/imapd.html ${DESTDIR}${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/imap/mkimapdcert.html ${DESTDIR}${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/imap/mkpop3dcert.html ${DESTDIR}${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/imap/imapd.pam ${DESTDIR}${EGDIR}/imap.authpam
+	${INSTALL_DATA} ${WRKSRC}/imap/pop3d.pam ${DESTDIR}${EGDIR}/pop3.authpam
+
+.include "../../devel/libidn/buildlink3.mk"
+.include "../../mail/courier-unicode/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/courier-imap/PLIST b/courier-imap/PLIST
new file mode 100644
index 0000000000..ed796372b5
--- /dev/null
+++ b/courier-imap/PLIST
@@ -0,0 +1,36 @@
+@comment $NetBSD: PLIST,v 1.19 2014/03/11 14:05:02 jperkin Exp $
+bin/imapd
+libexec/courier/courierpop3d
+libexec/courier/courierpop3login
+libexec/courier/imaplogin
+man/man8/courierimapd.8
+man/man8/courierpop3d.8
+man/man8/mkimapdcert.8
+man/man8/mkpop3dcert.8
+sbin/imapd
+sbin/imapd-ssl
+sbin/mkimapdcert
+sbin/mkpop3dcert
+sbin/pop3d
+sbin/pop3d-ssl
+share/courier/imapd-ssl.rc
+share/courier/imapd.rc
+share/courier/mkimapdcert
+share/courier/mkpop3dcert
+share/courier/pop3d-ssl.rc
+share/courier/pop3d.rc
+share/doc/courier/courierpop3d.html
+share/doc/courier/imap/BUGS.html
+share/doc/courier/imap/README.html
+share/doc/courier/imap/README.proxy.html
+share/doc/courier/imapd.html
+share/doc/courier/mkimapdcert.html
+share/doc/courier/mkpop3dcert.html
+share/examples/courier/imap.authpam
+share/examples/courier/imapd-ssl.dist
+share/examples/courier/imapd.cnf
+share/examples/courier/imapd.dist
+share/examples/courier/pop3.authpam
+share/examples/courier/pop3d-ssl.dist
+share/examples/courier/pop3d.cnf
+share/examples/courier/pop3d.dist
diff --git a/courier-imap/distinfo b/courier-imap/distinfo
new file mode 100644
index 0000000000..8da56893aa
--- /dev/null
+++ b/courier-imap/distinfo
@@ -0,0 +1,14 @@
+$NetBSD: distinfo,v 1.28 2015/11/03 23:27:02 agc Exp $
+
+SHA1 (courier-imap-5.0.7.tar.bz2) = 0bf8d32faf7eae06ac51156f7b2070957221cba8
+RMD160 (courier-imap-5.0.7.tar.bz2) = a61a792c0c86ec8ac9248c06f75b7da539206f23
+SHA512 (courier-imap-5.0.7.tar.bz2) = a0be5cb3e6bc42f4bf45b14132e7d4ad7e822c26aa3b3dd4bfefa7783a047b9c928ad503b462c8e832fddefb356af58b4adfa5ee91481bd024149992157a1aad
+Size (courier-imap-5.0.7.tar.bz2) = 3296879 bytes
+SHA1 (patch-aa) = e06c1ca95128002276130f4e298be693f779bf5b
+SHA1 (patch-ad) = 1091c9a5991c746855db7fc4d3e2e744142b2e3c
+SHA1 (patch-ae) = 9d925f4639086af9f6faecd6a2fab2a9ecab670c
+SHA1 (patch-af) = 0fa0e0bd2f1908404f866de9358c74403615967f
+SHA1 (patch-ag) = 6ddd8b3f6a2cfbab4d814b51552dbf364384cf57
+SHA1 (patch-ah) = e81da45833698ff6da23de640efc322ce34cec0d
+SHA1 (patch-ak) = 0aefdc67f825068d7dd14210519562d171990f17
+SHA1 (patch-ao) = 9a1ef6ed806920699a3c69f4f90b1c1f86f45900
diff --git a/courier-imap/files/courierimap.sh b/courier-imap/files/courierimap.sh
new file mode 100755
index 0000000000..2d05cbea63
--- /dev/null
+++ b/courier-imap/files/courierimap.sh
@@ -0,0 +1,68 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: courierimap.sh,v 1.16 2008/02/19 18:45:14 jlam Exp $
+#
+# Courier IMAP services daemon
+#
+# PROVIDE: courierimap
+# REQUIRE: authdaemond
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name="courierimap"
+rcvar=${name}
+command="@PREFIX@/sbin/couriertcpd"
+ctl_command="@PREFIX@/sbin/imapd"
+pidfile="@COURIER_STATEDIR@/tmp/imapd.pid"
+required_files="@PKG_SYSCONFDIR@/imapd @PKG_SYSCONFDIR@/imapd-ssl"
+
+start_precmd="${name}_prestart"
+start_cmd="${name}_doit start"
+stop_cmd="${name}_doit stop"
+
+mkdir_perms()
+{
+	dir="$1"; user="$2"; group="$3"; mode="$4"
+	@TEST@ -d $dir || @MKDIR@ $dir
+	@CHOWN@ $user $dir
+	@CHGRP@ $group $dir
+	@CHMOD@ $mode $dir
+}
+
+courierimap_prestart()
+{
+	mkdir_perms @COURIER_STATEDIR@/tmp \
+		@COURIER_USER@ @COURIER_GROUP@ 0770
+}
+
+courierimap_doit()
+{
+	action=$1
+	case $action in
+	start)
+		for f in $required_files; do
+			if [ ! -r "$f" ]; then
+				@ECHO@ 1>&2 "$0: WARNING: $f is not readable"
+				return 1
+			fi
+		done
+
+		. @PKG_SYSCONFDIR@/imapd
+
+		case x$IMAPDSTART in
+		x[yY]*)
+			@ECHO@ "Starting ${name}."
+			${ctl_command} $action
+                ;;
+		esac
+		;;
+	stop)
+		@ECHO@ "Stopping ${name}."
+		${ctl_command} $action
+		;;
+	esac
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/courier-imap/files/courierimaps.sh b/courier-imap/files/courierimaps.sh
new file mode 100755
index 0000000000..0e6bc84705
--- /dev/null
+++ b/courier-imap/files/courierimaps.sh
@@ -0,0 +1,84 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: courierimaps.sh,v 1.18 2008/02/19 18:45:14 jlam Exp $
+#
+# Courier IMAP/SSL services daemon
+#
+# PROVIDE: courierimaps
+# REQUIRE: authdaemond
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name="courierimaps"
+rcvar=${name}
+command="@PREFIX@/sbin/couriertcpd"
+ctl_command="@PREFIX@/sbin/imapd-ssl"
+pidfile="@COURIER_STATEDIR@/tmp/imapd-ssl.pid"
+required_files="@PKG_SYSCONFDIR@/imapd @PKG_SYSCONFDIR@/imapd-ssl"
+
+start_precmd="${name}_prestart"
+start_cmd="${name}_doit start"
+stop_cmd="${name}_doit stop"
+
+mkdir_perms()
+{
+	dir="$1"; user="$2"; group="$3"; mode="$4"
+	@TEST@ -d $dir || @MKDIR@ $dir
+	@CHOWN@ $user $dir
+	@CHGRP@ $group $dir
+	@CHMOD@ $mode $dir
+}
+
+courierimaps_prestart()
+{
+	mkdir_perms @COURIER_STATEDIR@/tmp \
+		@COURIER_USER@ @COURIER_GROUP@ 0770
+}
+
+courierimaps_doit()
+{
+	action=$1
+	case $action in
+	start)
+		for f in $required_files; do
+			if [ ! -r "$f" ]; then
+				@ECHO@ 1>&2 "$0: WARNING: $f is not readable"
+				return 1
+			fi
+		done
+
+		. @PKG_SYSCONFDIR@/imapd
+		. @PKG_SYSCONFDIR@/imapd-ssl
+
+		f="$TLS_CERTFILE"
+		if [ -z "$f" ]; then
+			@ECHO@ 1>&2 "$0: WARNING: TLS_CERTFILE is empty"
+			return 1
+		fi
+		if [ ! -f "$f" ] && \
+		   [ "$f" = "@PKG_SYSCONFDIR@/imapd.pem" ]; then
+			@ECHO@ "Generating IMAP SSL certificate in $f."
+			@PREFIX@/sbin/mkimapdcert >/dev/null 2>&1
+		fi
+		if [ ! -r "$f" ]; then
+			@ECHO@ 1>&2 "$0: WARNING: $f is not readable"
+			return 1
+		fi
+
+		case x$IMAPDSSLSTART in
+		x[yY]*)
+			@ECHO@ "Starting ${name}."
+			${ctl_command} $action
+               	;;
+		esac
+		;;
+	stop)
+		@ECHO@ "Stopping ${name}."
+		${ctl_command} $action
+		;;
+	esac
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/courier-imap/files/courierpop.sh b/courier-imap/files/courierpop.sh
new file mode 100755
index 0000000000..e7a6977572
--- /dev/null
+++ b/courier-imap/files/courierpop.sh
@@ -0,0 +1,68 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: courierpop.sh,v 1.16 2008/02/19 18:45:14 jlam Exp $
+#
+# Courier POP3 services daemon
+#
+# PROVIDE: courierpop
+# REQUIRE: authdaemond
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name="courierpop"
+rcvar=${name}
+command="@PREFIX@/sbin/couriertcpd"
+ctl_command="@PREFIX@/sbin/pop3d"
+pidfile="@COURIER_STATEDIR@/tmp/pop3d.pid"
+required_files="@PKG_SYSCONFDIR@/pop3d @PKG_SYSCONFDIR@/pop3d-ssl"
+
+start_precmd="${name}_prestart"
+start_cmd="${name}_doit start"
+stop_cmd="${name}_doit stop"
+
+mkdir_perms()
+{
+	dir="$1"; user="$2"; group="$3"; mode="$4"
+	@TEST@ -d $dir || @MKDIR@ $dir
+	@CHOWN@ $user $dir
+	@CHGRP@ $group $dir
+	@CHMOD@ $mode $dir
+}
+
+courierpop_prestart()
+{
+	mkdir_perms @COURIER_STATEDIR@/tmp \
+		@COURIER_USER@ @COURIER_GROUP@ 0770
+}
+
+courierpop_doit()
+{
+	action=$1
+	case $action in
+	start)
+		for f in $required_files; do
+			if [ ! -r "$f" ]; then
+				@ECHO@ 1>&2 "$0: WARNING: $f is not readable"
+				return 1
+			fi
+		done
+
+		. @PKG_SYSCONFDIR@/pop3d
+
+		case x$POP3DSTART in
+		x[yY]*)
+			@ECHO@ "Starting ${name}."
+			${ctl_command} $action
+                ;;
+		esac
+		;;
+	stop)
+		@ECHO@ "Stopping ${name}."
+		${ctl_command} $action
+		;;
+	esac
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/courier-imap/files/courierpops.sh b/courier-imap/files/courierpops.sh
new file mode 100755
index 0000000000..9946a3f0ec
--- /dev/null
+++ b/courier-imap/files/courierpops.sh
@@ -0,0 +1,84 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: courierpops.sh,v 1.18 2008/02/19 18:45:14 jlam Exp $
+#
+# Courier POP3/SSL services daemon
+#
+# PROVIDE: courierpops
+# REQUIRE: authdaemond
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name="courierpops"
+rcvar=${name}
+command="@PREFIX@/sbin/couriertcpd"
+ctl_command="@PREFIX@/sbin/pop3d-ssl"
+pidfile="@COURIER_STATEDIR@/tmp/pop3d-ssl.pid"
+required_files="@PKG_SYSCONFDIR@/pop3d @PKG_SYSCONFDIR@/pop3d-ssl"
+
+start_precmd="${name}_prestart"
+start_cmd="${name}_doit start"
+stop_cmd="${name}_doit stop"
+
+mkdir_perms()
+{
+	dir="$1"; user="$2"; group="$3"; mode="$4"
+	@TEST@ -d $dir || @MKDIR@ $dir
+	@CHOWN@ $user $dir
+	@CHGRP@ $group $dir
+	@CHMOD@ $mode $dir
+}
+
+courierpops_prestart()
+{
+	mkdir_perms @COURIER_STATEDIR@/tmp \
+		@COURIER_USER@ @COURIER_GROUP@ 0770
+}
+
+courierpops_doit()
+{
+	action=$1
+	case $action in
+	start)
+		for f in $required_files; do
+			if [ ! -r "$f" ]; then
+				@ECHO@ 1>&2 "$0: WARNING: $f is not readable"
+				return 1
+			fi
+		done
+
+		. @PKG_SYSCONFDIR@/pop3d
+		. @PKG_SYSCONFDIR@/pop3d-ssl
+
+		f="$TLS_CERTFILE"
+		if [ -z "$f" ]; then
+			@ECHO@ 1>&2 "$0: WARNING: TLS_CERTFILE is empty"
+			return 1
+		fi
+		if [ ! -f "$f" ] && \
+		   [ "$f" = "@PKG_SYSCONFDIR@/pop3d.pem" ]; then
+			@ECHO@ "Generating POP3 SSL certificate in $f."
+			@PREFIX@/sbin/mkpop3dcert >/dev/null 2>&1
+		fi
+		if [ ! -r "$f" ]; then
+			@ECHO@ 1>&2 "$0: WARNING: $f is not readable"
+			return 1
+		fi
+
+		case x$POP3DSSLSTART in
+		x[yY]*)
+			@ECHO@ "Starting ${name}."
+			${ctl_command} $action
+               	;;
+		esac
+		;;
+	stop)
+		@ECHO@ "Stopping ${name}."
+		${ctl_command} $action
+		;;
+	esac
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/courier-imap/files/smf/courier-imap.sh b/courier-imap/files/smf/courier-imap.sh
new file mode 100644
index 0000000000..2f4dc76717
--- /dev/null
+++ b/courier-imap/files/smf/courier-imap.sh
@@ -0,0 +1,122 @@
+#!@SMF_METHOD_SHELL@
+#
+# $NetBSD: courier-imap.sh,v 1.1 2014/03/11 14:34:38 jperkin Exp $
+#
+# Init script for Courier-IMAP.
+#
+
+. /lib/svc/share/smf_include.sh
+
+prefix=@PREFIX@
+exec_prefix=@PREFIX@
+bindir=${exec_prefix}/bin
+sbindir=${exec_prefix}/sbin
+
+case "$1" in
+start)
+        cd /
+        . $prefix/etc/courier/imapd
+
+        printf "Starting Courier-IMAP server:"
+
+        case x$IMAPDSTART in
+        x[yY]*)
+                # Start daemons.
+                $sbindir/imapd start
+                printf "\n imap"
+                ;;
+        esac
+
+        . $prefix/etc/courier/imapd-ssl
+        case x$IMAPDSSLSTART in
+        x[yY]*)
+                if test -x $COURIERTLS
+                then
+
+                # First time we start this, generate a dummy SSL certificate.
+
+                        if test ! -f $TLS_CERTFILE
+                        then
+                                printf "\n generating-SSL-certificate..."
+                                $prefix/share/courier/mkimapdcert >/dev/null 2>&1
+                        fi
+                        $sbindir/imapd-ssl start
+                        printf "\n imap-ssl"
+                fi
+                ;;
+        esac
+
+        POP3DSTART=""
+        POP3DSSLSTART=""
+
+        if test -f $prefix/etc/courier/pop3d
+        then
+                . $prefix/etc/courier/pop3d
+        fi
+
+        case x$POP3DSTART in
+        x[yY]*)
+                # Start daemons.
+                $sbindir/pop3d start
+                printf "\n pop3"
+                ;;
+        esac
+
+        if test -f $prefix/etc/courier/pop3d-ssl
+        then
+                . $prefix/etc/courier/pop3d-ssl
+        fi
+
+        case x$POP3DSSLSTART in
+        x[yY]*)
+                if test -x $COURIERTLS
+                then
+
+                # First time we start this, generate a dummy SSL certificate.
+
+                        if test ! -f $TLS_CERTFILE
+                        then
+                                printf "\n generating-SSL-certificate..."
+                                $prefix/share/courier/mkpop3dcert >/dev/null 2>&1
+                        fi
+                        $sbindir/pop3d-ssl start
+                        printf "\n pop3-ssl"
+                fi
+                ;;
+        esac
+
+        echo ""
+        ;;
+stop)
+        printf "Stopping Courier-IMAP server:"
+        . $prefix/etc/courier/imapd
+        . $prefix/etc/courier/imapd-ssl
+        $sbindir/imapd stop
+        printf "\n imap"
+        if test -x $COURIERTLS
+        then
+                $sbindir/imapd-ssl stop
+                printf "\n imap-ssl"
+        fi
+
+        if test -f $prefix/etc/courier/pop3d
+        then
+                $sbindir/pop3d stop
+                printf "\n pop3"
+
+                if test -x $COURIERTLS
+                then
+                        $sbindir/pop3d-ssl stop
+                        printf "\n pop3-ssl"
+                fi
+        fi
+
+        echo ""
+        ;;
+restart)
+        $0 stop
+        sleep 3
+        $0 start
+        ;;
+esac
+exit 0
diff --git a/courier-imap/files/smf/manifest.xml b/courier-imap/files/smf/manifest.xml
new file mode 100644
index 0000000000..7e5f02141f
--- /dev/null
+++ b/courier-imap/files/smf/manifest.xml
@@ -0,0 +1,42 @@
+<?xml version='1.0'?>
+<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
+<service_bundle type='manifest' name='export'>
+  <service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='1'>
+    <create_default_instance enabled="false" />
+    <single_instance />
+    <dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/system/filesystem/local' />
+    </dependency>
+    <dependency name='network-service' grouping='require_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/network/service' />
+    </dependency>
+    <dependency name='system-log' grouping='optional_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/system/system-log' />
+    </dependency>
+    <dependency name='config-files' grouping='require_any' restart_on='refresh' type='path'>
+      <service_fmri value='file://localhost@PKG_SYSCONFDIR@/pop3d-ssl' />
+      <service_fmri value='file://localhost@PKG_SYSCONFDIR@/pop3d' />
+      <service_fmri value='file://localhost@PKG_SYSCONFDIR@/imapd-ssl' />
+      <service_fmri value='file://localhost@PKG_SYSCONFDIR@/imapd' />
+    </dependency>
+    <dependency name='authlib' grouping='require_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/@SMF_PREFIX@/courier-authlib' />
+    </dependency>
+    <exec_method name='start' type='method' exec='@PREFIX@/@SMF_METHOD_FILE.courier-imap@ start' timeout_seconds='120' />
+    <exec_method name='stop' type='method' exec='@PREFIX@/@SMF_METHOD_FILE.courier-imap@ stop' timeout_seconds='60' />
+    <property_group name='startd' type='framework'>
+      <propval name='ignore_error' type='astring' value='core,signal' />
+    </property_group>
+    <property_group name='general' type='framework'>
+      <propval name='action_authorization' type='astring' value='solaris.smf.manage.courier-imap' />
+    </property_group>
+    <template>
+      <common_name>
+        <loctext xml:lang='C'>imap - Courier IMAP provides access to Maildirs</loctext>
+      </common_name>
+      <documentation>
+        <manpage title='imapd' section='8' manpath='@PREFIX@/@PKGMANDIR@' />
+      </documentation>
+    </template>
+  </service>
+</service_bundle>
diff --git a/courier-imap/options.mk b/courier-imap/options.mk
new file mode 100644
index 0000000000..694c547471
--- /dev/null
+++ b/courier-imap/options.mk
@@ -0,0 +1,37 @@
+# $NetBSD: options.mk,v 1.3 2018/01/10 00:19:48 rillig Exp $
+
+PKG_OPTIONS_VAR=		PKG_OPTIONS.courier-imap
+PKG_SUPPORTED_OPTIONS=		courier-gnutls fam
+PKG_SUGGESTED_OPTIONS=		# empty
+
+.include "../../mk/bsd.options.mk"
+
+###
+### Support using the GNU TLS tools for creating certificates; otherwise
+### default to using OpenSSL.
+###
+COURIER_CERTTOOL=	${PREFIX}/bin/certtool
+.if !empty(PKG_OPTIONS:Mcourier-gnutls)
+COURIER_OPENSSL=	${PREFIX}/bin/openssl
+.else
+USE_TOOLS+=		openssl:run
+COURIER_OPENSSL=	${TOOLS_OPENSSL}
+.endif
+
+SUBST_CLASSES+=		tls
+SUBST_FILES.tls=	libs/imap/mkimapdcert.in libs/imap/mkpop3dcert.in
+SUBST_STAGE.tls=	pre-configure
+.if !empty(PKG_OPTIONS:Mcourier-gnutls)
+SUBST_SED.tls=		-e "s|@ssllib@|gnutls|g"
+.else
+SUBST_SED.tls=		-e "s|@ssllib@|openssl|g"
+.endif
+
+###
+### File Alteration Monitor support.  This allows multiple imapd or pop3d
+### processes to be notified of changes to the underlying maildirs instead
+### of needing to poll the maildirs.
+###
+.if !empty(PKG_OPTIONS:Mfam)
+.  include "../../mk/fam.buildlink3.mk"
+.endif
diff --git a/courier-imap/patches/patch-aa b/courier-imap/patches/patch-aa
new file mode 100644
index 0000000000..d9c2af6f56
--- /dev/null
+++ b/courier-imap/patches/patch-aa
@@ -0,0 +1,35 @@
+$NetBSD$
+
+
+--- Makefile.in.orig	2019-03-28 08:34:40.000000000 +0900
++++ Makefile.in	2020-11-09 12:20:23.322706380 +0900
+@@ -432,9 +432,9 @@ man_MANS = couriertcpd.1 deliverquota.8 
+ EXTRA_DIST = README README.cygwin COPYING.GPL NEWS.html $(TEMPLFILES) \
+ 	pgpkeys.txt sysconftool
+ sysconf_DATA = imapd.dist imapd-ssl.dist pop3d.dist pop3d-ssl.dist \
+-	imapd.cnf pop3d.cnf quotawarnmsg.example
++	imapd.cnf pop3d.cnf
+ 
+-libexec_SCRIPTS = imapd.rc imapd-ssl.rc pop3d.rc pop3d-ssl.rc
++libexec_SCRIPTS = 
+ HTML2TXT = links -dump -no-numbering -no-references
+ 
+ # NOTE: when using a complex directory hierarchy it is only necessary to
+@@ -1454,6 +1454,9 @@ install-exec-local:
+ 	for f in mkimapdcert mkpop3dcert mkdhparams; \
+ 		do rm -f $(DESTDIR)$(sbindir)/$$f ; \
+ 		$(LN_S) $(databindir)/$$f $(DESTDIR)$(sbindir)/$$f ; done
++	for f in imapd-ssl imapd pop3d pop3d-ssl ; \
++		do rm -f $(DESTDIR)$(sbindir)/$$f ; \
++		$(LN_S) $(databindir)/$$f.rc $(DESTDIR)$(sbindir)/$$f ; done
+ 	$(mkinstalldirs) $(DESTDIR)$(localstatedir)
+ 
+ install-exec-hook:
+@@ -1480,7 +1483,6 @@ install-data-local: install-man
+ uninstall-local:
+ 	for f in mkimapdcert mkpop3dcert mkdhparams; \
+ 		do rm -f $(DESTDIR)$(sbindir)/$$f ; done
+-	rm -f $(DESTDIR)$(bindir)/couriertls
+ 
+ INSTALL.txt: INSTALL.html
+ 	$(HTML2TXT) INSTALL.html >INSTALL.txt
diff --git a/courier-imap/patches/patch-ad b/courier-imap/patches/patch-ad
new file mode 100644
index 0000000000..18fccd6147
--- /dev/null
+++ b/courier-imap/patches/patch-ad
@@ -0,0 +1,14 @@
+$NetBSD: patch-ad,v 1.11 2010/11/10 10:00:06 adam Exp $
+
+--- configure.orig	2010-10-04 11:12:59.000000000 +0000
++++ configure
+@@ -11061,9 +11061,6 @@ else
+ fi
+ 
+ 
+-INSTALL_DATA='${INSTALL} -m 0600'
+-INSTALL_SCRIPT='${INSTALL}'
+-
+ if ulimit -v 2>/dev/null
+ then
+ 	ULIMIT='ulimit -v'
diff --git a/courier-imap/patches/patch-ae b/courier-imap/patches/patch-ae
new file mode 100644
index 0000000000..1bdb713152
--- /dev/null
+++ b/courier-imap/patches/patch-ae
@@ -0,0 +1,20 @@
+$NetBSD: patch-ae,v 1.8 2005/08/11 00:04:01 jlam Exp $
+
+--- imapd-ssl.rc.in.orig	2005-07-01 21:13:56.000000000 -0400
++++ imapd-ssl.rc.in
+@@ -9,6 +9,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libexecdir=@libexecdir@
++sbindir=@sbindir@
+ 
+ if test ! -f @sysconfdir@/imapd
+ then
+@@ -40,6 +41,7 @@ start)
+ 		exec_prefix=@exec_prefix@ ;
+ 		bindir=@bindir@ ;
+ 		libexecdir=@libexecdir@ ;
++		sbindir=@sbindir@ ;
+ 		. @sysconfdir@/imapd ; \
+ 		. @sysconfdir@/imapd-ssl ; \
+ 		PROXY_HOSTNAME=$PROXY_HOSTNAME ; \
diff --git a/courier-imap/patches/patch-af b/courier-imap/patches/patch-af
new file mode 100644
index 0000000000..d8a89c1ce7
--- /dev/null
+++ b/courier-imap/patches/patch-af
@@ -0,0 +1,20 @@
+$NetBSD: patch-af,v 1.9 2010/06/15 23:07:07 pettai Exp $
+
+--- imapd.rc.in.orig	2005-07-01 21:13:56.000000000 -0400
++++ imapd.rc.in
+@@ -9,6 +9,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libexecdir=@libexecdir@
++sbindir=@sbindir@
+ 
+ if test ! -f @sysconfdir@/imapd
+ then
+@@ -40,6 +41,7 @@ start)
+ 			exec_prefix=@exec_prefix@ ;
+ 			bindir=@bindir@ ;
+ 			libexecdir=@libexecdir@ ;
++			sbindir=@sbindir@ ;
+ 				. @sysconfdir@/imapd-ssl ; \
+ 				. @sysconfdir@/imapd ; \
+ 		IMAP_STARTTLS=$IMAPDSTARTTLS ; \
diff --git a/courier-imap/patches/patch-ag b/courier-imap/patches/patch-ag
new file mode 100644
index 0000000000..b6853df305
--- /dev/null
+++ b/courier-imap/patches/patch-ag
@@ -0,0 +1,20 @@
+$NetBSD: patch-ag,v 1.8 2005/08/11 00:04:01 jlam Exp $
+
+--- pop3d-ssl.rc.in.orig	2005-07-01 21:13:56.000000000 -0400
++++ pop3d-ssl.rc.in
+@@ -9,6 +9,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libexecdir=@libexecdir@
++sbindir=@sbindir@
+ 
+ if test ! -f @sysconfdir@/pop3d
+ then
+@@ -33,6 +34,7 @@ start)
+ 		exec_prefix=@exec_prefix@ ;
+ 		bindir=@bindir@ ;
+ 		libexecdir=@libexecdir@ ;
++		sbindir=@sbindir@ ;
+ 		. @sysconfdir@/pop3d ; \
+ 		. @sysconfdir@/pop3d-ssl ; \
+ 		PROXY_HOSTNAME=$PROXY_HOSTNAME ; \
diff --git a/courier-imap/patches/patch-ah b/courier-imap/patches/patch-ah
new file mode 100644
index 0000000000..21b0507e61
--- /dev/null
+++ b/courier-imap/patches/patch-ah
@@ -0,0 +1,20 @@
+$NetBSD: patch-ah,v 1.8 2010/06/15 23:07:07 pettai Exp $
+
+--- pop3d.rc.in.orig	2005-07-01 21:13:56.000000000 -0400
++++ pop3d.rc.in
+@@ -9,6 +9,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libexecdir=@libexecdir@
++sbindir=@sbindir@
+ 
+ if test ! -f @sysconfdir@/pop3d
+ then
+@@ -32,6 +33,7 @@ start)
+ 		exec_prefix=@exec_prefix@ ;
+ 		bindir=@bindir@ ;
+ 		libexecdir=@libexecdir@ ;
++		sbindir=@sbindir@ ;
+ 		. @sysconfdir@/pop3d-ssl ; \
+ 		. @sysconfdir@/pop3d ; \
+ 		PROXY_HOSTNAME=$PROXY_HOSTNAME ; \
diff --git a/courier-imap/patches/patch-ak b/courier-imap/patches/patch-ak
new file mode 100644
index 0000000000..aebd5e0b8c
--- /dev/null
+++ b/courier-imap/patches/patch-ak
@@ -0,0 +1,28 @@
+$NetBSD: patch-ak,v 1.4 2010/11/10 10:00:06 adam Exp $
+
+--- imap/mkimapdcert.in.orig	2010-06-29 01:39:59.000000000 +0000
++++ libs/imap/mkimapdcert.in
+@@ -9,7 +9,13 @@
+ # IMAP over SSL.  Normally this script would get called by an automatic
+ # package installation routine.
+ 
+-if test "@ssllib@" = "openssl"
++case "$1" in
++gnutls)		ssllib=gnutls ;;
++openssl)	ssllib=openssl ;;
++*)		ssllib="@ssllib@" ;;
++esac
++
++if test "$ssllib" = "openssl"
+ then
+ 	test -x @OPENSSL@ || exit 0
+ else
+@@ -36,7 +42,7 @@ cleanup() {
+ 
+ cd @certsdir@
+ 
+-if test "@ssllib@" = "openssl"
++if test "$ssllib" = "openssl"
+ then
+ 	cp /dev/null @certsdir@/imapd.pem
+ 	chmod 600 @certsdir@/imapd.pem
diff --git a/courier-imap/patches/patch-ao b/courier-imap/patches/patch-ao
new file mode 100644
index 0000000000..0f53b4bc25
--- /dev/null
+++ b/courier-imap/patches/patch-ao
@@ -0,0 +1,19 @@
+$NetBSD: patch-ao,v 1.2 2010/11/10 10:00:06 adam Exp $
+
+--- libs/imap/mkpop3dcert.in.orig	2013-11-11 02:56:33.000000000 +0000
++++ libs/imap/mkpop3dcert.in
+@@ -8,7 +8,13 @@
+ # POP3 over SSL.  Normally this script would get called by an automatic
+ # package installation routine.
+ 
+-if test "@ssllib@" = "openssl"
++case "$1" in
++gnutls)		ssllib="gnutls" ;;
++openssl)	ssllib="openssl" ;;
++*)		ssllib="@ssllib@" ;;
++esac
++
++if test "$ssllib" = "openssl"
+ then
+ 	test -x @OPENSSL@ || exit 0
+ else


Home | Main Index | Thread Index | Old Index