summaryrefslogtreecommitdiff
path: root/mail/qmail-run/files
diff options
context:
space:
mode:
authorschmonz <schmonz@pkgsrc.org>2017-01-09 04:58:09 +0000
committerschmonz <schmonz@pkgsrc.org>2017-01-09 04:58:09 +0000
commitb6dd13c525690b1be760fb620a06f15c54dea455 (patch)
treed8844f91ba1839697556b32e9fa1162783fd6237 /mail/qmail-run/files
parentf61111ecbdc3838ca4a946a64952ba3891a797c7 (diff)
downloadpkgsrc-b6dd13c525690b1be760fb620a06f15c54dea455.tar.gz
Update to 20170109. pkgsrc changes:
- Add qmailofmipd service for outgoing submissions. - Add dependencies on mess822, spamdyke, and stunnel. - Add sample spamdyke and stunnel configs for SMTP AUTH over TLS. - Control ofmipd from the main qmail script. - Fix broken link to "12 Steps to qmail List Bliss".
Diffstat (limited to 'mail/qmail-run/files')
-rw-r--r--mail/qmail-run/files/README.pkgsrc2
-rw-r--r--mail/qmail-run/files/qmail.sh8
-rw-r--r--mail/qmail-run/files/qmailofmipd.sh95
-rw-r--r--mail/qmail-run/files/spamdyke-ofmipd.conf8
-rw-r--r--mail/qmail-run/files/stunnel.conf13
5 files changed, 121 insertions, 5 deletions
diff --git a/mail/qmail-run/files/README.pkgsrc b/mail/qmail-run/files/README.pkgsrc
index efb160eb56b..95244be736c 100644
--- a/mail/qmail-run/files/README.pkgsrc
+++ b/mail/qmail-run/files/README.pkgsrc
@@ -23,7 +23,7 @@ installation, your request for help is likely to be better received.
It is highly recommended that you read Charles Cazabon's "12 Steps
to qmail List Bliss" before posting to the list:
-<URL:http://www.qcc.ca/~charlesc/writings/12-steps-to-qmail-list-bliss.html>
+<URL:http://pyropus.ca/personal/writings/12-steps-to-qmail-list-bliss.html>
Deviations from LWQ
diff --git a/mail/qmail-run/files/qmail.sh b/mail/qmail-run/files/qmail.sh
index a4599aa899e..d3f07c33c6f 100644
--- a/mail/qmail-run/files/qmail.sh
+++ b/mail/qmail-run/files/qmail.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: qmail.sh,v 1.3 2004/08/23 03:47:48 schmonz Exp $
+# $NetBSD: qmail.sh,v 1.4 2017/01/09 04:58:09 schmonz Exp $
#
# @PKGNAME@ master script for administrators to control qmail
# services. Usage resembles the qmailctl script from "Life with qmail".
@@ -59,7 +59,7 @@ qmail_help()
pause -- temporarily stops mail service (connections accepted, nothing leaves)
cont -- continues paused mail service
stat -- displays status of mail service
- cdb -- rebuild the tcpserver cdb file for smtp and/or pop3
+ cdb -- rebuild the tcpserver cdb file for smtp, ofmip, and/or pop3
restart -- stops and restarts smtp, sends qmail-send a TERM & restarts it
doqueue -- schedules queued messages for immediate delivery
reload -- sends qmail-send HUP, rereading locals and virtualdomains
@@ -70,7 +70,7 @@ doqueue -- schedules queued messages for immediate delivery
HELP
}
-COMMAND_LIST="qmailsend qmailsmtpd qmailpop3d"
+COMMAND_LIST="qmailsend qmailsmtpd qmailofmipd qmailpop3d"
name="qmail"
start_cmd="forward_commands"
@@ -80,7 +80,7 @@ reload_cmd="qmailrcd send"; hup_cmd=${reload_cmd}
status_cmd="forward_commands"; stat_cmd=${status_cmd}
pause_cmd="forward_commands"
cont_cmd="forward_commands"
-cdb_cmd="qmailrcd smtpd pop3d"
+cdb_cmd="qmailrcd smtpd ofmipd pop3d"
queue_cmd="qmailrcd send"
help_cmd="qmail_help"
extra_commands="pause cont stat status cdb doqueue reload queue alrm flush hup help"
diff --git a/mail/qmail-run/files/qmailofmipd.sh b/mail/qmail-run/files/qmailofmipd.sh
new file mode 100644
index 00000000000..8d6e029c863
--- /dev/null
+++ b/mail/qmail-run/files/qmailofmipd.sh
@@ -0,0 +1,95 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: qmailofmipd.sh,v 1.1 2017/01/09 04:58:09 schmonz Exp $
+#
+# @PKGNAME@ script to control ofmipd (SMTP submission service).
+#
+
+# PROVIDE: qmailofmipd mail
+# REQUIRE: qmailsend
+
+name="qmailofmipd"
+
+# User-settable rc.conf variables and their default values:
+: ${qmailofmipd_postenv:=""}
+: ${qmailofmipd_tcpflags:="-vRl0"}
+: ${qmailofmipd_tcphost:="127.0.0.1"}
+: ${qmailofmipd_tcpport:="26"}
+: ${qmailofmipd_datalimit:="146800640"}
+: ${qmailofmipd_pretcpserver:=""}
+: ${qmailofmipd_preofmipd:=""}
+: ${qmailofmipd_postofmipd:=""}
+: ${qmailofmipd_log:="YES"}
+: ${qmailofmipd_logcmd:="logger -t nb${name} -p mail.info"}
+: ${qmailofmipd_nologcmd:="/usr/pkg/bin/multilog -*"}
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+rcvar=${name}
+required_files="@PKG_SYSCONFDIR@/control/concurrencyofmip"
+required_files="${required_files} @PKG_SYSCONFDIR@/tcp.ofmip.cdb"
+required_files="${required_files} @PKG_SYSCONFDIR@/control/rcpthosts"
+command="/usr/pkg/bin/tcpserver"
+procname=${name}
+start_precmd="qmailofmipd_precmd"
+extra_commands="stat pause cont cdb"
+stat_cmd="qmailofmipd_stat"
+pause_cmd="qmailofmipd_pause"
+cont_cmd="qmailofmipd_cont"
+cdb_cmd="qmailofmipd_cdb"
+
+qmailofmipd_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 "qmailofmipd".
+ if [ -f /etc/rc.subr ]; then
+ checkyesno qmailofmipd_log || qmailofmipd_logcmd=${qmailofmipd_nologcmd}
+ fi
+ command="/usr/bin/env - ${qmailofmipd_postenv} /usr/pkg/bin/softlimit -m ${qmailofmipd_datalimit} ${qmailofmipd_pretcpserver} /usr/pkg/bin/argv0 /usr/pkg/bin/tcpserver ${name} ${qmailofmipd_tcpflags} -x @PKG_SYSCONFDIR@/tcp.ofmip.cdb -c `/usr/bin/head -1 @PKG_SYSCONFDIR@/control/concurrencyofmip` -u `/usr/bin/id -u qmaild` -g `/usr/bin/id -g qmaild` ${qmailofmipd_tcphost} ${qmailofmipd_tcpport} ${qmailofmipd_preofmipd} /usr/pkg/bin/ofmipd ${qmailofmipd_postofmipd} 2>&1 | /usr/pkg/bin/setuidgid qmaill ${qmailofmipd_logcmd}"
+ command_args="&"
+ rc_flags=""
+}
+
+qmailofmipd_stat()
+{
+ run_rc_command status
+}
+
+qmailofmipd_pause()
+{
+ if ! statusmsg=`run_rc_command status`; then
+ echo $statusmsg
+ return 1
+ fi
+ echo "Pausing ${name}."
+ kill -STOP $rc_pid
+}
+
+qmailofmipd_cont()
+{
+ if ! statusmsg=`run_rc_command status`; then
+ echo $statusmsg
+ return 1
+ fi
+ echo "Continuing ${name}."
+ kill -CONT $rc_pid
+}
+
+qmailofmipd_cdb()
+{
+ echo "Reloading @PKG_SYSCONFDIR@/tcp.ofmip."
+ /usr/pkg/bin/tcprules @PKG_SYSCONFDIR@/tcp.ofmip.cdb @PKG_SYSCONFDIR@/tcp.ofmip.tmp < @PKG_SYSCONFDIR@/tcp.ofmip
+ /bin/chmod 644 @PKG_SYSCONFDIR@/tcp.ofmip.cdb
+}
+
+if [ -f /etc/rc.subr ]; then
+ load_rc_config $name
+ run_rc_command "$1"
+else
+ echo -n " ${name}"
+ qmailofmipd_precmd
+ eval ${command} ${qmailofmipd_flags} ${command_args}
+fi
diff --git a/mail/qmail-run/files/spamdyke-ofmipd.conf b/mail/qmail-run/files/spamdyke-ofmipd.conf
new file mode 100644
index 00000000000..fba05132c72
--- /dev/null
+++ b/mail/qmail-run/files/spamdyke-ofmipd.conf
@@ -0,0 +1,8 @@
+# $NetBSD: spamdyke-ofmipd.conf,v 1.1 2017/01/09 04:58:09 schmonz Exp $
+#
+# Wrap qmail-ofmipd with SMTP AUTH.
+#
+hostname-file=@PKG_SYSCONFDIR@/control/me
+qmail-rcpthosts-file=@PKG_SYSCONFDIR@/control/rcpthosts
+smtp-auth-level=always
+smtp-auth-command="@PREFIX@/bin/checkpassword @TRUE@"
diff --git a/mail/qmail-run/files/stunnel.conf b/mail/qmail-run/files/stunnel.conf
new file mode 100644
index 00000000000..c8109db504e
--- /dev/null
+++ b/mail/qmail-run/files/stunnel.conf
@@ -0,0 +1,13 @@
+# $NetBSD: stunnel.conf,v 1.1 2017/01/09 04:58:09 schmonz Exp $
+#
+# Export qmail-ofmipd as a TLS-enabled SMTP submission service.
+#
+debug = mail.info
+cert = /etc/openssl/certs/yourdomain.crt
+key = /etc/openssl/private/yourdomain.key
+options = NO_SSLv2
+
+[submission]
+accept = submission
+connect = localhost:26
+protocol = smtp