summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mail/mailfront/DESCR5
-rw-r--r--mail/mailfront/Makefile41
-rw-r--r--mail/mailfront/PLIST12
-rw-r--r--mail/mailfront/distinfo5
-rw-r--r--mail/mailfront/files/smtpfront.sh65
5 files changed, 128 insertions, 0 deletions
diff --git a/mail/mailfront/DESCR b/mail/mailfront/DESCR
new file mode 100644
index 00000000000..683bca6908e
--- /dev/null
+++ b/mail/mailfront/DESCR
@@ -0,0 +1,5 @@
+This is mailfront, a package containing customizeable network
+front-ends for mail servers. It contains complete SMTP, QMQP,
+QMTP, and POP3 front-ends as well as an authentication module for
+IMAP. The mail delivery front-ends also contain internal address
+filtering features.
diff --git a/mail/mailfront/Makefile b/mail/mailfront/Makefile
new file mode 100644
index 00000000000..6b305e7249f
--- /dev/null
+++ b/mail/mailfront/Makefile
@@ -0,0 +1,41 @@
+# $NetBSD: Makefile,v 1.1.1.1 2005/07/20 03:30:19 schmonz Exp $
+#
+
+DISTNAME= mailfront-0.96
+CATEGORIES= mail
+MASTER_SITES= ${HOMEPAGE}
+
+MAINTAINER= schmonz@NetBSD.org
+HOMEPAGE= http://untroubled.org/mailfront/
+COMMENT= Mail server network protocol front-ends
+
+DEPENDS+= cvm-[0-9]*:../../security/cvm
+DEPENDS+= daemontools-[0-9]*:../../sysutils/daemontools
+DEPENDS_QMAIL= qmail>=1.03nb8:../../mail/qmail
+DEPENDS+= ${DEPENDS_QMAIL}
+
+BUILD_TARGET= all
+INSTALL_TARGET= install
+
+DJB_RESTRICTED= NO
+
+USE_PKGINSTALL= YES
+RCD_SCRIPTS= smtpfront
+
+.include "../../mk/bsd.prefs.mk"
+
+# Detect the PKG_SYSCONFDIR of the installed qmail, so we can create
+# config files there and refer to them from rc.d scripts.
+.if !empty(PHASES_AFTER_EXTRACT:M${PKG_PHASE})
+INSTALLED_QMAIL!= ${PKG_BEST_EXISTS} ${DEPENDS_QMAIL:C/:.*$//:Q:S/\ / /g}
+. if empty(INSTALLED_QMAIL:M*_not_found_)
+. if !defined(PKG_SYSCONFDIR.mailfront)
+PKG_SYSCONFDIR.mailfront!= ${PKG_INFO} -Q PKG_SYSCONFDIR ${INSTALLED_QMAIL}
+. endif
+. endif
+.endif
+
+.include "../../devel/bglibs/buildlink3.mk"
+.include "../../security/cvm/buildlink3.mk"
+.include "../../mk/djbware.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/mail/mailfront/PLIST b/mail/mailfront/PLIST
new file mode 100644
index 00000000000..5f41913148a
--- /dev/null
+++ b/mail/mailfront/PLIST
@@ -0,0 +1,12 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2005/07/20 03:30:19 schmonz Exp $
+bin/imapfront-auth
+bin/pop3front-auth
+bin/pop3front-maildir
+bin/qmqpfront-echo
+bin/qmqpfront-qmail
+bin/qmtpfront-echo
+bin/qmtpfront-qmail
+bin/smtpfront-echo
+bin/smtpfront-qmail
+bin/smtpfront-reject
+share/examples/rc.d/smtpfront
diff --git a/mail/mailfront/distinfo b/mail/mailfront/distinfo
new file mode 100644
index 00000000000..01ad19a95de
--- /dev/null
+++ b/mail/mailfront/distinfo
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.1.1.1 2005/07/20 03:30:19 schmonz Exp $
+
+SHA1 (mailfront-0.96.tar.gz) = 9e22cf78f941cc988c387d7d143e648f80530d05
+RMD160 (mailfront-0.96.tar.gz) = 7af7cb117847434f4b5b0cf982466389b048d040
+Size (mailfront-0.96.tar.gz) = 72002 bytes
diff --git a/mail/mailfront/files/smtpfront.sh b/mail/mailfront/files/smtpfront.sh
new file mode 100644
index 00000000000..b9692a5684f
--- /dev/null
+++ b/mail/mailfront/files/smtpfront.sh
@@ -0,0 +1,65 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: smtpfront.sh,v 1.1.1.1 2005/07/20 03:30:19 schmonz Exp $
+#
+
+# PROVIDE: smtpfront
+# REQUIRE: qmailsend cvm
+
+name="smtpfront"
+
+# User-settable rc.conf variables and their default values:
+: ${smtpfront_postenv:="CVM_LOOKUP_SECRET='' CVM_LOOKUP='cvm-local:@VARBASE@/run/cvm-qmail'"}
+: ${smtpfront_tcpflags:="-vRl0"}
+: ${smtpfront_tcphost:="0"}
+: ${smtpfront_tcpport:="25"}
+: ${smtpfront_datalimit:="2000000"}
+: ${smtpfront_pretcpserver:=""}
+: ${smtpfront_presmtpd:=""}
+: ${smtpfront_postsmtpd:=""}
+: ${smtpfront_log:="YES"}
+: ${smtpfront_logcmd:="logger -t nb${name} -p mail.info"}
+: ${smtpfront_nologcmd:="@LOCALBASE@/bin/multilog -*"}
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+rcvar=${name}
+required_files="@PKG_SYSCONFDIR@/control/concurrencyincoming"
+required_files="${required_files} @PKG_SYSCONFDIR@/tcp.smtp.cdb"
+required_files="${required_files} @PKG_SYSCONFDIR@/control/rcpthosts"
+command="@LOCALBASE@/bin/tcpserver"
+procname=${name}
+start_precmd="smtpfront_precmd"
+extra_commands="cdb"
+cdb_cmd="smtpfront_cdb"
+
+smtpfront_precmd()
+{
+ # tcpserver(1) is akin to inetd(8), but runs one service per process.
+ # We want to signal only the tcpserver process responsible for SMTP
+ # service. Use argv0(1) to set procname to "smtpfront".
+ if [ -f /etc/rc.subr ]; then
+ checkyesno smtpfront_log || smtpfront_logcmd=${smtpfront_nologcmd}
+ fi
+ command="@SETENV@ - ${smtpfront_postenv} @LOCALBASE@/bin/softlimit -m ${smtpfront_datalimit} ${smtpfront_pretcpserver} @LOCALBASE@/bin/argv0 @LOCALBASE@/bin/tcpserver ${name} ${smtpfront_tcpflags} -x @PKG_SYSCONFDIR@/tcp.smtp.cdb -c `@HEAD@ -1 @PKG_SYSCONFDIR@/control/concurrencyincoming` -u `@ID@ -u qmaild ` -g `@ID@ -g qmaild` ${smtpfront_tcphost} ${smtpfront_tcpport} ${smtpfront_presmtpd} @LOCALBASE@/bin/smtpfront-qmail ${smtpfront_postsmtpd} 2>&1 | @LOCALBASE@/bin/setuidgid qmaill ${smtpfront_logcmd}"
+ command_args="&"
+ rc_flags=""
+}
+
+smtpfront_cdb()
+{
+ @ECHO@ "Reloading @PKG_SYSCONFDIR@/tcp.smtp."
+ @LOCALBASE@/bin/tcprules @PKG_SYSCONFDIR@/tcp.smtp.cdb @PKG_SYSCONFDIR@/tcp.smtp.tmp < @PKG_SYSCONFDIR@/tcp.smtp
+ @CHMOD@ 644 @PKG_SYSCONFDIR@/tcp.smtp.cdb
+}
+
+if [ -f /etc/rc.subr ]; then
+ load_rc_config $name
+ run_rc_command "$1"
+else
+ @ECHO_N@ " ${name}"
+ smtpfront_precmd
+ eval ${command} ${smtpfront_flags} ${command_args}
+fi