summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorClive Lin <clive@FreeBSD.org>2001-02-21 02:25:59 +0000
committerClive Lin <clive@FreeBSD.org>2001-02-21 02:25:59 +0000
commit5ce84d162d86e8ad4f3ccb60f794df05257e239f (patch)
treef535eadeed578d8ad7f653b9dcca3bbc5ef6d4ac /mail
parentUpgrade to 20010215a. (diff)
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.
Notes
Notes: svn path=/head/; revision=38535
Diffstat (limited to 'mail')
-rw-r--r--mail/Makefile1
-rw-r--r--mail/nullmailer/Makefile38
-rw-r--r--mail/nullmailer/distinfo1
-rw-r--r--mail/nullmailer/files/nullmail.sh46
-rw-r--r--mail/nullmailer/files/remotes.sample1
-rw-r--r--mail/nullmailer/pkg-comment1
-rw-r--r--mail/nullmailer/pkg-descr3
-rw-r--r--mail/nullmailer/pkg-install63
-rw-r--r--mail/nullmailer/pkg-message15
-rw-r--r--mail/nullmailer/pkg-plist16
10 files changed, 185 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile
index 3aeccb2cdad4..a686c3a2583c 100644
--- a/mail/Makefile
+++ b/mail/Makefile
@@ -80,6 +80,7 @@
SUBDIR += namg
SUBDIR += newmail
SUBDIR += nmh
+ SUBDIR += nullmailer
SUBDIR += p5-Email-Find
SUBDIR += p5-Email-Valid
SUBDIR += p5-IMAP-Admin
diff --git a/mail/nullmailer/Makefile b/mail/nullmailer/Makefile
new file mode 100644
index 000000000000..e728180b856c
--- /dev/null
+++ b/mail/nullmailer/Makefile
@@ -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>
diff --git a/mail/nullmailer/distinfo b/mail/nullmailer/distinfo
new file mode 100644
index 000000000000..c3dd25a021aa
--- /dev/null
+++ b/mail/nullmailer/distinfo
@@ -0,0 +1 @@
+MD5 (nullmailer-1.00RC5.tar.gz) = 61041ff5b1e41f9280d63a04c3383144
diff --git a/mail/nullmailer/files/nullmail.sh b/mail/nullmailer/files/nullmail.sh
new file mode 100644
index 000000000000..ec009936de4e
--- /dev/null
+++ b/mail/nullmailer/files/nullmail.sh
@@ -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
diff --git a/mail/nullmailer/files/remotes.sample b/mail/nullmailer/files/remotes.sample
new file mode 100644
index 000000000000..458605c64a88
--- /dev/null
+++ b/mail/nullmailer/files/remotes.sample
@@ -0,0 +1 @@
+localhost smtp
diff --git a/mail/nullmailer/pkg-comment b/mail/nullmailer/pkg-comment
new file mode 100644
index 000000000000..2ea52ee2ee76
--- /dev/null
+++ b/mail/nullmailer/pkg-comment
@@ -0,0 +1 @@
+MTA for hosts which relay to a fixed set of smart relays
diff --git a/mail/nullmailer/pkg-descr b/mail/nullmailer/pkg-descr
new file mode 100644
index 000000000000..8b42236fab9b
--- /dev/null
+++ b/mail/nullmailer/pkg-descr
@@ -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.
diff --git a/mail/nullmailer/pkg-install b/mail/nullmailer/pkg-install
new file mode 100644
index 000000000000..9832b2045594
--- /dev/null
+++ b/mail/nullmailer/pkg-install
@@ -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
diff --git a/mail/nullmailer/pkg-message b/mail/nullmailer/pkg-message
new file mode 100644
index 000000000000..c88f536f8101
--- /dev/null
+++ b/mail/nullmailer/pkg-message
@@ -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
+==================================================================
diff --git a/mail/nullmailer/pkg-plist b/mail/nullmailer/pkg-plist
new file mode 100644
index 000000000000..b178cf2e143a
--- /dev/null
+++ b/mail/nullmailer/pkg-plist
@@ -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"