summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorschmonz <schmonz>2007-02-28 14:12:40 +0000
committerschmonz <schmonz>2007-02-28 14:12:40 +0000
commit34603e0b24103286b7ffa27ce5e57dc1b40198c2 (patch)
tree0c75b1ec33c1e37c07711a20b8097f5c2f7615cb /mail
parent9ca179863187482ba6e21bf5ffb8074277cc25d1 (diff)
downloadpkgsrc-34603e0b24103286b7ffa27ce5e57dc1b40198c2.tar.gz
Initial import of relay-ctrl 3.1.1.
This set of programs controls access to relaying for users that authenticate using either POP3 using the qmail-popup/qmail-pop3d or pop3front servers, or IMAP using Courier IMAP or Dovecot.
Diffstat (limited to 'mail')
-rw-r--r--mail/relay-ctrl/DESCR3
-rw-r--r--mail/relay-ctrl/MESSAGE14
-rw-r--r--mail/relay-ctrl/Makefile50
-rw-r--r--mail/relay-ctrl/PLIST21
-rw-r--r--mail/relay-ctrl/distinfo5
-rw-r--r--mail/relay-ctrl/files/dovecot-settcpremoteip.sh9
-rw-r--r--mail/relay-ctrl/files/ifrelayclient.sh39
7 files changed, 141 insertions, 0 deletions
diff --git a/mail/relay-ctrl/DESCR b/mail/relay-ctrl/DESCR
new file mode 100644
index 00000000000..c8d08b35376
--- /dev/null
+++ b/mail/relay-ctrl/DESCR
@@ -0,0 +1,3 @@
+This set of programs controls access to relaying for users that
+authenticate using either POP3 using the qmail-popup/qmail-pop3d
+or pop3front servers, or IMAP using Courier IMAP or Dovecot.
diff --git a/mail/relay-ctrl/MESSAGE b/mail/relay-ctrl/MESSAGE
new file mode 100644
index 00000000000..c45e6b56ee1
--- /dev/null
+++ b/mail/relay-ctrl/MESSAGE
@@ -0,0 +1,14 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2007/02/28 14:12:40 schmonz Exp $
+
+relay-ctrl needs to be integrated into both your POP/IMAP and SMTP
+services. For SMTP, if you use mail/qmail-run, set the following
+in /etc/rc.conf:
+
+qmailsmtpd_postenv="RELAY_CTRL_DIR='${RELAY_CTRL_DIR}/allow'"
+qmailsmtpd_pretcpserver="${PREFIX}/bin/relay-ctrl-chdir"
+qmailsmtpd_presmtpd="${PREFIX}/bin/relay-ctrl-check"
+
+For other services, see ${PREFIX}/${DOCDIR}/README.
+
+===========================================================================
diff --git a/mail/relay-ctrl/Makefile b/mail/relay-ctrl/Makefile
new file mode 100644
index 00000000000..e4ebe7a9ec8
--- /dev/null
+++ b/mail/relay-ctrl/Makefile
@@ -0,0 +1,50 @@
+# $NetBSD: Makefile,v 1.1.1.1 2007/02/28 14:12:40 schmonz Exp $
+#
+
+DISTNAME= relay-ctrl-3.1.1
+CATEGORIES= mail
+MASTER_SITES= ${HOMEPAGE}
+
+MAINTAINER= schmonz@NetBSD.org
+HOMEPAGE= http://untroubled.org/relay-ctrl/
+COMMENT= Allows relaying via POP/IMAP-before-SMTP
+
+DJB_RESTRICTED= NO
+DJB_MAKE_TARGETS= NO
+
+DOCDIR= share/doc/${PKGBASE}
+INSTALLATION_DIRS= bin ${PKGMANDIR}/man8 ${DOCDIR}
+OWN_DIRS_PERMS+= ${RELAY_CTRL_DIR} ${ROOT_USER} ${ROOT_GROUP} 700
+OWN_DIRS_PERMS+= ${RELAY_CTRL_DIR}/allow ${ROOT_USER} ${ROOT_GROUP} 777
+MESSAGE_SUBST+= RELAY_CTRL_DIR=${RELAY_CTRL_DIR:Q} DOCDIR=${DOCDIR:Q}
+BUILD_DEFS+= RELAY_CTRL_DIR
+
+ADDON_SCRIPTS= dovecot-settcpremoteip ifrelayclient
+
+SUBST_CLASSES+= paths
+SUBST_FILES.paths= ${ADDON_SCRIPTS}
+SUBST_SED.paths= -e 's,@ECHO@,${ECHO},g'
+SUBST_SED.paths+= -e 's,@GREP@,${GREP},g'
+SUBST_SED.paths+= -e 's,@SED@,${SED},g'
+SUBST_SED.paths+= -e 's,@SETENV@,${SETENV},g'
+SUBST_SED.paths+= -e 's,@SH@,${SH},g'
+SUBST_STAGE.paths= do-configure
+
+post-extract:
+ for f in ${ADDON_SCRIPTS}; do \
+ ${CP} ${FILESDIR}/$$f.sh ${WRKSRC}/$$f; \
+ done
+
+do-install:
+ ${_PKG_SILENT}${_PKG_DEBUG}cd ${WRKSRC}; \
+ ./installer; \
+ ./instcheck
+ for f in ANNOUNCEMENT COPYING NEWS README TODO packet.html; do \
+ ${INSTALL_DATA} ${WRKSRC}/$${f} ${PREFIX}/${DOCDIR}; \
+ done
+ for f in ${ADDON_SCRIPTS}; do \
+ ${INSTALL_SCRIPT} ${WRKSRC}/$${f} ${PREFIX}/bin; \
+ done
+
+.include "../../mk/djbware.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/mail/relay-ctrl/PLIST b/mail/relay-ctrl/PLIST
new file mode 100644
index 00000000000..745ab9ec7de
--- /dev/null
+++ b/mail/relay-ctrl/PLIST
@@ -0,0 +1,21 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2007/02/28 14:12:40 schmonz Exp $
+bin/dovecot-settcpremoteip
+bin/ifrelayclient
+bin/relay-ctrl-age
+bin/relay-ctrl-allow
+bin/relay-ctrl-chdir
+bin/relay-ctrl-check
+bin/relay-ctrl-send
+bin/relay-ctrl-udp
+man/man8/relay-ctrl-age.8
+man/man8/relay-ctrl-allow.8
+man/man8/relay-ctrl-check.8
+man/man8/relay-ctrl-send.8
+man/man8/relay-ctrl-udp.8
+share/doc/relay-ctrl/ANNOUNCEMENT
+share/doc/relay-ctrl/COPYING
+share/doc/relay-ctrl/NEWS
+share/doc/relay-ctrl/README
+share/doc/relay-ctrl/TODO
+share/doc/relay-ctrl/packet.html
+@dirrm share/doc/relay-ctrl
diff --git a/mail/relay-ctrl/distinfo b/mail/relay-ctrl/distinfo
new file mode 100644
index 00000000000..eddf03c8e96
--- /dev/null
+++ b/mail/relay-ctrl/distinfo
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.1.1.1 2007/02/28 14:12:40 schmonz Exp $
+
+SHA1 (relay-ctrl-3.1.1.tar.gz) = 01ae6eba6fff3b93761ce0bdd5ca7059a999d2d1
+RMD160 (relay-ctrl-3.1.1.tar.gz) = 48fa830f08b1ea3b37ca07d62cde05dc35388287
+Size (relay-ctrl-3.1.1.tar.gz) = 35046 bytes
diff --git a/mail/relay-ctrl/files/dovecot-settcpremoteip.sh b/mail/relay-ctrl/files/dovecot-settcpremoteip.sh
new file mode 100644
index 00000000000..bc30d48f167
--- /dev/null
+++ b/mail/relay-ctrl/files/dovecot-settcpremoteip.sh
@@ -0,0 +1,9 @@
+#!@SH@
+#
+# Wrapper for relay-ctrl-allow that sets TCPREMOTEIP by massaging
+# Dovecot login info.
+
+TCPREMOTEIP=`@ECHO@ "$@" | @SED@ -e 's|.* ||' -e 's|]$||'`
+export TCPREMOTEIP
+
+exec "$@"
diff --git a/mail/relay-ctrl/files/ifrelayclient.sh b/mail/relay-ctrl/files/ifrelayclient.sh
new file mode 100644
index 00000000000..30242e47c75
--- /dev/null
+++ b/mail/relay-ctrl/files/ifrelayclient.sh
@@ -0,0 +1,39 @@
+#!@SH@
+#
+# Wrapper for qmail-smtpd command chain that runs the first command
+# only if RELAYCLIENT is set, running the remaining commands
+# regardless. End the first command with "--".
+#
+# Useful for e.g. setting RBLSMTPD="" to avoid RBL-blocking an
+# authenticated user.
+
+relayclient_isset()
+{
+ @SETENV@ | @GREP@ -q '^RELAYCLIENT=' >/dev/null 2>&1
+}
+
+main()
+{
+ local cmd1 arg
+ cmd1=""
+ while [ $# -gt 0 ]; do
+ arg="$1"; shift
+ if [ "${arg}" = '--' ]; then
+ break
+ else
+ cmd1="${cmd1} ${arg}"
+ fi
+ done
+ if [ $# -eq 0 ]; then
+ @ECHO@ >&2 "usage: $0 command args -- command args"
+ exit 111
+ fi
+ if relayclient_isset; then
+ exec ${cmd1} "$@"
+ else
+ exec "$@"
+ fi
+}
+
+main "$@"
+exit $?