Sat Dec 15 06:31:35 2018 UTC ()
Fix previous: required_files the tcprules, not the cdb (which gets
autogenerated if it doesn't exist). Point more actionably at SRS and TLS
setup docs. Bump version.


(schmonz)
diff -r1.65 -r1.66 pkgsrc/mail/qmail-run/Makefile
diff -r1.6 -r1.7 pkgsrc/mail/qmail-run/files/README.pkgsrc
diff -r1.21 -r1.22 pkgsrc/mail/qmail-run/files/qmailofmipd.sh
diff -r1.29 -r1.30 pkgsrc/mail/qmail-run/files/qmailpop3d.sh
diff -r1.26 -r1.27 pkgsrc/mail/qmail-run/files/qmailsmtpd.sh

cvs diff -r1.65 -r1.66 pkgsrc/mail/qmail-run/Makefile (switch to unified diff)

--- pkgsrc/mail/qmail-run/Makefile 2018/12/14 06:49:30 1.65
+++ pkgsrc/mail/qmail-run/Makefile 2018/12/15 06:31:34 1.66
@@ -1,124 +1,124 @@ @@ -1,124 +1,124 @@
1# $NetBSD: Makefile,v 1.65 2018/12/14 06:49:30 schmonz Exp $ 1# $NetBSD: Makefile,v 1.66 2018/12/15 06:31:34 schmonz Exp $
2# 2#
3 3
4DISTNAME= qmail-run-20181214 4DISTNAME= qmail-run-20181215
5CATEGORIES= mail 5CATEGORIES= mail
6MASTER_SITES= # empty 6MASTER_SITES= # empty
7DISTFILES= # empty 7DISTFILES= # empty
8 8
9MAINTAINER= schmonz@NetBSD.org 9MAINTAINER= schmonz@NetBSD.org
10COMMENT= Configures qmail to receive and deliver mail 10COMMENT= Configures qmail to receive and deliver mail
11LICENSE= 2-clause-bsd 11LICENSE= 2-clause-bsd
12 12
13DEPENDS+= greetdelay-[0-9]*:../../mail/greetdelay 13DEPENDS+= greetdelay-[0-9]*:../../mail/greetdelay
14DEPENDS+= greylisting-spp-[0-9]*:../../mail/greylisting-spp 14DEPENDS+= greylisting-spp-[0-9]*:../../mail/greylisting-spp
15DEPENDS+= pkg_alternatives-[0-9]*:../../pkgtools/pkg_alternatives 15DEPENDS+= pkg_alternatives-[0-9]*:../../pkgtools/pkg_alternatives
16DEPENDS_QMAIL= qmail>=1.03nb42:../../mail/qmail 16DEPENDS_QMAIL= qmail>=1.03nb42:../../mail/qmail
17DEPENDS+= ${DEPENDS_QMAIL} 17DEPENDS+= ${DEPENDS_QMAIL}
18DEPENDS+= qmail-acceptutils>=20181128:../../mail/qmail-acceptutils 18DEPENDS+= qmail-acceptutils>=20181128:../../mail/qmail-acceptutils
19DEPENDS+= qmail-qfilter>1.5nb1:../../mail/qmail-qfilter 19DEPENDS+= qmail-qfilter>1.5nb1:../../mail/qmail-qfilter
20DEPENDS+= qmail-rejectutils>=20181128:../../mail/qmail-rejectutils 20DEPENDS+= qmail-rejectutils>=20181128:../../mail/qmail-rejectutils
21DEPENDS+= qmail-spp-spf-[0-9]*:../../mail/qmail-spp-spf 21DEPENDS+= qmail-spp-spf-[0-9]*:../../mail/qmail-spp-spf
22 22
23WRKSRC= ${WRKDIR} 23WRKSRC= ${WRKDIR}
24NO_BUILD= yes 24NO_BUILD= yes
25NO_CHECKSUM= yes 25NO_CHECKSUM= yes
26 26
27FILES_SUBST+= QMAIL_DAEMON_USER=${QMAIL_DAEMON_USER:Q} 27FILES_SUBST+= QMAIL_DAEMON_USER=${QMAIL_DAEMON_USER:Q}
28FILES_SUBST+= QMAIL_LOG_USER=${QMAIL_LOG_USER:Q} 28FILES_SUBST+= QMAIL_LOG_USER=${QMAIL_LOG_USER:Q}
29FILES_SUBST+= QMAIL_SEND_USER=${QMAIL_SEND_USER:Q} 29FILES_SUBST+= QMAIL_SEND_USER=${QMAIL_SEND_USER:Q}
30FILES_SUBST+= PKGNAME=${PKGNAME:Q} 30FILES_SUBST+= PKGNAME=${PKGNAME:Q}
31FILES_SUBST+= UCSPI_SSL_USER=${UCSPI_SSL_USER:Q} 31FILES_SUBST+= UCSPI_SSL_USER=${UCSPI_SSL_USER:Q}
32FILES_SUBST+= UCSPI_SSL_GROUP=${UCSPI_SSL_GROUP:Q} 32FILES_SUBST+= UCSPI_SSL_GROUP=${UCSPI_SSL_GROUP:Q}
33MESSAGE_SUBST+= PKG_SYSCONFBASE=${PKG_SYSCONFBASE:Q} 33MESSAGE_SUBST+= PKG_SYSCONFBASE=${PKG_SYSCONFBASE:Q}
34RCD_SCRIPTS= qmail qmailofmipd qmailpop3d qmailqread qmailsend qmailsmtpd 34RCD_SCRIPTS= qmail qmailofmipd qmailpop3d qmailqread qmailsend qmailsmtpd
35 35
36EGDIR= share/examples/qmail-run 36EGDIR= share/examples/qmail-run
37.for f in defaultdelivery fixsmtpio signatures rcptchecks \ 37.for f in defaultdelivery fixsmtpio signatures rcptchecks \
38 ofmipfilters smtpfilters \ 38 ofmipfilters smtpfilters \
39 pop3capabilities smtpcapabilities smtpplugins \ 39 pop3capabilities smtpcapabilities smtpplugins \
40 concurrencyincoming concurrencypop3 concurrencysubmission 40 concurrencyincoming concurrencypop3 concurrencysubmission
41CONF_FILES+= ${PREFIX}/${EGDIR}/${f} \ 41CONF_FILES+= ${PREFIX}/${EGDIR}/${f} \
42 ${PKG_SYSCONFDIR}/control/${f} 42 ${PKG_SYSCONFDIR}/control/${f}
43.endfor 43.endfor
44TCPRULESDIR= ${PKG_SYSCONFDIR}/control/tcprules 44TCPRULESDIR= ${PKG_SYSCONFDIR}/control/tcprules
45OWN_DIRS+= ${TCPRULESDIR} 45OWN_DIRS+= ${TCPRULESDIR}
46.for f in ofmip pop3 smtp 46.for f in ofmip pop3 smtp
47CONF_FILES+= ${PREFIX}/${EGDIR}/tcprules-${f} \ 47CONF_FILES+= ${PREFIX}/${EGDIR}/tcprules-${f} \
48 ${TCPRULESDIR}/${f} 48 ${TCPRULESDIR}/${f}
49.endfor 49.endfor
50GREYLISTDIR= ${PKG_SYSCONFDIR}/control/greylist 50GREYLISTDIR= ${PKG_SYSCONFDIR}/control/greylist
51OWN_DIRS_PERMS+= ${GREYLISTDIR} ${QMAIL_DAEMON_USER} ${QMAIL_QMAIL_GROUP} 775 51OWN_DIRS_PERMS+= ${GREYLISTDIR} ${QMAIL_DAEMON_USER} ${QMAIL_QMAIL_GROUP} 775
52CONF_FILES_PERMS+= ${PREFIX}/${EGDIR}/greylist-database ${GREYLISTDIR}/database ${QMAIL_DAEMON_USER} ${QMAIL_QMAIL_GROUP} 664 52CONF_FILES_PERMS+= ${PREFIX}/${EGDIR}/greylist-database ${GREYLISTDIR}/database ${QMAIL_DAEMON_USER} ${QMAIL_QMAIL_GROUP} 664
53.for f in exemptrcpthosts exemptrcpts 53.for f in exemptrcpthosts exemptrcpts
54CONF_FILES+= ${PREFIX}/${EGDIR}/greylist-${f} \ 54CONF_FILES+= ${PREFIX}/${EGDIR}/greylist-${f} \
55 ${GREYLISTDIR}/${f} 55 ${GREYLISTDIR}/${f}
56.endfor 56.endfor
57 57
58INSTALLATION_DIRS= bin share/doc/qmail-run ${EGDIR} 58INSTALLATION_DIRS= bin share/doc/qmail-run ${EGDIR}
59BUILD_DEFS+= QMAIL_DAEMON_USER QMAIL_LOG_USER QMAIL_SEND_USER 59BUILD_DEFS+= QMAIL_DAEMON_USER QMAIL_LOG_USER QMAIL_SEND_USER
60BUILD_DEFS+= QMAIL_QMAIL_GROUP PKG_SYSCONFBASE 60BUILD_DEFS+= QMAIL_QMAIL_GROUP PKG_SYSCONFBASE
61BUILD_DEFS+= UCSPI_SSL_USER UCSPI_SSL_GROUP 61BUILD_DEFS+= UCSPI_SSL_USER UCSPI_SSL_GROUP
62 62
63.include "../../mk/bsd.prefs.mk" 63.include "../../mk/bsd.prefs.mk"
64 64
65# Detect the PKG_SYSCONFDIR of the installed qmail, so we can create 65# Detect the PKG_SYSCONFDIR of the installed qmail, so we can create
66# config files there and refer to them from rc.d scripts. 66# config files there and refer to them from rc.d scripts.
67# 67#
68.if !defined(PKG_SYSCONFDIR.qmail-run) 68.if !defined(PKG_SYSCONFDIR.qmail-run)
69PKG_SYSCONFDIR.qmail-run!= \ 69PKG_SYSCONFDIR.qmail-run!= \
70 ${PKG_INFO} -Q PKG_SYSCONFDIR \ 70 ${PKG_INFO} -Q PKG_SYSCONFDIR \
71 ${DEPENDS_QMAIL:C/:.*$//:Q} 2>/dev/null || \ 71 ${DEPENDS_QMAIL:C/:.*$//:Q} 2>/dev/null || \
72 ${ECHO} "PKG_SYSCONFDIR.qmail-run_not_set" 72 ${ECHO} "PKG_SYSCONFDIR.qmail-run_not_set"
73. if empty(PKG_SYSCONFDIR.qmail-run:M*not_set) 73. if empty(PKG_SYSCONFDIR.qmail-run:M*not_set)
74MAKEVARS+= PKG_SYSCONFDIR.qmail-run 74MAKEVARS+= PKG_SYSCONFDIR.qmail-run
75. endif 75. endif
76.endif 76.endif
77 77
78SUBST_CLASSES+= paths 78SUBST_CLASSES+= paths
79SUBST_STAGE.paths= pre-configure 79SUBST_STAGE.paths= pre-configure
80SUBST_FILES.paths= mailer.conf 80SUBST_FILES.paths= mailer.conf
81SUBST_FILES.paths+= greylisting-spp-wrapper ofmipd-with-user-cdb 81SUBST_FILES.paths+= greylisting-spp-wrapper ofmipd-with-user-cdb
82SUBST_FILES.paths+= qmail-isspam-* qmail-procmail qmail-qread-client 82SUBST_FILES.paths+= qmail-isspam-* qmail-procmail qmail-qread-client
83SUBST_FILES.paths+= rcptchecks ofmipfilters smtpfilters smtpplugins tcprules-* 83SUBST_FILES.paths+= rcptchecks ofmipfilters smtpfilters smtpplugins tcprules-*
84SUBST_VARS.paths= PKGNAME PKG_SYSCONFDIR PREFIX 84SUBST_VARS.paths= PKGNAME PKG_SYSCONFDIR PREFIX
85SUBST_VARS.paths+= CAT ECHO GREP SED SH SORT TRUE 85SUBST_VARS.paths+= CAT ECHO GREP SED SH SORT TRUE
86 86
87post-extract: 87post-extract:
88 for f in README.pkgsrc mailer.conf \ 88 for f in README.pkgsrc mailer.conf \
89 defaultdelivery fixsmtpio signatures rcptchecks \ 89 defaultdelivery fixsmtpio signatures rcptchecks \
90 ofmipfilters smtpfilters \ 90 ofmipfilters smtpfilters \
91 pop3capabilities smtpcapabilities smtpplugins \ 91 pop3capabilities smtpcapabilities smtpplugins \
92 concurrencyincoming concurrencypop3 concurrencysubmission \ 92 concurrencyincoming concurrencypop3 concurrencysubmission \
93 tcprules-ofmip tcprules-pop3 tcprules-smtp; do \ 93 tcprules-ofmip tcprules-pop3 tcprules-smtp; do \
94 ${CP} ${FILESDIR}/$$f ${WRKDIR}/$$f; \ 94 ${CP} ${FILESDIR}/$$f ${WRKDIR}/$$f; \
95 done; \ 95 done; \
96 for f in greylisting-spp-wrapper ofmipd-with-user-cdb \ 96 for f in greylisting-spp-wrapper ofmipd-with-user-cdb \
97 qmail-isspam-rspamd qmail-isspam-spamassassin \ 97 qmail-isspam-rspamd qmail-isspam-spamassassin \
98 qmail-procmail qmail-qread-client; do \ 98 qmail-procmail qmail-qread-client; do \
99 ${CP} ${FILESDIR}/$$f.sh ${WRKDIR}/$$f; \ 99 ${CP} ${FILESDIR}/$$f.sh ${WRKDIR}/$$f; \
100 done 100 done
101 101
102do-install: 102do-install:
103 for f in greylisting-spp-wrapper ofmipd-with-user-cdb \ 103 for f in greylisting-spp-wrapper ofmipd-with-user-cdb \
104 qmail-isspam-rspamd qmail-isspam-spamassassin \ 104 qmail-isspam-rspamd qmail-isspam-spamassassin \
105 qmail-procmail qmail-qread-client; do \ 105 qmail-procmail qmail-qread-client; do \
106 ${INSTALL_SCRIPT} ${WRKDIR}/$$f ${DESTDIR}${PREFIX}/bin; \ 106 ${INSTALL_SCRIPT} ${WRKDIR}/$$f ${DESTDIR}${PREFIX}/bin; \
107 done 107 done
108 ${INSTALL_DATA} ${WRKDIR}/README.pkgsrc \ 108 ${INSTALL_DATA} ${WRKDIR}/README.pkgsrc \
109 ${DESTDIR}${PREFIX}/share/doc/qmail-run 109 ${DESTDIR}${PREFIX}/share/doc/qmail-run
110 for f in defaultdelivery fixsmtpio signatures rcptchecks \ 110 for f in defaultdelivery fixsmtpio signatures rcptchecks \
111 ofmipfilters smtpfilters \ 111 ofmipfilters smtpfilters \
112 pop3capabilities smtpcapabilities smtpplugins \ 112 pop3capabilities smtpcapabilities smtpplugins \
113 concurrencyincoming concurrencypop3 concurrencysubmission \ 113 concurrencyincoming concurrencypop3 concurrencysubmission \
114 tcprules-ofmip tcprules-pop3 tcprules-smtp; do \ 114 tcprules-ofmip tcprules-pop3 tcprules-smtp; do \
115 ${INSTALL_DATA} ${WRKDIR}/$${f} \ 115 ${INSTALL_DATA} ${WRKDIR}/$${f} \
116 ${DESTDIR}${PREFIX}/${EGDIR}; \ 116 ${DESTDIR}${PREFIX}/${EGDIR}; \
117 done; \ 117 done; \
118 for f in database exemptrcpthosts exemptrcpts; do \ 118 for f in database exemptrcpthosts exemptrcpts; do \
119 ${TOUCH} ${DESTDIR}${PREFIX}/${EGDIR}/greylist-$${f}; \ 119 ${TOUCH} ${DESTDIR}${PREFIX}/${EGDIR}/greylist-$${f}; \
120 done; \ 120 done; \
121 ${INSTALL_DATA} ${WRKDIR}/mailer.conf \ 121 ${INSTALL_DATA} ${WRKDIR}/mailer.conf \
122 ${DESTDIR}${PREFIX}/${EGDIR} 122 ${DESTDIR}${PREFIX}/${EGDIR}
123 123
124.include "../../mk/bsd.pkg.mk" 124.include "../../mk/bsd.pkg.mk"

cvs diff -r1.6 -r1.7 pkgsrc/mail/qmail-run/files/README.pkgsrc (switch to unified diff)

--- pkgsrc/mail/qmail-run/files/README.pkgsrc 2018/12/14 06:49:31 1.6
+++ pkgsrc/mail/qmail-run/files/README.pkgsrc 2018/12/15 06:31:34 1.7
@@ -1,101 +1,101 @@ @@ -1,101 +1,101 @@
1 Getting started 1 Getting started
2 =============== 2 ===============
3 3
4Assuming NetBSD-style mailwrapper(8) and rc(8), to enable qmail for... 4Assuming NetBSD-style mailwrapper(8) and rc(8), to enable qmail for...
5 5
6Local and outbound delivery: 6Local and outbound delivery:
7- Run "/etc/rc.d/postfix stop" and set postfix=NO in /etc/rc.conf. 7- Run "/etc/rc.d/postfix stop" and set postfix=NO in /etc/rc.conf.
8- Replace /etc/mailer.conf with ${PREFIX}/share/examples/qmail-run/mailer.conf. 8- Replace /etc/mailer.conf with ${PREFIX}/share/examples/qmail-run/mailer.conf.
9- Check configuration in ${PKG_SYSCONFDIR} (especially alias/.qmail-*). 9- Check configuration in ${PKG_SYSCONFDIR} (especially alias/.qmail-*).
10- Set qmailsend=YES and qmailqread=YES in /etc/rc.conf. 10- Set qmailsend=YES and qmailqread=YES in /etc/rc.conf.
11- Run "/etc/rc.d/qmail start". 11- Run "/etc/rc.d/qmail start".
12 12
13Incoming SMTP on port 25: 13Incoming SMTP on port 25:
14- Set qmailsmtpd=YES in /etc/rc.conf. 14- Set qmailsmtpd=YES in /etc/rc.conf.
15- Add any qmail-rcptcheck programs to control/rcptchecks. 15- Add any qmail-rcptcheck programs to control/rcptchecks.
16- Add any qmail-qfilter programs to control/smtpfilters. 16- Add any qmail-qfilter programs to control/smtpfilters.
17- Add any qmail-spp programs (such as greylisting) to control/smtpplugins. 17- Add any qmail-spp programs (such as greylisting) to control/smtpplugins.
18- Run "/etc/rc.d/qmailsmtpd start". 18- Run "/etc/rc.d/qmailsmtpd start".
19 19
20Greylisting: 20Greylisting:
21- Add any exempt recipient addresses to control/greylist/exemptrcpts. 21- Add any exempt recipient addresses to control/greylist/exemptrcpts.
22- Add any exempt recipient domains to control/greylist/exemptrcpthosts. 22- Add any exempt recipient domains to control/greylist/exemptrcpthosts.
23- Tuples are (IP,sender,recipient). To effectively omit IP, add 23- Tuples are (IP,sender,recipient). To effectively omit IP, add
24 GL_WRAPPER_TCPREMOTEIP="127.127.127.127" to control/tcprules/smtp, 24 GL_WRAPPER_TCPREMOTEIP="127.127.127.127" to control/tcprules/smtp,
25 then run "/etc/rc.d/qmailsmtpd cdb". 25 then run "/etc/rc.d/qmailsmtpd cdb".
26- Uncomment "greylisting-spp-wrapper" in control/smtpplugins. 26- Uncomment "greylisting-spp-wrapper" in control/smtpplugins.
27 27
28Authenticated message submission on port 587: 28Authenticated message submission on port 587:
29- Set qmailofmipd=YES in /etc/rc.conf. 29- Set qmailofmipd=YES in /etc/rc.conf.
30- Add any qmail-qfilter programs to control/ofmipfilters. 30- Add any qmail-qfilter programs to control/ofmipfilters.
31- Run "/etc/rc.d/qmailofmipd start". 31- Run "/etc/rc.d/qmailofmipd start".
32 32
33POP3 (for Maildirs only) on port 110: 33POP3 (for Maildirs only) on port 110:
34- Set qmailpop3d=YES in /etc/rc.conf. 34- Set qmailpop3d=YES in /etc/rc.conf.
35- Run "/etc/rc.d/qmailpop3d start". 35- Run "/etc/rc.d/qmailpop3d start".
36 36
37TLS encryption for SMTP, submission, POP3, and remote delivery: 37TLS encryption for SMTP, submission, POP3, and remote delivery:
38- Create cert and DH params (as instructed by the qmail package). 38- Create cert and DH params (follow steps in `pkg_info -qD qmail`).
39- Run "/etc/rc.d/qmail restart". 39- Run "/etc/rc.d/qmail restart".
40 40
41Sender Policy Framework: 41Sender Policy Framework:
42- Configure Sender Rewriting Scheme (as instructed by the qmail package) 42- Configure Sender Rewriting Scheme (see ${PREFIX}/share/doc/qmail/README.srs)
43 so your auto-forwarded messages will reach servers that choose to 43 so your auto-forwarded messages will reach servers that choose to
44 enforce the forwarded domains' SPF policies. 44 enforce the forwarded domains' SPF policies.
45- Publish a DNS TXT record with your desired policy. 45- Publish a DNS TXT record with your desired policy.
46- Incoming messages that explicit-fail published policy are nonetheless 46- Incoming messages that explicit-fail published policy are nonetheless
47 accepted. To reject -- including rejecting auto-forwarded messages 47 accepted. To reject -- including rejecting auto-forwarded messages
48 from servers that haven't configured SRS -- add 48 from servers that haven't configured SRS -- add
49 SPP_SPF_RESULT_FAIL="E550 spf_smtp_msg" to control/tcprules/smtp, 49 SPP_SPF_RESULT_FAIL="E550 spf_smtp_msg" to control/tcprules/smtp,
50 then run "/etc/rc.d/qmailsmtpd cdb". 50 then run "/etc/rc.d/qmailsmtpd cdb".
51- Messages that explicit-pass are not greylisted. To remove the 51- Messages that explicit-pass are not greylisted. To remove the
52 exemption, remove SPP_SPF_RESULT_PASS="SGL_WHITELISTED=1" from 52 exemption, remove SPP_SPF_RESULT_PASS="SGL_WHITELISTED=1" from
53 control/tcprules/smtp, then run "/etc/rc.d/qmailsmtpd cdb". 53 control/tcprules/smtp, then run "/etc/rc.d/qmailsmtpd cdb".
54 54
55 55
56 Getting help 56 Getting help
57 ============ 57 ============
58 58
59You've installed an automated and customized qmail-run package. If 59You've installed an automated and customized qmail-run package. If
60you're having trouble getting the qmail daemons to run, ask the 60you're having trouble getting the qmail daemons to run, ask the
61package's maintainer: 61package's maintainer:
62 62
63<URL:mailto:schmonz-pkgsrc-qmail@schmonz.com> 63<URL:mailto:schmonz-pkgsrc-qmail@schmonz.com>
64 64
65Many members of the qmail mailing list recommend following the 65Many members of the qmail mailing list recommend following the
66install instructions in Dave Sill's "Life with qmail" document: 66install instructions in Dave Sill's "Life with qmail" document:
67 67
68<URL:http://www.lifewithqmail.org/lwq.html> 68<URL:http://www.lifewithqmail.org/lwq.html>
69 69
70A "Life with qmail" installation is done by hand, so any qmail 70A "Life with qmail" installation is done by hand, so any qmail
71package necessarily deviates from LWQ in at least this respect. 71package necessarily deviates from LWQ in at least this respect.
72Therefore, if you need to ask for help on the qmail list, please 72Therefore, if you need to ask for help on the qmail list, please
73mention that you're using the qmail-run package from pkgsrc. 73mention that you're using the qmail-run package from pkgsrc.
74 74
75If you can first reproduce your problem on a manual LWQ-style 75If you can first reproduce your problem on a manual LWQ-style
76installation, your request for help is likely to be better received. 76installation, your request for help is likely to be better received.
77 77
78It is highly recommended that you read Charles Cazabon's "12 Steps 78It is highly recommended that you read Charles Cazabon's "12 Steps
79to qmail List Bliss" before posting to the list: 79to qmail List Bliss" before posting to the list:
80 80
81<URL:http://pyropus.ca/personal/writings/12-steps-to-qmail-list-bliss.html> 81<URL:http://pyropus.ca/personal/writings/12-steps-to-qmail-list-bliss.html>
82 82
83 83
84 Deviations from LWQ 84 Deviations from LWQ
85 =================== 85 ===================
86 86
87LWQ suggests doing some things that the qmail-run package doesn't do: 87LWQ suggests doing some things that the qmail-run package doesn't do:
88* Copying a script from /var/qmail/boot to /var/qmail/rc. 88* Copying a script from /var/qmail/boot to /var/qmail/rc.
89* Configuring svscan(8) to run at boot. 89* Configuring svscan(8) to run at boot.
90* Creating and/or populating /service. 90* Creating and/or populating /service.
91* Using supervise(8) and multilog(8). 91* Using supervise(8) and multilog(8).
92* Using the qmailctl script to control qmail. 92* Using the qmailctl script to control qmail.
93* Using the inst_check script to verify the installation. 93* Using the inst_check script to verify the installation.
94* Storing tcp.smtp{,cdb} in /etc. 94* Storing tcp.smtp{,cdb} in /etc.
95* Renaming the system sendmail(8) and marking it non-executable. 95* Renaming the system sendmail(8) and marking it non-executable.
96 96
97Instead, the qmail-run package: 97Instead, the qmail-run package:
98* Provides NetBSD-style rc.d scripts, including one very similar to qmailctl. 98* Provides NetBSD-style rc.d scripts, including one very similar to qmailctl.
99* Sends log messages to syslog(3) by default. 99* Sends log messages to syslog(3) by default.
100* Stores tcprules in ${PKG_SYSCONFDIR}/control/tcprules. 100* Stores tcprules in ${PKG_SYSCONFDIR}/control/tcprules.
101* Uses mailwrapper(8) and mailer.conf(5). 101* Uses mailwrapper(8) and mailer.conf(5).

cvs diff -r1.21 -r1.22 pkgsrc/mail/qmail-run/files/qmailofmipd.sh (switch to unified diff)

--- pkgsrc/mail/qmail-run/files/qmailofmipd.sh 2018/12/14 06:55:07 1.21
+++ pkgsrc/mail/qmail-run/files/qmailofmipd.sh 2018/12/15 06:31:34 1.22
@@ -1,149 +1,149 @@ @@ -1,149 +1,149 @@
1#!@RCD_SCRIPTS_SHELL@ 1#!@RCD_SCRIPTS_SHELL@
2# 2#
3# $NetBSD: qmailofmipd.sh,v 1.21 2018/12/14 06:55:07 schmonz Exp $ 3# $NetBSD: qmailofmipd.sh,v 1.22 2018/12/15 06:31:34 schmonz Exp $
4# 4#
5# @PKGNAME@ script to control ofmipd (SMTP submission service). 5# @PKGNAME@ script to control ofmipd (SMTP submission service).
6# 6#
7 7
8# PROVIDE: qmailofmipd mail 8# PROVIDE: qmailofmipd mail
9# REQUIRE: qmailsend 9# REQUIRE: qmailsend
10 10
11name="qmailofmipd" 11name="qmailofmipd"
12 12
13# User-settable rc.conf variables and their default values: 13# User-settable rc.conf variables and their default values:
14: ${qmailofmipd_postenv:="SSL_UID=$(@ID@ -u @UCSPI_SSL_USER@) SSL_GID=$(@ID@ -g @UCSPI_SSL_GROUP@)"} 14: ${qmailofmipd_postenv:="SSL_UID=$(@ID@ -u @UCSPI_SSL_USER@) SSL_GID=$(@ID@ -g @UCSPI_SSL_GROUP@)"}
15: ${qmailofmipd_datalimit:="360000000"} 15: ${qmailofmipd_datalimit:="360000000"}
16: ${qmailofmipd_pretcpserver:=""} 16: ${qmailofmipd_pretcpserver:=""}
17: ${qmailofmipd_tcpserver:="@PREFIX@/bin/sslserver"} 17: ${qmailofmipd_tcpserver:="@PREFIX@/bin/sslserver"}
18: ${qmailofmipd_tcpflags:="-ne -vRl0"} 18: ${qmailofmipd_tcpflags:="-ne -vRl0"}
19: ${qmailofmipd_tcphost:="0.0.0.0"} 19: ${qmailofmipd_tcphost:="0.0.0.0"}
20: ${qmailofmipd_tcpport:="587"} 20: ${qmailofmipd_tcpport:="587"}
21: ${qmailofmipd_tcprules:="@PKG_SYSCONFDIR@/control/tcprules/ofmip"} 21: ${qmailofmipd_tcprules:="@PKG_SYSCONFDIR@/control/tcprules/ofmip"}
22: ${qmailofmipd_autocdb:="YES"} 22: ${qmailofmipd_autocdb:="YES"}
23: ${qmailofmipd_precheckpassword:="@PREFIX@/bin/reup -t 5 @PREFIX@/bin/authup smtp"} 23: ${qmailofmipd_precheckpassword:="@PREFIX@/bin/reup -t 5 @PREFIX@/bin/authup smtp"}
24: ${qmailofmipd_checkpassword:="@PREFIX@/bin/nbcheckpassword"} 24: ${qmailofmipd_checkpassword:="@PREFIX@/bin/nbcheckpassword"}
25: ${qmailofmipd_preofmipd:="@PREFIX@/bin/checknotroot @PREFIX@/bin/fixsmtpio"} 25: ${qmailofmipd_preofmipd:="@PREFIX@/bin/checknotroot @PREFIX@/bin/fixsmtpio"}
26: ${qmailofmipd_ofmipdcmd:="@PREFIX@/bin/ofmipd-with-user-cdb"} 26: ${qmailofmipd_ofmipdcmd:="@PREFIX@/bin/ofmipd-with-user-cdb"}
27: ${qmailofmipd_postofmipd:=""} 27: ${qmailofmipd_postofmipd:=""}
28: ${qmailofmipd_log:="YES"} 28: ${qmailofmipd_log:="YES"}
29: ${qmailofmipd_logcmd:="logger -t nbqmail/ofmipd -p mail.info"} 29: ${qmailofmipd_logcmd:="logger -t nbqmail/ofmipd -p mail.info"}
30: ${qmailofmipd_nologcmd:="@PREFIX@/bin/multilog -*"} 30: ${qmailofmipd_nologcmd:="@PREFIX@/bin/multilog -*"}
31: ${qmailofmipd_tls:="auto"} 31: ${qmailofmipd_tls:="auto"}
32: ${qmailofmipd_tls_dhparams:="@PKG_SYSCONFDIR@/control/dh2048.pem"} 32: ${qmailofmipd_tls_dhparams:="@PKG_SYSCONFDIR@/control/dh2048.pem"}
33: ${qmailofmipd_tls_cert:="@PKG_SYSCONFDIR@/control/servercert.pem"} 33: ${qmailofmipd_tls_cert:="@PKG_SYSCONFDIR@/control/servercert.pem"}
34: ${qmailofmipd_tls_key:=""} 34: ${qmailofmipd_tls_key:=""}
35 35
36if [ -f /etc/rc.subr ]; then 36if [ -f /etc/rc.subr ]; then
37 . /etc/rc.subr 37 . /etc/rc.subr
38fi 38fi
39 39
40rcvar=${name} 40rcvar=${name}
41required_files="@PKG_SYSCONFDIR@/control/me" 41required_files="@PKG_SYSCONFDIR@/control/me"
42required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencysubmission" 42required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencysubmission"
43required_files="${required_files} @PKG_SYSCONFDIR@/control/rcpthosts" 43required_files="${required_files} @PKG_SYSCONFDIR@/control/rcpthosts"
44required_files="${required_files} @PKG_SYSCONFDIR@/control/smtpcapabilities" 44required_files="${required_files} @PKG_SYSCONFDIR@/control/smtpcapabilities"
45required_files="${required_files} @PKG_SYSCONFDIR@/control/fixsmtpio" 45required_files="${required_files} @PKG_SYSCONFDIR@/control/fixsmtpio"
46required_files="${required_files} ${qmailofmipd_tcprules}.cdb" 46required_files="${required_files} ${qmailofmipd_tcprules}"
47command="${qmailofmipd_tcpserver}" 47command="${qmailofmipd_tcpserver}"
48procname=nb${name} 48procname=nb${name}
49start_precmd="qmailofmipd_precmd" 49start_precmd="qmailofmipd_precmd"
50extra_commands="stat pause cont cdb reload" 50extra_commands="stat pause cont cdb reload"
51stat_cmd="qmailofmipd_stat" 51stat_cmd="qmailofmipd_stat"
52pause_cmd="qmailofmipd_pause" 52pause_cmd="qmailofmipd_pause"
53cont_cmd="qmailofmipd_cont" 53cont_cmd="qmailofmipd_cont"
54cdb_cmd="qmailofmipd_cdb" 54cdb_cmd="qmailofmipd_cdb"
55reload_cmd=${cdb_cmd} 55reload_cmd=${cdb_cmd}
56 56
57qmailofmipd_configure_tls() { 57qmailofmipd_configure_tls() {
58 if [ "auto" = "${qmailofmipd_tls}" ]; then 58 if [ "auto" = "${qmailofmipd_tls}" ]; then
59 if [ -f "${qmailofmipd_tls_dhparams}" ] && [ -f "${qmailofmipd_tls_cert}" ]; then 59 if [ -f "${qmailofmipd_tls_dhparams}" ] && [ -f "${qmailofmipd_tls_cert}" ]; then
60 qmailofmipd_enable_tls 60 qmailofmipd_enable_tls
61 else 61 else
62 qmailofmipd_disable_tls 62 qmailofmipd_disable_tls
63 fi 63 fi
64 elif [ -f /etc/rc.subr ] && checkyesno qmailofmipd_tls; then 64 elif [ -f /etc/rc.subr ] && checkyesno qmailofmipd_tls; then
65 qmailofmipd_enable_tls 65 qmailofmipd_enable_tls
66 else 66 else
67 qmailofmipd_disable_tls 67 qmailofmipd_disable_tls
68 fi 68 fi
69} 69}
70 70
71qmailofmipd_disable_tls() { 71qmailofmipd_disable_tls() {
72 qmailofmipd_postenv="${qmailofmipd_postenv} DISABLETLS=1" 72 qmailofmipd_postenv="${qmailofmipd_postenv} DISABLETLS=1"
73} 73}
74 74
75qmailofmipd_enable_tls() { 75qmailofmipd_enable_tls() {
76 qmailofmipd_postenv="${qmailofmipd_postenv} DHFILE=${qmailofmipd_tls_dhparams}" 76 qmailofmipd_postenv="${qmailofmipd_postenv} DHFILE=${qmailofmipd_tls_dhparams}"
77 qmailofmipd_postenv="${qmailofmipd_postenv} CERTFILE=${qmailofmipd_tls_cert}" 77 qmailofmipd_postenv="${qmailofmipd_postenv} CERTFILE=${qmailofmipd_tls_cert}"
78 if [ -f "${qmailofmipd_tls_key}" ]; then 78 if [ -f "${qmailofmipd_tls_key}" ]; then
79 qmailofmipd_postenv="${qmailofmipd_postenv} KEYFILE=${qmailofmipd_tls_key}" 79 qmailofmipd_postenv="${qmailofmipd_postenv} KEYFILE=${qmailofmipd_tls_key}"
80 fi 80 fi
81} 81}
82 82
83qmailofmipd_precmd() { 83qmailofmipd_precmd() {
84 if [ -f /etc/rc.subr ] && ! checkyesno qmailofmipd_log; then 84 if [ -f /etc/rc.subr ] && ! checkyesno qmailofmipd_log; then
85 qmailofmipd_logcmd=${qmailofmipd_nologcmd} 85 qmailofmipd_logcmd=${qmailofmipd_nologcmd}
86 fi 86 fi
87 qmailofmipd_configure_tls 87 qmailofmipd_configure_tls
88 if [ -f /etc/rc.subr ] && checkyesno qmailofmipd_autocdb; then 88 if [ -f /etc/rc.subr ] && checkyesno qmailofmipd_autocdb; then
89 qmailofmipd_needcdb && qmailofmipd_cdb 89 qmailofmipd_needcdb && qmailofmipd_cdb
90 fi 90 fi
91 # tcpserver(1) is akin to inetd(8), but runs one service per process. 91 # tcpserver(1) is akin to inetd(8), but runs one service per process.
92 # We want to signal only the tcpserver process responsible for this 92 # We want to signal only the tcpserver process responsible for this
93 # service. Use argv0(1) to set procname to "nbqmailofmipd". 93 # service. Use argv0(1) to set procname to "nbqmailofmipd".
94 command="@PREFIX@/bin/pgrphack @SETENV@ - ${qmailofmipd_postenv} 94 command="@PREFIX@/bin/pgrphack @SETENV@ - ${qmailofmipd_postenv}
95@PREFIX@/bin/softlimit -m ${qmailofmipd_datalimit} ${qmailofmipd_pretcpserver} 95@PREFIX@/bin/softlimit -m ${qmailofmipd_datalimit} ${qmailofmipd_pretcpserver}
96@PREFIX@/bin/argv0 ${qmailofmipd_tcpserver} ${procname} 96@PREFIX@/bin/argv0 ${qmailofmipd_tcpserver} ${procname}
97${qmailofmipd_tcpflags} -x ${qmailofmipd_tcprules}.cdb 97${qmailofmipd_tcpflags} -x ${qmailofmipd_tcprules}.cdb
98-c `@HEAD@ -1 @PKG_SYSCONFDIR@/control/concurrencysubmission` 98-c `@HEAD@ -1 @PKG_SYSCONFDIR@/control/concurrencysubmission`
99${qmailofmipd_tcphost} ${qmailofmipd_tcpport} 99${qmailofmipd_tcphost} ${qmailofmipd_tcpport}
100${qmailofmipd_precheckpassword} ${qmailofmipd_checkpassword} 100${qmailofmipd_precheckpassword} ${qmailofmipd_checkpassword}
101${qmailofmipd_preofmipd} ${qmailofmipd_ofmipdcmd} ${qmailofmipd_postofmipd} 101${qmailofmipd_preofmipd} ${qmailofmipd_ofmipdcmd} ${qmailofmipd_postofmipd}
1022>&1 | 1022>&1 |
103@PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @QMAIL_LOG_USER@ ${qmailofmipd_logcmd}" 103@PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @QMAIL_LOG_USER@ ${qmailofmipd_logcmd}"
104 command_args="&" 104 command_args="&"
105 rc_flags="" 105 rc_flags=""
106} 106}
107 107
108qmailofmipd_stat() { 108qmailofmipd_stat() {
109 run_rc_command status 109 run_rc_command status
110} 110}
111 111
112qmailofmipd_pause() { 112qmailofmipd_pause() {
113 if ! statusmsg=`run_rc_command status`; then 113 if ! statusmsg=`run_rc_command status`; then
114 @ECHO@ $statusmsg 114 @ECHO@ $statusmsg
115 return 1 115 return 1
116 fi 116 fi
117 @ECHO@ "Pausing ${name}." 117 @ECHO@ "Pausing ${name}."
118 kill -STOP $rc_pid 118 kill -STOP $rc_pid
119} 119}
120 120
121qmailofmipd_cont() { 121qmailofmipd_cont() {
122 if ! statusmsg=`run_rc_command status`; then 122 if ! statusmsg=`run_rc_command status`; then
123 @ECHO@ $statusmsg 123 @ECHO@ $statusmsg
124 return 1 124 return 1
125 fi 125 fi
126 @ECHO@ "Continuing ${name}." 126 @ECHO@ "Continuing ${name}."
127 kill -CONT $rc_pid 127 kill -CONT $rc_pid
128} 128}
129 129
130qmailofmipd_needcdb() { 130qmailofmipd_needcdb() {
131 _src=${qmailofmipd_tcprules} 131 _src=${qmailofmipd_tcprules}
132 _dst=${qmailofmipd_tcprules}.cdb 132 _dst=${qmailofmipd_tcprules}.cdb
133 [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ] 133 [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ]
134} 134}
135 135
136qmailofmipd_cdb() { 136qmailofmipd_cdb() {
137 @ECHO@ "Reloading ${qmailofmipd_tcprules}" 137 @ECHO@ "Reloading ${qmailofmipd_tcprules}"
138 @PREFIX@/bin/tcprules ${qmailofmipd_tcprules}.cdb ${qmailofmipd_tcprules}.tmp < ${qmailofmipd_tcprules} 138 @PREFIX@/bin/tcprules ${qmailofmipd_tcprules}.cdb ${qmailofmipd_tcprules}.tmp < ${qmailofmipd_tcprules}
139 @CHMOD@ 644 ${qmailofmipd_tcprules}.cdb 139 @CHMOD@ 644 ${qmailofmipd_tcprules}.cdb
140} 140}
141 141
142if [ -f /etc/rc.subr ]; then 142if [ -f /etc/rc.subr ]; then
143 load_rc_config $name 143 load_rc_config $name
144 run_rc_command "$1" 144 run_rc_command "$1"
145else 145else
146 @ECHO_N@ " ${name}" 146 @ECHO_N@ " ${name}"
147 qmailofmipd_precmd 147 qmailofmipd_precmd
148 eval ${command} ${qmailofmipd_flags} ${command_args} 148 eval ${command} ${qmailofmipd_flags} ${command_args}
149fi 149fi

cvs diff -r1.29 -r1.30 pkgsrc/mail/qmail-run/files/qmailpop3d.sh (switch to unified diff)

--- pkgsrc/mail/qmail-run/files/qmailpop3d.sh 2018/12/14 06:55:07 1.29
+++ pkgsrc/mail/qmail-run/files/qmailpop3d.sh 2018/12/15 06:31:34 1.30
@@ -1,146 +1,146 @@ @@ -1,146 +1,146 @@
1#!@RCD_SCRIPTS_SHELL@ 1#!@RCD_SCRIPTS_SHELL@
2# 2#
3# $NetBSD: qmailpop3d.sh,v 1.29 2018/12/14 06:55:07 schmonz Exp $ 3# $NetBSD: qmailpop3d.sh,v 1.30 2018/12/15 06:31:34 schmonz Exp $
4# 4#
5# @PKGNAME@ script to control qmail-pop3d (POP3 server for Maildirs). 5# @PKGNAME@ script to control qmail-pop3d (POP3 server for Maildirs).
6# 6#
7 7
8# PROVIDE: qmailpop3d mail 8# PROVIDE: qmailpop3d mail
9 9
10name="qmailpop3d" 10name="qmailpop3d"
11 11
12# User-settable rc.conf variables and their default values: 12# User-settable rc.conf variables and their default values:
13: ${qmailpop3d_postenv:="SSL_UID=$(@ID@ -u @UCSPI_SSL_USER@) SSL_GID=$(@ID@ -g @UCSPI_SSL_GROUP@)"} 13: ${qmailpop3d_postenv:="SSL_UID=$(@ID@ -u @UCSPI_SSL_USER@) SSL_GID=$(@ID@ -g @UCSPI_SSL_GROUP@)"}
14: ${qmailpop3d_datalimit:="180000000"} 14: ${qmailpop3d_datalimit:="180000000"}
15: ${qmailpop3d_pretcpserver:=""} 15: ${qmailpop3d_pretcpserver:=""}
16: ${qmailpop3d_tcpserver:="@PREFIX@/bin/sslserver"} 16: ${qmailpop3d_tcpserver:="@PREFIX@/bin/sslserver"}
17: ${qmailpop3d_tcpflags:="-ne -vRl0"} 17: ${qmailpop3d_tcpflags:="-ne -vRl0"}
18: ${qmailpop3d_tcphost:="0.0.0.0"} 18: ${qmailpop3d_tcphost:="0.0.0.0"}
19: ${qmailpop3d_tcpport:="110"} 19: ${qmailpop3d_tcpport:="110"}
20: ${qmailpop3d_tcprules:="@PKG_SYSCONFDIR@/control/tcprules/pop3"} 20: ${qmailpop3d_tcprules:="@PKG_SYSCONFDIR@/control/tcprules/pop3"}
21: ${qmailpop3d_autocdb:="YES"} 21: ${qmailpop3d_autocdb:="YES"}
22: ${qmailpop3d_precheckpassword:="@PREFIX@/bin/authup pop3"} 22: ${qmailpop3d_precheckpassword:="@PREFIX@/bin/authup pop3"}
23: ${qmailpop3d_checkpassword:="@PREFIX@/bin/nbcheckpassword"} 23: ${qmailpop3d_checkpassword:="@PREFIX@/bin/nbcheckpassword"}
24: ${qmailpop3d_prepop3d:="@PREFIX@/bin/checknotroot"} 24: ${qmailpop3d_prepop3d:="@PREFIX@/bin/checknotroot"}
25: ${qmailpop3d_pop3dcmd:="@PREFIX@/bin/qmail-pop3d"} 25: ${qmailpop3d_pop3dcmd:="@PREFIX@/bin/qmail-pop3d"}
26: ${qmailpop3d_postpop3d:="Maildir"} 26: ${qmailpop3d_postpop3d:="Maildir"}
27: ${qmailpop3d_log:="YES"} 27: ${qmailpop3d_log:="YES"}
28: ${qmailpop3d_logcmd:="logger -t nbqmail/pop3d -p mail.info"} 28: ${qmailpop3d_logcmd:="logger -t nbqmail/pop3d -p mail.info"}
29: ${qmailpop3d_nologcmd:="@PREFIX@/bin/multilog -*"} 29: ${qmailpop3d_nologcmd:="@PREFIX@/bin/multilog -*"}
30: ${qmailpop3d_tls:="auto"} 30: ${qmailpop3d_tls:="auto"}
31: ${qmailpop3d_tls_dhparams:="@PKG_SYSCONFDIR@/control/dh2048.pem"} 31: ${qmailpop3d_tls_dhparams:="@PKG_SYSCONFDIR@/control/dh2048.pem"}
32: ${qmailpop3d_tls_cert:="@PKG_SYSCONFDIR@/control/servercert.pem"} 32: ${qmailpop3d_tls_cert:="@PKG_SYSCONFDIR@/control/servercert.pem"}
33: ${qmailpop3d_tls_key:=""} 33: ${qmailpop3d_tls_key:=""}
34 34
35if [ -f /etc/rc.subr ]; then 35if [ -f /etc/rc.subr ]; then
36 . /etc/rc.subr 36 . /etc/rc.subr
37fi 37fi
38 38
39rcvar=${name} 39rcvar=${name}
40required_files="@PKG_SYSCONFDIR@/control/me" 40required_files="@PKG_SYSCONFDIR@/control/me"
41required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencypop3" 41required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencypop3"
42required_files="${required_files} @PKG_SYSCONFDIR@/control/pop3capabilities" 42required_files="${required_files} @PKG_SYSCONFDIR@/control/pop3capabilities"
43required_files="${required_files} ${qmailpop3d_tcprules}.cdb" 43required_files="${required_files} ${qmailpop3d_tcprules}"
44command="${qmailpop3d_tcpserver}" 44command="${qmailpop3d_tcpserver}"
45procname=nb${name} 45procname=nb${name}
46start_precmd="qmailpop3d_precmd" 46start_precmd="qmailpop3d_precmd"
47extra_commands="stat pause cont cdb reload" 47extra_commands="stat pause cont cdb reload"
48stat_cmd="qmailpop3d_stat" 48stat_cmd="qmailpop3d_stat"
49pause_cmd="qmailpop3d_pause" 49pause_cmd="qmailpop3d_pause"
50cont_cmd="qmailpop3d_cont" 50cont_cmd="qmailpop3d_cont"
51cdb_cmd="qmailpop3d_cdb" 51cdb_cmd="qmailpop3d_cdb"
52reload_cmd=${cdb_cmd} 52reload_cmd=${cdb_cmd}
53 53
54qmailpop3d_configure_tls() { 54qmailpop3d_configure_tls() {
55 if [ "auto" = "${qmailpop3d_tls}" ]; then 55 if [ "auto" = "${qmailpop3d_tls}" ]; then
56 if [ -f "${qmailpop3d_tls_dhparams}" ] && [ -f "${qmailpop3d_tls_cert}" ]; then 56 if [ -f "${qmailpop3d_tls_dhparams}" ] && [ -f "${qmailpop3d_tls_cert}" ]; then
57 qmailpop3d_enable_tls 57 qmailpop3d_enable_tls
58 else 58 else
59 qmailpop3d_disable_tls 59 qmailpop3d_disable_tls
60 fi 60 fi
61 elif [ -f /etc/rc.subr ] && checkyesno qmailpop3d_tls; then 61 elif [ -f /etc/rc.subr ] && checkyesno qmailpop3d_tls; then
62 qmailpop3d_enable_tls 62 qmailpop3d_enable_tls
63 else 63 else
64 qmailpop3d_disable_tls 64 qmailpop3d_disable_tls
65 fi 65 fi
66} 66}
67 67
68qmailpop3d_disable_tls() { 68qmailpop3d_disable_tls() {
69 qmailpop3d_postenv="${qmailpop3d_postenv} DISABLETLS=1" 69 qmailpop3d_postenv="${qmailpop3d_postenv} DISABLETLS=1"
70} 70}
71 71
72qmailpop3d_enable_tls() { 72qmailpop3d_enable_tls() {
73 qmailpop3d_postenv="${qmailpop3d_postenv} DHFILE=${qmailpop3d_tls_dhparams}" 73 qmailpop3d_postenv="${qmailpop3d_postenv} DHFILE=${qmailpop3d_tls_dhparams}"
74 qmailpop3d_postenv="${qmailpop3d_postenv} CERTFILE=${qmailpop3d_tls_cert}" 74 qmailpop3d_postenv="${qmailpop3d_postenv} CERTFILE=${qmailpop3d_tls_cert}"
75 if [ -f "${qmailpop3d_tls_key}" ]; then 75 if [ -f "${qmailpop3d_tls_key}" ]; then
76 qmailpop3d_postenv="${qmailpop3d_postenv} KEYFILE=${qmailpop3d_tls_key}" 76 qmailpop3d_postenv="${qmailpop3d_postenv} KEYFILE=${qmailpop3d_tls_key}"
77 fi 77 fi
78} 78}
79 79
80qmailpop3d_precmd() { 80qmailpop3d_precmd() {
81 if [ -f /etc/rc.subr ] && ! checkyesno qmailpop3d_log; then 81 if [ -f /etc/rc.subr ] && ! checkyesno qmailpop3d_log; then
82 qmailpop3d_logcmd=${qmailpop3d_nologcmd} 82 qmailpop3d_logcmd=${qmailpop3d_nologcmd}
83 fi 83 fi
84 qmailpop3d_configure_tls 84 qmailpop3d_configure_tls
85 if [ -f /etc/rc.subr ] && checkyesno qmailpop3d_autocdb; then 85 if [ -f /etc/rc.subr ] && checkyesno qmailpop3d_autocdb; then
86 qmailpop3d_needcdb && qmailpop3d_cdb 86 qmailpop3d_needcdb && qmailpop3d_cdb
87 fi 87 fi
88 # tcpserver(1) is akin to inetd(8), but runs one service per process. 88 # tcpserver(1) is akin to inetd(8), but runs one service per process.
89 # We want to signal only the tcpserver process responsible for this 89 # We want to signal only the tcpserver process responsible for this
90 # service. Use argv0(1) to set procname to "nbqmailpop3d". 90 # service. Use argv0(1) to set procname to "nbqmailpop3d".
91 command="@PREFIX@/bin/pgrphack @SETENV@ - ${qmailpop3d_postenv} 91 command="@PREFIX@/bin/pgrphack @SETENV@ - ${qmailpop3d_postenv}
92@PREFIX@/bin/softlimit -m ${qmailpop3d_datalimit} ${qmailpop3d_pretcpserver} 92@PREFIX@/bin/softlimit -m ${qmailpop3d_datalimit} ${qmailpop3d_pretcpserver}
93@PREFIX@/bin/argv0 ${qmailpop3d_tcpserver} ${procname} 93@PREFIX@/bin/argv0 ${qmailpop3d_tcpserver} ${procname}
94${qmailpop3d_tcpflags} -x ${qmailpop3d_tcprules}.cdb 94${qmailpop3d_tcpflags} -x ${qmailpop3d_tcprules}.cdb
95-c `@HEAD@ -1 @PKG_SYSCONFDIR@/control/concurrencypop3` 95-c `@HEAD@ -1 @PKG_SYSCONFDIR@/control/concurrencypop3`
96${qmailpop3d_tcphost} ${qmailpop3d_tcpport} 96${qmailpop3d_tcphost} ${qmailpop3d_tcpport}
97${qmailpop3d_precheckpassword} ${qmailpop3d_checkpassword} 97${qmailpop3d_precheckpassword} ${qmailpop3d_checkpassword}
98${qmailpop3d_prepop3d} ${qmailpop3d_pop3dcmd} ${qmailpop3d_postpop3d} 98${qmailpop3d_prepop3d} ${qmailpop3d_pop3dcmd} ${qmailpop3d_postpop3d}
992>&1 | 992>&1 |
100@PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @QMAIL_LOG_USER@ ${qmailpop3d_logcmd}" 100@PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @QMAIL_LOG_USER@ ${qmailpop3d_logcmd}"
101 command_args="&" 101 command_args="&"
102 rc_flags="" 102 rc_flags=""
103} 103}
104 104
105qmailpop3d_stat() { 105qmailpop3d_stat() {
106 run_rc_command status 106 run_rc_command status
107} 107}
108 108
109qmailpop3d_pause() { 109qmailpop3d_pause() {
110 if ! statusmsg=`run_rc_command status`; then 110 if ! statusmsg=`run_rc_command status`; then
111 @ECHO@ $statusmsg 111 @ECHO@ $statusmsg
112 return 1 112 return 1
113 fi 113 fi
114 @ECHO@ "Pausing ${name}." 114 @ECHO@ "Pausing ${name}."
115 kill -STOP $rc_pid 115 kill -STOP $rc_pid
116} 116}
117 117
118qmailpop3d_cont() { 118qmailpop3d_cont() {
119 if ! statusmsg=`run_rc_command status`; then 119 if ! statusmsg=`run_rc_command status`; then
120 @ECHO@ $statusmsg 120 @ECHO@ $statusmsg
121 return 1 121 return 1
122 fi 122 fi
123 @ECHO@ "Continuing ${name}." 123 @ECHO@ "Continuing ${name}."
124 kill -CONT $rc_pid 124 kill -CONT $rc_pid
125} 125}
126 126
127qmailpop3d_needcdb() { 127qmailpop3d_needcdb() {
128 _src=${qmailpop3d_tcprules} 128 _src=${qmailpop3d_tcprules}
129 _dst=${qmailpop3d_tcprules}.cdb 129 _dst=${qmailpop3d_tcprules}.cdb
130 [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ] 130 [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ]
131} 131}
132 132
133qmailpop3d_cdb() { 133qmailpop3d_cdb() {
134 @ECHO@ "Reloading ${qmailpop3d_tcprules}." 134 @ECHO@ "Reloading ${qmailpop3d_tcprules}."
135 @PREFIX@/bin/tcprules ${qmailpop3d_tcprules}.cdb ${qmailpop3d_tcprules}.tmp < ${qmailpop3d_tcprules} 135 @PREFIX@/bin/tcprules ${qmailpop3d_tcprules}.cdb ${qmailpop3d_tcprules}.tmp < ${qmailpop3d_tcprules}
136 @CHMOD@ 644 ${qmailpop3d_tcprules}.cdb 136 @CHMOD@ 644 ${qmailpop3d_tcprules}.cdb
137} 137}
138 138
139if [ -f /etc/rc.subr ]; then 139if [ -f /etc/rc.subr ]; then
140 load_rc_config $name 140 load_rc_config $name
141 run_rc_command "$1" 141 run_rc_command "$1"
142else 142else
143 @ECHO_N@ " ${name}" 143 @ECHO_N@ " ${name}"
144 qmailpop3d_precmd 144 qmailpop3d_precmd
145 eval ${command} ${qmailpop3d_flags} ${command_args} 145 eval ${command} ${qmailpop3d_flags} ${command_args}
146fi 146fi

cvs diff -r1.26 -r1.27 pkgsrc/mail/qmail-run/files/qmailsmtpd.sh (switch to unified diff)

--- pkgsrc/mail/qmail-run/files/qmailsmtpd.sh 2018/12/14 06:55:07 1.26
+++ pkgsrc/mail/qmail-run/files/qmailsmtpd.sh 2018/12/15 06:31:34 1.27
@@ -1,145 +1,145 @@ @@ -1,145 +1,145 @@
1#!@RCD_SCRIPTS_SHELL@ 1#!@RCD_SCRIPTS_SHELL@
2# 2#
3# $NetBSD: qmailsmtpd.sh,v 1.26 2018/12/14 06:55:07 schmonz Exp $ 3# $NetBSD: qmailsmtpd.sh,v 1.27 2018/12/15 06:31:34 schmonz Exp $
4# 4#
5# @PKGNAME@ script to control qmail-smtpd (SMTP service). 5# @PKGNAME@ script to control qmail-smtpd (SMTP service).
6# 6#
7 7
8# PROVIDE: qmailsmtpd mail 8# PROVIDE: qmailsmtpd mail
9# REQUIRE: qmailsend 9# REQUIRE: qmailsend
10 10
11name="qmailsmtpd" 11name="qmailsmtpd"
12 12
13# User-settable rc.conf variables and their default values: 13# User-settable rc.conf variables and their default values:
14: ${qmailsmtpd_postenv:="SSL_UID=$(@ID@ -u @UCSPI_SSL_USER@) SSL_GID=$(@ID@ -g @UCSPI_SSL_GROUP@)"} 14: ${qmailsmtpd_postenv:="SSL_UID=$(@ID@ -u @UCSPI_SSL_USER@) SSL_GID=$(@ID@ -g @UCSPI_SSL_GROUP@)"}
15: ${qmailsmtpd_datalimit:="540000000"} 15: ${qmailsmtpd_datalimit:="540000000"}
16: ${qmailsmtpd_pretcpserver:=""} 16: ${qmailsmtpd_pretcpserver:=""}
17: ${qmailsmtpd_tcpserver:="@PREFIX@/bin/sslserver"} 17: ${qmailsmtpd_tcpserver:="@PREFIX@/bin/sslserver"}
18: ${qmailsmtpd_tcpflags:="-ne -vRl0"} 18: ${qmailsmtpd_tcpflags:="-ne -vRl0"}
19: ${qmailsmtpd_tcphost:="0.0.0.0"} 19: ${qmailsmtpd_tcphost:="0.0.0.0"}
20: ${qmailsmtpd_tcpport:="25"} 20: ${qmailsmtpd_tcpport:="25"}
21: ${qmailsmtpd_tcprules:="@PKG_SYSCONFDIR@/control/tcprules/smtp"} 21: ${qmailsmtpd_tcprules:="@PKG_SYSCONFDIR@/control/tcprules/smtp"}
22: ${qmailsmtpd_autocdb:="YES"} 22: ${qmailsmtpd_autocdb:="YES"}
23: ${qmailsmtpd_presmtpd:="@PREFIX@/bin/greetdelay @PREFIX@/bin/rblsmtpd -r zen.spamhaus.org @PREFIX@/bin/fixsmtpio"} 23: ${qmailsmtpd_presmtpd:="@PREFIX@/bin/greetdelay @PREFIX@/bin/rblsmtpd -r zen.spamhaus.org @PREFIX@/bin/fixsmtpio"}
24: ${qmailsmtpd_smtpdcmd:="@PREFIX@/bin/qmail-smtpd"} 24: ${qmailsmtpd_smtpdcmd:="@PREFIX@/bin/qmail-smtpd"}
25: ${qmailsmtpd_postsmtpd:=""} 25: ${qmailsmtpd_postsmtpd:=""}
26: ${qmailsmtpd_log:="YES"} 26: ${qmailsmtpd_log:="YES"}
27: ${qmailsmtpd_logcmd:="logger -t nbqmail/smtpd -p mail.info"} 27: ${qmailsmtpd_logcmd:="logger -t nbqmail/smtpd -p mail.info"}
28: ${qmailsmtpd_nologcmd:="@PREFIX@/bin/multilog -*"} 28: ${qmailsmtpd_nologcmd:="@PREFIX@/bin/multilog -*"}
29: ${qmailsmtpd_tls:="auto"} 29: ${qmailsmtpd_tls:="auto"}
30: ${qmailsmtpd_tls_dhparams:="@PKG_SYSCONFDIR@/control/dh2048.pem"} 30: ${qmailsmtpd_tls_dhparams:="@PKG_SYSCONFDIR@/control/dh2048.pem"}
31: ${qmailsmtpd_tls_cert:="@PKG_SYSCONFDIR@/control/servercert.pem"} 31: ${qmailsmtpd_tls_cert:="@PKG_SYSCONFDIR@/control/servercert.pem"}
32: ${qmailsmtpd_tls_key:=""} 32: ${qmailsmtpd_tls_key:=""}
33 33
34if [ -f /etc/rc.subr ]; then 34if [ -f /etc/rc.subr ]; then
35 . /etc/rc.subr 35 . /etc/rc.subr
36fi 36fi
37 37
38rcvar=${name} 38rcvar=${name}
39required_files="@PKG_SYSCONFDIR@/control/me" 39required_files="@PKG_SYSCONFDIR@/control/me"
40required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencyincoming" 40required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencyincoming"
41required_files="${required_files} @PKG_SYSCONFDIR@/control/rcpthosts" 41required_files="${required_files} @PKG_SYSCONFDIR@/control/rcpthosts"
42required_files="${required_files} ${qmailsmtpd_tcprules}.cdb" 42required_files="${required_files} ${qmailsmtpd_tcprules}"
43command="${qmailsmtpd_tcpserver}" 43command="${qmailsmtpd_tcpserver}"
44procname=nb${name} 44procname=nb${name}
45start_precmd="qmailsmtpd_precmd" 45start_precmd="qmailsmtpd_precmd"
46extra_commands="stat pause cont cdb reload" 46extra_commands="stat pause cont cdb reload"
47stat_cmd="qmailsmtpd_stat" 47stat_cmd="qmailsmtpd_stat"
48pause_cmd="qmailsmtpd_pause" 48pause_cmd="qmailsmtpd_pause"
49cont_cmd="qmailsmtpd_cont" 49cont_cmd="qmailsmtpd_cont"
50cdb_cmd="qmailsmtpd_cdb" 50cdb_cmd="qmailsmtpd_cdb"
51reload_cmd=${cdb_cmd} 51reload_cmd=${cdb_cmd}
52 52
53qmailsmtpd_configure_tls() { 53qmailsmtpd_configure_tls() {
54 if [ "auto" = "${qmailsmtpd_tls}" ]; then 54 if [ "auto" = "${qmailsmtpd_tls}" ]; then
55 if [ -f "${qmailsmtpd_tls_dhparams}" ] && [ -f "${qmailsmtpd_tls_cert}" ]; then 55 if [ -f "${qmailsmtpd_tls_dhparams}" ] && [ -f "${qmailsmtpd_tls_cert}" ]; then
56 qmailsmtpd_enable_tls 56 qmailsmtpd_enable_tls
57 else 57 else
58 qmailsmtpd_disable_tls 58 qmailsmtpd_disable_tls
59 fi 59 fi
60 elif [ -f /etc/rc.subr ] && checkyesno qmailsmtpd_tls; then 60 elif [ -f /etc/rc.subr ] && checkyesno qmailsmtpd_tls; then
61 qmailsmtpd_enable_tls 61 qmailsmtpd_enable_tls
62 else 62 else
63 qmailsmtpd_disable_tls 63 qmailsmtpd_disable_tls
64 fi 64 fi
65} 65}
66 66
67qmailsmtpd_disable_tls() { 67qmailsmtpd_disable_tls() {
68 qmailsmtpd_postenv="${qmailsmtpd_postenv} DISABLETLS=1" 68 qmailsmtpd_postenv="${qmailsmtpd_postenv} DISABLETLS=1"
69} 69}
70 70
71qmailsmtpd_enable_tls() { 71qmailsmtpd_enable_tls() {
72 qmailsmtpd_postenv="${qmailsmtpd_postenv} DHFILE=${qmailsmtpd_tls_dhparams}" 72 qmailsmtpd_postenv="${qmailsmtpd_postenv} DHFILE=${qmailsmtpd_tls_dhparams}"
73 qmailsmtpd_postenv="${qmailsmtpd_postenv} CERTFILE=${qmailsmtpd_tls_cert}" 73 qmailsmtpd_postenv="${qmailsmtpd_postenv} CERTFILE=${qmailsmtpd_tls_cert}"
74 if [ -f "${qmailsmtpd_tls_key}" ]; then 74 if [ -f "${qmailsmtpd_tls_key}" ]; then
75 qmailsmtpd_postenv="${qmailsmtpd_postenv} KEYFILE=${qmailsmtpd_tls_key}" 75 qmailsmtpd_postenv="${qmailsmtpd_postenv} KEYFILE=${qmailsmtpd_tls_key}"
76 fi 76 fi
77} 77}
78 78
79qmailsmtpd_precmd() { 79qmailsmtpd_precmd() {
80 if [ -f /etc/rc.subr ] && ! checkyesno qmailsmtpd_log; then 80 if [ -f /etc/rc.subr ] && ! checkyesno qmailsmtpd_log; then
81 qmailsmtpd_logcmd=${qmailsmtpd_nologcmd} 81 qmailsmtpd_logcmd=${qmailsmtpd_nologcmd}
82 fi 82 fi
83 qmailsmtpd_configure_tls 83 qmailsmtpd_configure_tls
84 if [ -f /etc/rc.subr ] && checkyesno qmailsmtpd_autocdb; then 84 if [ -f /etc/rc.subr ] && checkyesno qmailsmtpd_autocdb; then
85 qmailsmtpd_needcdb && qmailsmtpd_cdb 85 qmailsmtpd_needcdb && qmailsmtpd_cdb
86 fi 86 fi
87 # tcpserver(1) is akin to inetd(8), but runs one service per process. 87 # tcpserver(1) is akin to inetd(8), but runs one service per process.
88 # We want to signal only the tcpserver process responsible for this 88 # We want to signal only the tcpserver process responsible for this
89 # service. Use argv0(1) to set procname to "nbqmailsmtpd". 89 # service. Use argv0(1) to set procname to "nbqmailsmtpd".
90 command="@PREFIX@/bin/pgrphack @SETENV@ - ${qmailsmtpd_postenv} 90 command="@PREFIX@/bin/pgrphack @SETENV@ - ${qmailsmtpd_postenv}
91@PREFIX@/bin/softlimit -m ${qmailsmtpd_datalimit} ${qmailsmtpd_pretcpserver} 91@PREFIX@/bin/softlimit -m ${qmailsmtpd_datalimit} ${qmailsmtpd_pretcpserver}
92@PREFIX@/bin/argv0 ${qmailsmtpd_tcpserver} ${procname} 92@PREFIX@/bin/argv0 ${qmailsmtpd_tcpserver} ${procname}
93${qmailsmtpd_tcpflags} -x ${qmailsmtpd_tcprules}.cdb 93${qmailsmtpd_tcpflags} -x ${qmailsmtpd_tcprules}.cdb
94-c `@HEAD@ -1 @PKG_SYSCONFDIR@/control/concurrencyincoming` 94-c `@HEAD@ -1 @PKG_SYSCONFDIR@/control/concurrencyincoming`
95-u `@ID@ -u @QMAIL_DAEMON_USER@` -g `@ID@ -g @QMAIL_DAEMON_USER@` 95-u `@ID@ -u @QMAIL_DAEMON_USER@` -g `@ID@ -g @QMAIL_DAEMON_USER@`
96${qmailsmtpd_tcphost} ${qmailsmtpd_tcpport} 96${qmailsmtpd_tcphost} ${qmailsmtpd_tcpport}
97${qmailsmtpd_presmtpd} ${qmailsmtpd_smtpdcmd} ${qmailsmtpd_postsmtpd} 97${qmailsmtpd_presmtpd} ${qmailsmtpd_smtpdcmd} ${qmailsmtpd_postsmtpd}
982>&1 | 982>&1 |
99@PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @QMAIL_LOG_USER@ ${qmailsmtpd_logcmd}" 99@PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @QMAIL_LOG_USER@ ${qmailsmtpd_logcmd}"
100 command_args="&" 100 command_args="&"
101 rc_flags="" 101 rc_flags=""
102} 102}
103 103
104qmailsmtpd_stat() { 104qmailsmtpd_stat() {
105 run_rc_command status 105 run_rc_command status
106} 106}
107 107
108qmailsmtpd_pause() { 108qmailsmtpd_pause() {
109 if ! statusmsg=`run_rc_command status`; then 109 if ! statusmsg=`run_rc_command status`; then
110 @ECHO@ $statusmsg 110 @ECHO@ $statusmsg
111 return 1 111 return 1
112 fi 112 fi
113 @ECHO@ "Pausing ${name}." 113 @ECHO@ "Pausing ${name}."
114 kill -STOP $rc_pid 114 kill -STOP $rc_pid
115} 115}
116 116
117qmailsmtpd_cont() { 117qmailsmtpd_cont() {
118 if ! statusmsg=`run_rc_command status`; then 118 if ! statusmsg=`run_rc_command status`; then
119 @ECHO@ $statusmsg 119 @ECHO@ $statusmsg
120 return 1 120 return 1
121 fi 121 fi
122 @ECHO@ "Continuing ${name}." 122 @ECHO@ "Continuing ${name}."
123 kill -CONT $rc_pid 123 kill -CONT $rc_pid
124} 124}
125 125
126qmailsmtpd_needcdb() { 126qmailsmtpd_needcdb() {
127 _src=${qmailsmtpd_tcprules} 127 _src=${qmailsmtpd_tcprules}
128 _dst=${qmailsmtpd_tcprules}.cdb 128 _dst=${qmailsmtpd_tcprules}.cdb
129 [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ] 129 [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ]
130} 130}
131 131
132qmailsmtpd_cdb() { 132qmailsmtpd_cdb() {
133 @ECHO@ "Reloading ${qmailsmtpd_tcprules}." 133 @ECHO@ "Reloading ${qmailsmtpd_tcprules}."
134 @PREFIX@/bin/tcprules ${qmailsmtpd_tcprules}.cdb ${qmailsmtpd_tcprules}.tmp < ${qmailsmtpd_tcprules} 134 @PREFIX@/bin/tcprules ${qmailsmtpd_tcprules}.cdb ${qmailsmtpd_tcprules}.tmp < ${qmailsmtpd_tcprules}
135 @CHMOD@ 644 ${qmailsmtpd_tcprules}.cdb 135 @CHMOD@ 644 ${qmailsmtpd_tcprules}.cdb
136} 136}
137 137
138if [ -f /etc/rc.subr ]; then 138if [ -f /etc/rc.subr ]; then
139 load_rc_config $name 139 load_rc_config $name
140 run_rc_command "$1" 140 run_rc_command "$1"
141else 141else
142 @ECHO_N@ " ${name}" 142 @ECHO_N@ " ${name}"
143 qmailsmtpd_precmd 143 qmailsmtpd_precmd
144 eval ${command} ${qmailsmtpd_flags} ${command_args} 144 eval ${command} ${qmailsmtpd_flags} ${command_args}
145fi 145fi