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.diff -r1.65 -r1.66 pkgsrc/mail/qmail-run/Makefile
(schmonz)
@@ -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 | |||
4 | DISTNAME= qmail-run-20181214 | 4 | DISTNAME= qmail-run-20181215 | |
5 | CATEGORIES= mail | 5 | CATEGORIES= mail | |
6 | MASTER_SITES= # empty | 6 | MASTER_SITES= # empty | |
7 | DISTFILES= # empty | 7 | DISTFILES= # empty | |
8 | 8 | |||
9 | MAINTAINER= schmonz@NetBSD.org | 9 | MAINTAINER= schmonz@NetBSD.org | |
10 | COMMENT= Configures qmail to receive and deliver mail | 10 | COMMENT= Configures qmail to receive and deliver mail | |
11 | LICENSE= 2-clause-bsd | 11 | LICENSE= 2-clause-bsd | |
12 | 12 | |||
13 | DEPENDS+= greetdelay-[0-9]*:../../mail/greetdelay | 13 | DEPENDS+= greetdelay-[0-9]*:../../mail/greetdelay | |
14 | DEPENDS+= greylisting-spp-[0-9]*:../../mail/greylisting-spp | 14 | DEPENDS+= greylisting-spp-[0-9]*:../../mail/greylisting-spp | |
15 | DEPENDS+= pkg_alternatives-[0-9]*:../../pkgtools/pkg_alternatives | 15 | DEPENDS+= pkg_alternatives-[0-9]*:../../pkgtools/pkg_alternatives | |
16 | DEPENDS_QMAIL= qmail>=1.03nb42:../../mail/qmail | 16 | DEPENDS_QMAIL= qmail>=1.03nb42:../../mail/qmail | |
17 | DEPENDS+= ${DEPENDS_QMAIL} | 17 | DEPENDS+= ${DEPENDS_QMAIL} | |
18 | DEPENDS+= qmail-acceptutils>=20181128:../../mail/qmail-acceptutils | 18 | DEPENDS+= qmail-acceptutils>=20181128:../../mail/qmail-acceptutils | |
19 | DEPENDS+= qmail-qfilter>1.5nb1:../../mail/qmail-qfilter | 19 | DEPENDS+= qmail-qfilter>1.5nb1:../../mail/qmail-qfilter | |
20 | DEPENDS+= qmail-rejectutils>=20181128:../../mail/qmail-rejectutils | 20 | DEPENDS+= qmail-rejectutils>=20181128:../../mail/qmail-rejectutils | |
21 | DEPENDS+= qmail-spp-spf-[0-9]*:../../mail/qmail-spp-spf | 21 | DEPENDS+= qmail-spp-spf-[0-9]*:../../mail/qmail-spp-spf | |
22 | 22 | |||
23 | WRKSRC= ${WRKDIR} | 23 | WRKSRC= ${WRKDIR} | |
24 | NO_BUILD= yes | 24 | NO_BUILD= yes | |
25 | NO_CHECKSUM= yes | 25 | NO_CHECKSUM= yes | |
26 | 26 | |||
27 | FILES_SUBST+= QMAIL_DAEMON_USER=${QMAIL_DAEMON_USER:Q} | 27 | FILES_SUBST+= QMAIL_DAEMON_USER=${QMAIL_DAEMON_USER:Q} | |
28 | FILES_SUBST+= QMAIL_LOG_USER=${QMAIL_LOG_USER:Q} | 28 | FILES_SUBST+= QMAIL_LOG_USER=${QMAIL_LOG_USER:Q} | |
29 | FILES_SUBST+= QMAIL_SEND_USER=${QMAIL_SEND_USER:Q} | 29 | FILES_SUBST+= QMAIL_SEND_USER=${QMAIL_SEND_USER:Q} | |
30 | FILES_SUBST+= PKGNAME=${PKGNAME:Q} | 30 | FILES_SUBST+= PKGNAME=${PKGNAME:Q} | |
31 | FILES_SUBST+= UCSPI_SSL_USER=${UCSPI_SSL_USER:Q} | 31 | FILES_SUBST+= UCSPI_SSL_USER=${UCSPI_SSL_USER:Q} | |
32 | FILES_SUBST+= UCSPI_SSL_GROUP=${UCSPI_SSL_GROUP:Q} | 32 | FILES_SUBST+= UCSPI_SSL_GROUP=${UCSPI_SSL_GROUP:Q} | |
33 | MESSAGE_SUBST+= PKG_SYSCONFBASE=${PKG_SYSCONFBASE:Q} | 33 | MESSAGE_SUBST+= PKG_SYSCONFBASE=${PKG_SYSCONFBASE:Q} | |
34 | RCD_SCRIPTS= qmail qmailofmipd qmailpop3d qmailqread qmailsend qmailsmtpd | 34 | RCD_SCRIPTS= qmail qmailofmipd qmailpop3d qmailqread qmailsend qmailsmtpd | |
35 | 35 | |||
36 | EGDIR= share/examples/qmail-run | 36 | EGDIR= 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 | |
41 | CONF_FILES+= ${PREFIX}/${EGDIR}/${f} \ | 41 | CONF_FILES+= ${PREFIX}/${EGDIR}/${f} \ | |
42 | ${PKG_SYSCONFDIR}/control/${f} | 42 | ${PKG_SYSCONFDIR}/control/${f} | |
43 | .endfor | 43 | .endfor | |
44 | TCPRULESDIR= ${PKG_SYSCONFDIR}/control/tcprules | 44 | TCPRULESDIR= ${PKG_SYSCONFDIR}/control/tcprules | |
45 | OWN_DIRS+= ${TCPRULESDIR} | 45 | OWN_DIRS+= ${TCPRULESDIR} | |
46 | .for f in ofmip pop3 smtp | 46 | .for f in ofmip pop3 smtp | |
47 | CONF_FILES+= ${PREFIX}/${EGDIR}/tcprules-${f} \ | 47 | CONF_FILES+= ${PREFIX}/${EGDIR}/tcprules-${f} \ | |
48 | ${TCPRULESDIR}/${f} | 48 | ${TCPRULESDIR}/${f} | |
49 | .endfor | 49 | .endfor | |
50 | GREYLISTDIR= ${PKG_SYSCONFDIR}/control/greylist | 50 | GREYLISTDIR= ${PKG_SYSCONFDIR}/control/greylist | |
51 | OWN_DIRS_PERMS+= ${GREYLISTDIR} ${QMAIL_DAEMON_USER} ${QMAIL_QMAIL_GROUP} 775 | 51 | OWN_DIRS_PERMS+= ${GREYLISTDIR} ${QMAIL_DAEMON_USER} ${QMAIL_QMAIL_GROUP} 775 | |
52 | CONF_FILES_PERMS+= ${PREFIX}/${EGDIR}/greylist-database ${GREYLISTDIR}/database ${QMAIL_DAEMON_USER} ${QMAIL_QMAIL_GROUP} 664 | 52 | CONF_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 | |
54 | CONF_FILES+= ${PREFIX}/${EGDIR}/greylist-${f} \ | 54 | CONF_FILES+= ${PREFIX}/${EGDIR}/greylist-${f} \ | |
55 | ${GREYLISTDIR}/${f} | 55 | ${GREYLISTDIR}/${f} | |
56 | .endfor | 56 | .endfor | |
57 | 57 | |||
58 | INSTALLATION_DIRS= bin share/doc/qmail-run ${EGDIR} | 58 | INSTALLATION_DIRS= bin share/doc/qmail-run ${EGDIR} | |
59 | BUILD_DEFS+= QMAIL_DAEMON_USER QMAIL_LOG_USER QMAIL_SEND_USER | 59 | BUILD_DEFS+= QMAIL_DAEMON_USER QMAIL_LOG_USER QMAIL_SEND_USER | |
60 | BUILD_DEFS+= QMAIL_QMAIL_GROUP PKG_SYSCONFBASE | 60 | BUILD_DEFS+= QMAIL_QMAIL_GROUP PKG_SYSCONFBASE | |
61 | BUILD_DEFS+= UCSPI_SSL_USER UCSPI_SSL_GROUP | 61 | BUILD_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) | |
69 | PKG_SYSCONFDIR.qmail-run!= \ | 69 | PKG_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) | |
74 | MAKEVARS+= PKG_SYSCONFDIR.qmail-run | 74 | MAKEVARS+= PKG_SYSCONFDIR.qmail-run | |
75 | . endif | 75 | . endif | |
76 | .endif | 76 | .endif | |
77 | 77 | |||
78 | SUBST_CLASSES+= paths | 78 | SUBST_CLASSES+= paths | |
79 | SUBST_STAGE.paths= pre-configure | 79 | SUBST_STAGE.paths= pre-configure | |
80 | SUBST_FILES.paths= mailer.conf | 80 | SUBST_FILES.paths= mailer.conf | |
81 | SUBST_FILES.paths+= greylisting-spp-wrapper ofmipd-with-user-cdb | 81 | SUBST_FILES.paths+= greylisting-spp-wrapper ofmipd-with-user-cdb | |
82 | SUBST_FILES.paths+= qmail-isspam-* qmail-procmail qmail-qread-client | 82 | SUBST_FILES.paths+= qmail-isspam-* qmail-procmail qmail-qread-client | |
83 | SUBST_FILES.paths+= rcptchecks ofmipfilters smtpfilters smtpplugins tcprules-* | 83 | SUBST_FILES.paths+= rcptchecks ofmipfilters smtpfilters smtpplugins tcprules-* | |
84 | SUBST_VARS.paths= PKGNAME PKG_SYSCONFDIR PREFIX | 84 | SUBST_VARS.paths= PKGNAME PKG_SYSCONFDIR PREFIX | |
85 | SUBST_VARS.paths+= CAT ECHO GREP SED SH SORT TRUE | 85 | SUBST_VARS.paths+= CAT ECHO GREP SED SH SORT TRUE | |
86 | 86 | |||
87 | post-extract: | 87 | post-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 | |||
102 | do-install: | 102 | do-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" |
@@ -1,101 +1,101 @@ | @@ -1,101 +1,101 @@ | |||
1 | Getting started | 1 | Getting started | |
2 | =============== | 2 | =============== | |
3 | 3 | |||
4 | Assuming NetBSD-style mailwrapper(8) and rc(8), to enable qmail for... | 4 | Assuming NetBSD-style mailwrapper(8) and rc(8), to enable qmail for... | |
5 | 5 | |||
6 | Local and outbound delivery: | 6 | Local 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 | |||
13 | Incoming SMTP on port 25: | 13 | Incoming 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 | |||
20 | Greylisting: | 20 | Greylisting: | |
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 | |||
28 | Authenticated message submission on port 587: | 28 | Authenticated 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 | |||
33 | POP3 (for Maildirs only) on port 110: | 33 | POP3 (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 | |||
37 | TLS encryption for SMTP, submission, POP3, and remote delivery: | 37 | TLS 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 | |||
41 | Sender Policy Framework: | 41 | Sender 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 | |||
59 | You've installed an automated and customized qmail-run package. If | 59 | You've installed an automated and customized qmail-run package. If | |
60 | you're having trouble getting the qmail daemons to run, ask the | 60 | you're having trouble getting the qmail daemons to run, ask the | |
61 | package's maintainer: | 61 | package's maintainer: | |
62 | 62 | |||
63 | <URL:mailto:schmonz-pkgsrc-qmail@schmonz.com> | 63 | <URL:mailto:schmonz-pkgsrc-qmail@schmonz.com> | |
64 | 64 | |||
65 | Many members of the qmail mailing list recommend following the | 65 | Many members of the qmail mailing list recommend following the | |
66 | install instructions in Dave Sill's "Life with qmail" document: | 66 | install 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 | |||
70 | A "Life with qmail" installation is done by hand, so any qmail | 70 | A "Life with qmail" installation is done by hand, so any qmail | |
71 | package necessarily deviates from LWQ in at least this respect. | 71 | package necessarily deviates from LWQ in at least this respect. | |
72 | Therefore, if you need to ask for help on the qmail list, please | 72 | Therefore, if you need to ask for help on the qmail list, please | |
73 | mention that you're using the qmail-run package from pkgsrc. | 73 | mention that you're using the qmail-run package from pkgsrc. | |
74 | 74 | |||
75 | If you can first reproduce your problem on a manual LWQ-style | 75 | If you can first reproduce your problem on a manual LWQ-style | |
76 | installation, your request for help is likely to be better received. | 76 | installation, your request for help is likely to be better received. | |
77 | 77 | |||
78 | It is highly recommended that you read Charles Cazabon's "12 Steps | 78 | It is highly recommended that you read Charles Cazabon's "12 Steps | |
79 | to qmail List Bliss" before posting to the list: | 79 | to 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 | |||
87 | LWQ suggests doing some things that the qmail-run package doesn't do: | 87 | LWQ 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 | |||
97 | Instead, the qmail-run package: | 97 | Instead, 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). |
@@ -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 | |||
11 | name="qmailofmipd" | 11 | name="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 | |||
36 | if [ -f /etc/rc.subr ]; then | 36 | if [ -f /etc/rc.subr ]; then | |
37 | . /etc/rc.subr | 37 | . /etc/rc.subr | |
38 | fi | 38 | fi | |
39 | 39 | |||
40 | rcvar=${name} | 40 | rcvar=${name} | |
41 | required_files="@PKG_SYSCONFDIR@/control/me" | 41 | required_files="@PKG_SYSCONFDIR@/control/me" | |
42 | required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencysubmission" | 42 | required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencysubmission" | |
43 | required_files="${required_files} @PKG_SYSCONFDIR@/control/rcpthosts" | 43 | required_files="${required_files} @PKG_SYSCONFDIR@/control/rcpthosts" | |
44 | required_files="${required_files} @PKG_SYSCONFDIR@/control/smtpcapabilities" | 44 | required_files="${required_files} @PKG_SYSCONFDIR@/control/smtpcapabilities" | |
45 | required_files="${required_files} @PKG_SYSCONFDIR@/control/fixsmtpio" | 45 | required_files="${required_files} @PKG_SYSCONFDIR@/control/fixsmtpio" | |
46 | required_files="${required_files} ${qmailofmipd_tcprules}.cdb" | 46 | required_files="${required_files} ${qmailofmipd_tcprules}" | |
47 | command="${qmailofmipd_tcpserver}" | 47 | command="${qmailofmipd_tcpserver}" | |
48 | procname=nb${name} | 48 | procname=nb${name} | |
49 | start_precmd="qmailofmipd_precmd" | 49 | start_precmd="qmailofmipd_precmd" | |
50 | extra_commands="stat pause cont cdb reload" | 50 | extra_commands="stat pause cont cdb reload" | |
51 | stat_cmd="qmailofmipd_stat" | 51 | stat_cmd="qmailofmipd_stat" | |
52 | pause_cmd="qmailofmipd_pause" | 52 | pause_cmd="qmailofmipd_pause" | |
53 | cont_cmd="qmailofmipd_cont" | 53 | cont_cmd="qmailofmipd_cont" | |
54 | cdb_cmd="qmailofmipd_cdb" | 54 | cdb_cmd="qmailofmipd_cdb" | |
55 | reload_cmd=${cdb_cmd} | 55 | reload_cmd=${cdb_cmd} | |
56 | 56 | |||
57 | qmailofmipd_configure_tls() { | 57 | qmailofmipd_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 | |||
71 | qmailofmipd_disable_tls() { | 71 | qmailofmipd_disable_tls() { | |
72 | qmailofmipd_postenv="${qmailofmipd_postenv} DISABLETLS=1" | 72 | qmailofmipd_postenv="${qmailofmipd_postenv} DISABLETLS=1" | |
73 | } | 73 | } | |
74 | 74 | |||
75 | qmailofmipd_enable_tls() { | 75 | qmailofmipd_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 | |||
83 | qmailofmipd_precmd() { | 83 | qmailofmipd_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} | |
102 | 2>&1 | | 102 | 2>&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 | |||
108 | qmailofmipd_stat() { | 108 | qmailofmipd_stat() { | |
109 | run_rc_command status | 109 | run_rc_command status | |
110 | } | 110 | } | |
111 | 111 | |||
112 | qmailofmipd_pause() { | 112 | qmailofmipd_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 | |||
121 | qmailofmipd_cont() { | 121 | qmailofmipd_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 | |||
130 | qmailofmipd_needcdb() { | 130 | qmailofmipd_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 | |||
136 | qmailofmipd_cdb() { | 136 | qmailofmipd_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 | |||
142 | if [ -f /etc/rc.subr ]; then | 142 | if [ -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" | |
145 | else | 145 | else | |
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} | |
149 | fi | 149 | fi |
@@ -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 | |||
10 | name="qmailpop3d" | 10 | name="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 | |||
35 | if [ -f /etc/rc.subr ]; then | 35 | if [ -f /etc/rc.subr ]; then | |
36 | . /etc/rc.subr | 36 | . /etc/rc.subr | |
37 | fi | 37 | fi | |
38 | 38 | |||
39 | rcvar=${name} | 39 | rcvar=${name} | |
40 | required_files="@PKG_SYSCONFDIR@/control/me" | 40 | required_files="@PKG_SYSCONFDIR@/control/me" | |
41 | required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencypop3" | 41 | required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencypop3" | |
42 | required_files="${required_files} @PKG_SYSCONFDIR@/control/pop3capabilities" | 42 | required_files="${required_files} @PKG_SYSCONFDIR@/control/pop3capabilities" | |
43 | required_files="${required_files} ${qmailpop3d_tcprules}.cdb" | 43 | required_files="${required_files} ${qmailpop3d_tcprules}" | |
44 | command="${qmailpop3d_tcpserver}" | 44 | command="${qmailpop3d_tcpserver}" | |
45 | procname=nb${name} | 45 | procname=nb${name} | |
46 | start_precmd="qmailpop3d_precmd" | 46 | start_precmd="qmailpop3d_precmd" | |
47 | extra_commands="stat pause cont cdb reload" | 47 | extra_commands="stat pause cont cdb reload" | |
48 | stat_cmd="qmailpop3d_stat" | 48 | stat_cmd="qmailpop3d_stat" | |
49 | pause_cmd="qmailpop3d_pause" | 49 | pause_cmd="qmailpop3d_pause" | |
50 | cont_cmd="qmailpop3d_cont" | 50 | cont_cmd="qmailpop3d_cont" | |
51 | cdb_cmd="qmailpop3d_cdb" | 51 | cdb_cmd="qmailpop3d_cdb" | |
52 | reload_cmd=${cdb_cmd} | 52 | reload_cmd=${cdb_cmd} | |
53 | 53 | |||
54 | qmailpop3d_configure_tls() { | 54 | qmailpop3d_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 | |||
68 | qmailpop3d_disable_tls() { | 68 | qmailpop3d_disable_tls() { | |
69 | qmailpop3d_postenv="${qmailpop3d_postenv} DISABLETLS=1" | 69 | qmailpop3d_postenv="${qmailpop3d_postenv} DISABLETLS=1" | |
70 | } | 70 | } | |
71 | 71 | |||
72 | qmailpop3d_enable_tls() { | 72 | qmailpop3d_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 | |||
80 | qmailpop3d_precmd() { | 80 | qmailpop3d_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} | |
99 | 2>&1 | | 99 | 2>&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 | |||
105 | qmailpop3d_stat() { | 105 | qmailpop3d_stat() { | |
106 | run_rc_command status | 106 | run_rc_command status | |
107 | } | 107 | } | |
108 | 108 | |||
109 | qmailpop3d_pause() { | 109 | qmailpop3d_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 | |||
118 | qmailpop3d_cont() { | 118 | qmailpop3d_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 | |||
127 | qmailpop3d_needcdb() { | 127 | qmailpop3d_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 | |||
133 | qmailpop3d_cdb() { | 133 | qmailpop3d_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 | |||
139 | if [ -f /etc/rc.subr ]; then | 139 | if [ -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" | |
142 | else | 142 | else | |
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} | |
146 | fi | 146 | fi |
@@ -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 | |||
11 | name="qmailsmtpd" | 11 | name="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 | |||
34 | if [ -f /etc/rc.subr ]; then | 34 | if [ -f /etc/rc.subr ]; then | |
35 | . /etc/rc.subr | 35 | . /etc/rc.subr | |
36 | fi | 36 | fi | |
37 | 37 | |||
38 | rcvar=${name} | 38 | rcvar=${name} | |
39 | required_files="@PKG_SYSCONFDIR@/control/me" | 39 | required_files="@PKG_SYSCONFDIR@/control/me" | |
40 | required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencyincoming" | 40 | required_files="${required_files} @PKG_SYSCONFDIR@/control/concurrencyincoming" | |
41 | required_files="${required_files} @PKG_SYSCONFDIR@/control/rcpthosts" | 41 | required_files="${required_files} @PKG_SYSCONFDIR@/control/rcpthosts" | |
42 | required_files="${required_files} ${qmailsmtpd_tcprules}.cdb" | 42 | required_files="${required_files} ${qmailsmtpd_tcprules}" | |
43 | command="${qmailsmtpd_tcpserver}" | 43 | command="${qmailsmtpd_tcpserver}" | |
44 | procname=nb${name} | 44 | procname=nb${name} | |
45 | start_precmd="qmailsmtpd_precmd" | 45 | start_precmd="qmailsmtpd_precmd" | |
46 | extra_commands="stat pause cont cdb reload" | 46 | extra_commands="stat pause cont cdb reload" | |
47 | stat_cmd="qmailsmtpd_stat" | 47 | stat_cmd="qmailsmtpd_stat" | |
48 | pause_cmd="qmailsmtpd_pause" | 48 | pause_cmd="qmailsmtpd_pause" | |
49 | cont_cmd="qmailsmtpd_cont" | 49 | cont_cmd="qmailsmtpd_cont" | |
50 | cdb_cmd="qmailsmtpd_cdb" | 50 | cdb_cmd="qmailsmtpd_cdb" | |
51 | reload_cmd=${cdb_cmd} | 51 | reload_cmd=${cdb_cmd} | |
52 | 52 | |||
53 | qmailsmtpd_configure_tls() { | 53 | qmailsmtpd_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 | |||
67 | qmailsmtpd_disable_tls() { | 67 | qmailsmtpd_disable_tls() { | |
68 | qmailsmtpd_postenv="${qmailsmtpd_postenv} DISABLETLS=1" | 68 | qmailsmtpd_postenv="${qmailsmtpd_postenv} DISABLETLS=1" | |
69 | } | 69 | } | |
70 | 70 | |||
71 | qmailsmtpd_enable_tls() { | 71 | qmailsmtpd_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 | |||
79 | qmailsmtpd_precmd() { | 79 | qmailsmtpd_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} | |
98 | 2>&1 | | 98 | 2>&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 | |||
104 | qmailsmtpd_stat() { | 104 | qmailsmtpd_stat() { | |
105 | run_rc_command status | 105 | run_rc_command status | |
106 | } | 106 | } | |
107 | 107 | |||
108 | qmailsmtpd_pause() { | 108 | qmailsmtpd_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 | |||
117 | qmailsmtpd_cont() { | 117 | qmailsmtpd_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 | |||
126 | qmailsmtpd_needcdb() { | 126 | qmailsmtpd_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 | |||
132 | qmailsmtpd_cdb() { | 132 | qmailsmtpd_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 | |||
138 | if [ -f /etc/rc.subr ]; then | 138 | if [ -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" | |
141 | else | 141 | else | |
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} | |
145 | fi | 145 | fi |