Dovecot+vpopmail
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
vi /etc/dnf/dnf.conf
excludepkgs= dovecot
更新しないように設定しておくこと
コンパイルエラーになるので手動でインストール
# wget https://dovecot.org/releases/2.3/dovecot-2.3.10.1....
# tar xvfz dovecot-2.3.10.1.tar.gz
# cd dovecot-2.3.10.1
./configure \
--disable-static \
--disable-rpath \
--with-nss \
--with-shadow \
--with-pam \
--with-gssapi=plugin \
--with-ldap=plugin \
--with-sql=plugin \
--with-pgsql \
--with-mysql \
--with-sqlite \
--with-zlib \
--with-libcap \
--with-lucene \
--with-ssl=openssl \
--with-ssldir=%{ssldir} \
--with-solr \
--with-systemdsystemunitdir=%{_unitdir} \
--with-vpopmail \
--with-docs
#make
#make install
/etc/init.d/dovecot
#!/bin/bash
#
# /etc/rc.d/init.d/dovecot
#
# Starts the dovecot daemon
#
# chkconfig: 2345 85 85
# description: Dovecot Imap Server
# processname: dovecot
# Source function library.
. /etc/init.d/functions
test -x /usr/local/sbin/dovecot || exit 0
RETVAL=0
prog="Dovecot IMAP"
start() {
echo -n $"Starting $prog: "
rm -f /usr/local/var/run/dovecot/master.pid
daemon /usr/local/sbin/dovecot
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dovecot
echo
}
stop() {
echo -n $"Stopping $prog: "
killproc /usr/local/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/local/sbin/dovecot
RETVAL=$?
;;
*) [#w99a9935]
echo $"Usage: $0 {condrestart|start|stop|restart|reload|...
exit 1
esac
exit $RETVAL
chmod +x /etc/init.d/dovecot
続きは★★に
●設定ファイルのコピー
/usr/local/etc/dovecot/dovecot.conf に設定ファイルをい...
cp -rf /usr/local/share/doc/dovecot/example-config/* /us...
必要なものだけいれたほうがいいかも
★★
# vi /usr/local/etc/dovecot/dovecot.conf ← Dovecot設定...
protocols = imap
listen = *
# vi /usr/local/etc/dovecot/conf.d/10-auth.conf
#!include auth-system.conf.ext
!include auth-vpopmail.conf.ext ← ※認証をvpopmailで行...
# 10行目:コメント解除し変更(プレーンテキスト認証も許可...
disable_plaintext_auth = no
# 100行目:追記
auth_mechanisms = plain login
# vi /usr/local/etc/dovecot/conf.d/10-mail.conf
# 30行目:コメント解除して追記
mail_location = maildir:~/Maildir
first_valid_uid = 89
※first_valid_uid は、認証を許可するユーザIDの最小値。だ...
なので今回はvpopmailユーザーの89を指定。
# vi /usr/local/etc/dovecot/conf.d/10-master.conf
default_login_user = dovecot
service imap-login {
#inet_listener imap {private_words_default
#port = 143
#}
inet_listener imaps {
port = 993
ssl = yes
}
#service lmtp {
# unix_listener lmtp {
# #mode = 0666
# }
#}
# vi /usr/local/etc/dovecot/conf.d/10-ssl.conf
# 8行目:変更
ssl = yes
ssl_cert = </etc/pki/tls/certs/domainname1.csr
ssl_key = </etc/pki/tls/certs/domainname1.key
※SSL/TLSのキー指定。Apacheのを流用。
※/etc/letsencrypt/live/75.myeki.com/cert.pem
※/etc/letsencrypt/live/75.myeki.com/privkey.pem
# vi /usr/local/etc/dovecot/conf.d/auth-vpopmail.conf.ext
#args = quota_template=quota_rule=*:backend=%q
# /etc/init.d/dovecot start
chkconfig dovecot on ← dovecot起動&自動起動設定
終了行:
vi /etc/dnf/dnf.conf
excludepkgs= dovecot
更新しないように設定しておくこと
コンパイルエラーになるので手動でインストール
# wget https://dovecot.org/releases/2.3/dovecot-2.3.10.1....
# tar xvfz dovecot-2.3.10.1.tar.gz
# cd dovecot-2.3.10.1
./configure \
--disable-static \
--disable-rpath \
--with-nss \
--with-shadow \
--with-pam \
--with-gssapi=plugin \
--with-ldap=plugin \
--with-sql=plugin \
--with-pgsql \
--with-mysql \
--with-sqlite \
--with-zlib \
--with-libcap \
--with-lucene \
--with-ssl=openssl \
--with-ssldir=%{ssldir} \
--with-solr \
--with-systemdsystemunitdir=%{_unitdir} \
--with-vpopmail \
--with-docs
#make
#make install
/etc/init.d/dovecot
#!/bin/bash
#
# /etc/rc.d/init.d/dovecot
#
# Starts the dovecot daemon
#
# chkconfig: 2345 85 85
# description: Dovecot Imap Server
# processname: dovecot
# Source function library.
. /etc/init.d/functions
test -x /usr/local/sbin/dovecot || exit 0
RETVAL=0
prog="Dovecot IMAP"
start() {
echo -n $"Starting $prog: "
rm -f /usr/local/var/run/dovecot/master.pid
daemon /usr/local/sbin/dovecot
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dovecot
echo
}
stop() {
echo -n $"Stopping $prog: "
killproc /usr/local/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/local/sbin/dovecot
RETVAL=$?
;;
*) [#w99a9935]
echo $"Usage: $0 {condrestart|start|stop|restart|reload|...
exit 1
esac
exit $RETVAL
chmod +x /etc/init.d/dovecot
続きは★★に
●設定ファイルのコピー
/usr/local/etc/dovecot/dovecot.conf に設定ファイルをい...
cp -rf /usr/local/share/doc/dovecot/example-config/* /us...
必要なものだけいれたほうがいいかも
★★
# vi /usr/local/etc/dovecot/dovecot.conf ← Dovecot設定...
protocols = imap
listen = *
# vi /usr/local/etc/dovecot/conf.d/10-auth.conf
#!include auth-system.conf.ext
!include auth-vpopmail.conf.ext ← ※認証をvpopmailで行...
# 10行目:コメント解除し変更(プレーンテキスト認証も許可...
disable_plaintext_auth = no
# 100行目:追記
auth_mechanisms = plain login
# vi /usr/local/etc/dovecot/conf.d/10-mail.conf
# 30行目:コメント解除して追記
mail_location = maildir:~/Maildir
first_valid_uid = 89
※first_valid_uid は、認証を許可するユーザIDの最小値。だ...
なので今回はvpopmailユーザーの89を指定。
# vi /usr/local/etc/dovecot/conf.d/10-master.conf
default_login_user = dovecot
service imap-login {
#inet_listener imap {private_words_default
#port = 143
#}
inet_listener imaps {
port = 993
ssl = yes
}
#service lmtp {
# unix_listener lmtp {
# #mode = 0666
# }
#}
# vi /usr/local/etc/dovecot/conf.d/10-ssl.conf
# 8行目:変更
ssl = yes
ssl_cert = </etc/pki/tls/certs/domainname1.csr
ssl_key = </etc/pki/tls/certs/domainname1.key
※SSL/TLSのキー指定。Apacheのを流用。
※/etc/letsencrypt/live/75.myeki.com/cert.pem
※/etc/letsencrypt/live/75.myeki.com/privkey.pem
# vi /usr/local/etc/dovecot/conf.d/auth-vpopmail.conf.ext
#args = quota_template=quota_rule=*:backend=%q
# /etc/init.d/dovecot start
chkconfig dovecot on ← dovecot起動&自動起動設定
ページ名: