mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-04 06:15:24 +00:00
mail/qmail: Add rc.d script for qmails queue management daemons
PR: 210223 Submitted by: Dirk Engling <erdgeist@erdgeist.org> (maintainer)
This commit is contained in:
parent
5c62f72ebb
commit
5b38ed18fe
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=417471
@ -3,7 +3,7 @@
|
||||
|
||||
PORTNAME= ${QMAIL_PORTNAME}
|
||||
PORTVERSION?= ${QMAIL_VERSION}
|
||||
PORTREVISION?= 2
|
||||
PORTREVISION?= 3
|
||||
CATEGORIES= mail
|
||||
MASTER_SITES+= QMAIL
|
||||
DISTNAME= ${PORTNAME}-${QMAIL_VERSION}
|
||||
@ -326,7 +326,7 @@ SUB_FILES+= pkg-message
|
||||
.endif
|
||||
|
||||
.if !defined(SLAVE_LDAP)
|
||||
SUB_FILES+= qmailsmtpd
|
||||
SUB_FILES+= qmailsmtpd qmailsend
|
||||
.endif
|
||||
|
||||
WRKDIR_doc= ${WRKDIR}/doc
|
||||
@ -838,6 +838,7 @@ do-install:
|
||||
.endfor
|
||||
.if !defined(SLAVE_LDAP)
|
||||
${INSTALL_SCRIPT} ${WRKDIR}/qmailsmtpd ${STAGEDIR}${PREFIX}/boot
|
||||
${INSTALL_SCRIPT} ${WRKDIR}/qmailsend ${STAGEDIR}${PREFIX}/boot
|
||||
.endif
|
||||
.for i in 1 5 7 8
|
||||
@${MKDIR} ${STAGEDIR}${PREFIX}/man/man$i
|
||||
|
66
mail/qmail/files/qmailsend.in
Normal file
66
mail/qmail/files/qmailsend.in
Normal file
@ -0,0 +1,66 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# PROVIDE: qmailsend
|
||||
# REQUIRE: network
|
||||
#
|
||||
# The wrapper around qmail's qmail-send, qmail-lspawn, qmail-rspawn and
|
||||
# qmail-clean chain.
|
||||
#
|
||||
# the qmailsend_delivery variable controls where mails should be delivered to:
|
||||
# maildir - qmail-local to ~/Maildir/ (this is the default)
|
||||
# mailbox - qmail-local to ~/Mailbox
|
||||
# proc - procmail to /var/spool/mail/$USER
|
||||
# V7 - /bin/mail V7 interface to /var/spool/mail/$USER
|
||||
# SVR4 - /bin/mail SVR4 interface to /var/spool/mail/$USER
|
||||
# BSD44 - /usr/libexec/mail.local to /var/spool/mail/$USER
|
||||
#
|
||||
# Setting qmailsend_dotforward enables support for sendmail style
|
||||
# .forward files
|
||||
#
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=qmailsend
|
||||
rcvar=qmailsend_enable
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
: ${qmailsend_delivery="maildir"}
|
||||
: ${qmailsend_dotforward="NO"}
|
||||
|
||||
start_cmd="${name}_start"
|
||||
command="%%PREFIX%%/bin/qmail-start"
|
||||
procname=qmail-send
|
||||
|
||||
extra_commands="flush"
|
||||
flush_cmd="qmailsend_flush"
|
||||
|
||||
pidfile="/var/run/${name}.pid"
|
||||
|
||||
qmailsend_start() {
|
||||
case ${qmailsend_delivery} in
|
||||
maildir) command_args='./Maildir/';;
|
||||
mailbox) command_args='./Mailbox';;
|
||||
proc) command_args='|preline procmail';;
|
||||
V7) command_args='|preline -f /bin/mail -f "${SENDER:-MAILER-DAEMON}" -d "$USER"';;
|
||||
SVR4) command_args='|preline -f /bin/mail -r "${SENDER:-MAILER-DAEMON}" -d "$USER"';;
|
||||
BSD44) command_args='|preline -f /usr/libexec/mail.local -r "${SENDER:-MAILER-DAEMON}" -d "$USER"';;
|
||||
*) err 1 "Error: Unknown qmailsend delivery method: ${qmailsend_delivery}";;
|
||||
esac
|
||||
if checkyesno qmailsend_dotforward; then
|
||||
command_args='|dot-forward .forward
|
||||
'"${command_args}"
|
||||
fi
|
||||
|
||||
exec env - PATH="%%PREFIX%%/bin:$PATH" ${command} \'"${command_args}"\' splogger qmail&
|
||||
/bin/pgrep -P $$ > ${pidfile}
|
||||
}
|
||||
|
||||
qmailsend_flush() {
|
||||
/bin/pkill -ALRM ${rc_pid}
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
||||
|
@ -1,8 +1,10 @@
|
||||
@unexec for alias in postmaster root mailer-daemon; do if [ -f %D/alias/.qmail-${alias} ] && [ $(stat -f '%%z' %D/alias/.qmail-${alias}) -eq 0 ]; then rm -f %D/alias/.qmail-${alias}; fi; done
|
||||
@exec for alias in postmaster root mailer-daemon; do if ! [ -f %D/alias/.qmail-${alias} ]; then :> %D/alias/.qmail-${alias}; fi; done
|
||||
%%RCDLINK%%@unexec rm -f %%LOCALBASE%%/etc/rc.d/qmailsmtpd
|
||||
%%RCDLINK%%@exec /bin/ln -fs %D/rc %%LOCALBASE%%/etc/rc.d/qmailsmtpd
|
||||
%%RCDLINK%%@exec echo; echo "A %%LOCALBASE%%/etc/rc.d/qmailsmtpd symlink was created. To enable qmail at boot time you need to copy a script to %D/rc. There are some examples at %D/boot" | /usr/bin/fmt; echo
|
||||
%%RCDLINK%%@unexec rm -f %%LOCALBASE%%/etc/rc.d/qmailsend
|
||||
%%RCDLINK%%@exec /bin/ln -fs %D/boot/qmailsmtpd %%LOCALBASE%%/etc/rc.d/qmailsmtpd
|
||||
%%RCDLINK%%@exec /bin/ln -fs %D/boot/qmailsend %%LOCALBASE%%/etc/rc.d/qmailsend
|
||||
%%RCDLINK%%@exec echo; echo "A %%LOCALBASE%%/etc/rc.d/qmailsmtpd and a %%LOCALBASE%%/etc/rc.d/qmailsend symlink were created." | /usr/bin/fmt; echo
|
||||
%%LDAP%%bin/auth_dovecot
|
||||
%%LDAP%%bin/auth_imap
|
||||
%%LDAP%%bin/auth_pop
|
||||
@ -90,6 +92,7 @@ bin/tcp-env
|
||||
%%NO_LDAP%%boot/proc
|
||||
%%NO_LDAP%%boot/proc+df
|
||||
%%NO_LDAP%%boot/qmailsmtpd
|
||||
%%NO_LDAP%%boot/qmailsend
|
||||
%%LDAP%%boot/qmail/log/run
|
||||
%%LDAP%%boot/qmail/run
|
||||
%%LDAP%%boot/qmail-smtpd/log/run
|
||||
|
Loading…
Reference in New Issue
Block a user