1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-13 07:34:50 +00:00

This buffer is for notes you don't want to save, and for Lisp evaluation.

If you want to create a file, visit that file with C-x C-f,
then enter the text in that file's own buffer.

Add nullmailer, a sendmail compatible MTA which only does one thing:
send mail to a SMTP or QMQP smart relay.

NOTICE: This port is usable now, but not yet dumb-safe. Please pay
        attention on its pkg-message.
This commit is contained in:
Clive Lin 2001-02-21 02:25:59 +00:00
parent 7cab70d9a8
commit 5ce84d162d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=38535
10 changed files with 185 additions and 0 deletions

View File

@ -80,6 +80,7 @@
SUBDIR += namg
SUBDIR += newmail
SUBDIR += nmh
SUBDIR += nullmailer
SUBDIR += p5-Email-Find
SUBDIR += p5-Email-Valid
SUBDIR += p5-IMAP-Admin

38
mail/nullmailer/Makefile Normal file
View File

@ -0,0 +1,38 @@
# Ports collection makefile for: nullmailer
# Date created: Tue Jan 30 2001
# Whom: clive
#
# $FreeBSD$
#
PORTNAME= nullmailer
# PORTVERSION= 1.00RC5
PORTVERSION= 1.00r5
CATEGORIES= mail
MASTER_SITES= http://www.em.ca/~bruceg/nullmailer/archive/%SUBDIR%/
# MASTER_SITE_SUBDIR= ${PORTVERSION}
MASTER_SITE_SUBDIR= 1.00RC5
DISTNAME= ${PORTNAME}-1.00RC5
MAINTAINER= clive@FreeBSD.org
HAS_CONFIGURE= yes
IS_INTERACTIVE= yes
NO_PACKAGE= yes
MAN1= nullmailer-inject.1 sendmail.1
MAN7= nullmailer.7
MAN8= nullmailer-queue.8 nullmailer-send.8
pre-install:
@PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
do-install:
@cd ${WRKSRC} && make install && make install-root
post-install:
@${INSTALL} -c files/nullmail.sh ${PREFIX}/etc/rc.d/
@${INSTALL} -c files/remotes.sample ${PREFIX}/etc/nullmailer/
@${CAT} ${PKGMESSAGE} | ${SED} -e 's,%%PREFIX%%,${PREFIX},'
.include <bsd.port.mk>

1
mail/nullmailer/distinfo Normal file
View File

@ -0,0 +1 @@
MD5 (nullmailer-1.00RC5.tar.gz) = 61041ff5b1e41f9280d63a04c3383144

View File

@ -0,0 +1,46 @@
#!/bin/sh
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
NULLMAILUSER=nullmail
PIDFILE=/var/run/nullmailer.pid
AWK=/usr/bin/awk
CAT=/bin/cat
GREP=/usr/bin/grep
PS=/bin/ps
RM=/bin/rm
LOGGER=/usr/bin/logger
KILL=/bin/kill
KILLALL=/usr/bin/killall
PRIORITY=local5.info
TAG=${NULLMAILUSER}
case "$1" in
start)
if [ ! -r ${PIDFILE} ] ; then
[ -x ${PREFIX}/sbin/nullmailer-send ] && su -l ${NULLMAILUSER} -c "${PREFIX}/sbin/nullmailer-send | ${LOGGER} -p ${PRIORITY} -t ${TAG} 2>&1 &" && echo -n ' nullmailer'
JUNK=`${PS} -ax`
PID=`${PS} -ax | ${GREP} -e nullmailer-send$ | ${AWK} '{print $1}'`
echo $PID > ${PIDFILE}
else
echo 'nullmailer already running'
fi
;;
stop)
if [ -r ${PIDFILE} ] ; then
# ${KILL} -15 `${CAT} ${PIDFILE}` > /dev/null && echo -n ' nullmailer'
${KILLALL} -15 nullmailer-send > /dev/null && echo -n ' nullmailer'
${RM} -f ${PIDFILE}
fi
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
exit 0

View File

@ -0,0 +1 @@
localhost smtp

View File

@ -0,0 +1 @@
MTA for hosts which relay to a fixed set of smart relays

View File

@ -0,0 +1,3 @@
This is nullmailer, a sendmail/qmail/etc replacement MTA for hosts which
relay to a fixed set of smart relays. It is designed to be simple to
configure, secure, and easily extendable.

View File

@ -0,0 +1,63 @@
#!/bin/sh
user=nullmail
group=nullmail
ask() {
local question default answer
question=$1
default=$2
if [ -z "${PACKAGE_BUILDING}" ]; then
read -p "${question} [${default}]? " answer
fi
if [ x${answer} = x ]; then
answer=${default}
fi
echo ${answer}
}
yesno() {
local dflt question answer
question=$1
dflt=$2
while :; do
answer=$(ask "${question}" "${dflt}")
case "${answer}" in
[Yy]*) return 0;;
[Nn]*) return 1;;
esac
echo "Please answer yes or no."
done
}
if [ x"$2" = xPRE-INSTALL ]; then
if /usr/sbin/pw groupshow "${group}" 2>/dev/null; then
echo "You already have a group \"${group}\", so I will use it."
else
echo "You need a group \"${group}\"."
if yesno "Would you like me to create it" y; then
/usr/sbin/pw groupadd ${group} -g 522 -h - || exit
echo "Done."
else
echo "Please create it, and try again."
exit 1
fi
fi
if /usr/sbin/pw user show "${user}" 2>/dev/null; then
echo "You already have a user \"${user}\", so I will use it."
else
echo "You need a user \"${user}\"."
if yesno "Would you like me to create it" y; then
/usr/sbin/pw useradd ${user} -u 522 -g ${group} -h - -d ${PREFIX}/var/nullmailer \
-s /bin/sh -c "Nullmailer Mail System" || exit
echo "Done."
else
echo "Please create it, and try again."
exit 1
fi
fi
fi

View File

@ -0,0 +1,15 @@
==================================================================
1) Add the following line into your /etc/syslog.conf and
killall -1 syslogd:
local5.info /var/log/nullmail
NOTICE: This entry must be before
*.* /var/log/all.log
2) Touch /var/log/nullmail as root.
3) Add this line into your /etc/newsyslog.conf:
/var/log/nullmail 644 7 * @T00 Z
4) Edit %%PREFIX%%/etc/nullmailer/remotes
==================================================================

16
mail/nullmailer/pkg-plist Normal file
View File

@ -0,0 +1,16 @@
libexec/nullmailer/smtp
libexec/nullmailer/qmqp
bin/mailq
bin/nullmailer-inject
sbin/nullmailer-queue
sbin/nullmailer-send
sbin/sendmail
etc/nullmailer/remotes.sample
@dirrm var/nullmailer/queue
@dirrm var/nullmailer/tmp
@unexec rm -f %D/var/nullmailer/trigger
@dirrm etc/nullmailer
@dirrm var/nullmailer
@unexec echo "Warning: If you will *NOT* use nullmailer anymore, please remove"
@unexec echo " 1) nullmail user and its group."
@unexec echo " 2) its relative entry in /etc/syslog.conf and /etc/newsyslog.conf"