devedot 설치

출처 // https://www.sulinux.net/bbs/board.php?bo_table=success_2&wr_id=133 삽질쟁님감사요~

소스는 아래 사이트에서 구한다.

http://dovecot.org/

# wget http://dovecot.org/releases/1.1/dovecot-1.1.2.tar.gz
# tar xvfz dovecot-1.1.2.tar.gz
# cd dovecot-1.1.2
# ./configure –prefix=/usr –localstatedir=/var –with-pam –with-gssapi –with-mysql
# make
# make install
# cp /usr/etc/dovecot-example.conf /usr/etc/dovecot.conf
# groupadd -g 97 dovecot
# useradd -u 97 -g 97 -d /usr/libexec/dovecot -s /sbin/nologin dovecot

편집기로 환경설정 파일인 dovecot.conf 을 아래와 같이 내용 작성한다.
# vi /usr/etc/dovecot.conf
protocols = imap pop3
disable_plaintext_auth = no
ssl_disable = yes
protocol imap {
}
protocol pop3 {
}
auth default {
mechanisms = plain
passdb passwd {
}
passdb shadow {
}
userdb passwd {
}
user = root
}
plugin {
}
mail_privileged_group = mail

실행 커맨드는 아래와 같다.
# /usr/sbin/dovecot

아래와 같이 출력된다면 dovecot이 잘 올라온 상태이다.
[root@digimoon modules]# netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:50022 0.0.0.0:* LISTEN 18505/xinetd
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 18505/xinetd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 18313/mysqld
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 3523/smbd
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 21245/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 21245/dovecot
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 18505/xinetd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 19307/sendmail: acc
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 3523/smbd
tcp 0 0 :::80 :::* LISTEN 4562/httpd
udp 0 0 192.168.0.100:137 0.0.0.0:* 3528/nmbd
udp 0 0 0.0.0.0:137 0.0.0.0:* 3528/nmbd
udp 0 0 192.168.0.100:138 0.0.0.0:* 3528/nmbd
udp 0 0 0.0.0.0:138 0.0.0.0:* 3528/nmbd
udp 0 0 0.0.0.0:161 0.0.0.0:* 2832/snmpd
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 5738801 21245/dovecot /var/run/dovecot/dict-server
unix 2 [ ACC ] STREAM LISTENING 5738803 21245/dovecot /var/run/dovecot/login/default
unix 2 [ ACC ] STREAM LISTENING 5738812 21245/dovecot /var/run/dovecot/auth-worker.21246
unix 2 [ ACC ] STREAM LISTENING 1535445 28839/saslauthd /var/run/saslauthd/mux
unix 2 [ ACC ] STREAM LISTENING 5976316 18313/mysqld /tmp/mysql.sock
[root@digimoon modules]#

실행 스크립트는 아래와 같이 작성
# vi /etc/rc.d/init.d/dovecot
#!/bin/bash
#
# /etc/rc.d/init.d/dovecot
#
# Starts the dovecot daemon
#
# chkconfig: – 65 35
# description: Dovecot Imap Server
# processname: dovecot
# Source function library.
. /etc/init.d/functions

test -x /usr/sbin/dovecot || exit 0

RETVAL=0
prog=”Dovecot Imap”

start() {
echo -n $”Starting $prog: ”
daemon /usr/sbin/dovecot
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dovecot
echo
}

stop() {
echo -n $”Stopping $prog: ”
killproc /usr/sbin/dovecot
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dovecot
echo
}

#
# See how we were called.
#
case “$1″ in
start)
start
;;
stop)
stop
;;
reload|restart)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/dovecot ]; then
stop
start
fi
;;
status)
status /usr/sbin/dovecot
RETVAL=$?
;;
*)
echo $”Usage: $0 {condrestart|start|stop|restart|reload|status}”
exit 1
esac

exit $RETVAL
# chmod 700 /etc/rc.d/init.d/dovecot
# /etc/init.d/dovecot start|stop|restart

Leave your Comment

Your email address will not be published. Required fields are marked *