mirror of
https://git.freebsd.org/ports.git
synced 2025-07-17 09:19:15 -04:00
from the qmail mail transport agent (MTA). qmail-smtpd has a number of shortcomings (e.g. being unable to check the validity of a recipient mail address) and is written in C which makes it burdensome to modify and extend. Qpsmtpd, on the other hand, is written in pure perl and can be customized easily. It consists of a core that implements a complete SMTP server, and a number of plugins/modules which control the operations. Such plugins include plugins to check the recipient and sender as well as plugins for virus scanning, spam checking, blocking lists (dns and rhs), AUTH and TLS. Qpsmtpd can not only be used with qmail but also with e.g. postfix and exim. It can also write messages to a Maildir or forward it to a remote host without buffering. WWW: http://smtpd.develooper.com/ PR: ports/107668 Submitted by: Zane C. Bowers
78 lines
1.7 KiB
Bash
78 lines
1.7 KiB
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: qpsmtpd
|
|
# REQUIRE: NETWORKING SERVERS
|
|
# BEFORE: securelevel
|
|
|
|
#variables
|
|
#qpsmtpd_user = the user to run qpsmtpd-forkserver under
|
|
#qpsmtpd_group = the group the pid dir will be chowned to
|
|
#qpsmtpd_port = the port it should listen on
|
|
#qpsmtpd_max_per_ip = max connections per IP
|
|
#qpsmtpd_max_connections = maximum total connections
|
|
#qpsmtpd_listen_on = IP to listen on
|
|
|
|
. "/etc/rc.subr"
|
|
|
|
name="qpsmtpd"
|
|
rcvar=`set_rcvar`
|
|
|
|
command="%%PREFIX%%/bin/qpsmtpd-forkserver"
|
|
pidfile="/var/run/qpsmtpd/qpsmtpd.pid"
|
|
|
|
start_precmd="start_precmd"
|
|
start_cmd="start_cmd"
|
|
stop_cmd="stop_cmd"
|
|
|
|
start_precmd()
|
|
{
|
|
#exits if no user is specified
|
|
if [ -z $qpsmtpd_user ]; then
|
|
echo "qpsmtpd_user not set"
|
|
exit 1
|
|
fi
|
|
|
|
#exits if no group is specified
|
|
if [ -z $qpsmtpd_group ]; then
|
|
echo "qpsmtpd_group not set"
|
|
exit 1
|
|
fi
|
|
|
|
#sets it to the default if the port is not specified
|
|
if [ -z $qpsmtpd_port ]; then
|
|
qpsmtpd_port="2525"
|
|
fi
|
|
|
|
#set it to the default max per ip
|
|
if [ -z $qpsmtpd_max_per_ip ]; then
|
|
qpsmtpd_max_per_ip="5"
|
|
fi
|
|
|
|
#set it do the max number of connections total
|
|
if [ -z $qpsmtpd_max_connections ]; then
|
|
qpsmtpd_max_connections="15"
|
|
fi
|
|
|
|
#set the default listen on to everything
|
|
if [ -z $qpsmtpd_listen_on ]; then
|
|
qpsmtpd_listen_on="0.0.0.0"
|
|
fi
|
|
|
|
if [ ! -d /var/run/qpsmtpd/ ] ; then
|
|
mkdir /var/run/qpsmtpd
|
|
fi
|
|
|
|
chown $qpsmtpd_user:$qpsmtpd_group /var/run/qpsmtpd
|
|
}
|
|
|
|
start_cmd()
|
|
{
|
|
eval $command -p $qpsmtpd_port -c $qpsmtpd_max_connections -u $qpsmtpd_users -m $qpsmtpd_max_per_ip -l $qpsmtpd_listen_on --pid-file $pidfile
|
|
}
|
|
|
|
stop_cmd()
|
|
{
|
|
kill `cat $pidfile`
|
|
}
|
|
|
|
run_rc_command "$1"
|