qpsmtpd Wiki

[[install:centos5]]

You are here: start » install » centos5

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

You don't have an account yet? Just get one: Register

Forgotten your password? Get a new one: Set new password

Install Script

useradd smtpd
 
wget http://smtpd.develooper.com/files/qpsmtpd-0.84.tar.gz
tar zxvpf qpsmtpd-0.84.tar.gz
yum install gcc -y
 
#start cpan
#answer the first question "Are you ready for manual configuration?" with no
#answer all questions with yes
perl -MCPAN -e 'install Net::DNS'
perl -MCPAN -e 'install MIME::Base64'
perl -MCPAN -e 'install Mail::Header'
perl -MCPAN -e 'install Danga::Socket'
perl -MCPAN -e 'install ParaDNS'
#end cpan
 
cd qpsmtpd-0.84
perl Makefile.PL
make
make install
 
#copy config & plugins to /etc/qpsmtpd
mkdir /etc/qpsmtpd
mkdir /etc/qpsmtpd/config
mkdir /etc/qpsmtpd/plugins
cp config.sample/* /etc/qpsmtpd/config/
cp plugins/* /etc/qpsmtpd/plugins/ -R
 
#create service file
#insert the code of "Service Script"
vim qpsmtpd.sh
cp qpsmtpd.sh /etc/rc.d/init.d/qpsmtpd
chmod +x /etc/rc.d/init.d/qpsmtpd
chkconfig --add qpsmtpd
chkconfig --level 35 qpsmtpd on

qpsmtpd.sh

#!/bin/bash
#
# qpsmtpd-async          Start/Stop the qpsmtpd forking server
#
# chkconfig: 2345 90 60
# description: qpsmtpd is a flexible smtpd daemon written in Perl. \
#              Apart from the core SMTP features, all functionality is \
#              implemented in small "extension plugins" using the easy \
#              to use object oriented plugin API.
# processname: qpsmtpd-async
# config: /etc/qpsmtpd
# pidfile: /var/lock/subsys/qpsmtpd-async
 
# cleanup environment a bit.
unset PERL_UNICODE
 
# Source function library.
. /etc/rc.d/init.d/functions
 
RETVAL=0
 
# See how we were called.
 
dir="/usr/bin"
prog="qpsmtpd-async"
 
QPSMTPD_OPTIONS="-u smtpd -p 25 -j 3"
export QPSMTPD_CONFIG="/etc/qpsmtpd/config"
 
start() {
        echo -n $"Starting $dir/$prog: "
        trap "" 1
        daemon $dir/$prog --detach $QPSMTPD_OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
        return $RETVAL
}
 
stop() {
        echo -n $"Stopping $dir/$prog: "
        killproc $prog
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
        return $RETVAL
}
 
rhstatus() {
        status qpsmtpd-async
}
 
restart() {
        stop
        start
}
 
reload() {
        stop
        start
}
 
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  reload)
        reload
        ;;
  status)
        rhstatus
        ;;
  condrestart)
        [ -f /var/lock/subsys/$prog ] && restart || :
        ;;
  *)
        echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
        exit 1
esac
exit $RETVAL
service qpsmtpd start