【Linux】ソースからビルドしたDovecotが起動しない


SRPMからビルドしたdovecotが起動しないところでスッゲェハマった。。

エラーの内容は

Fatal: listen(::, 143) failed: Address already in use

普通に考えると「143ポートはすでに使われてるよん」ってことだけど。imapを起動した覚えはないし、元々のdovecotはremoveしたし。nmapやnetstat、lsofで調べまくった。

nmap localhost
netstat -lnp | grep 143
lsof -i:143

でも何も出てこない。。。
Dovecot起動エラー」「Dovecot起動できず」このへんも参考にいろいろ調べてみたけど、原因がよくわからない。

で、エラーをよくよく見てみると「Fatal: listen(::, 143)」。「::,」とか謎の記号が入ってた。
さらにグーグル先生で調べていくと、どうやらdovecotはデフォルトでIPv6をリスンしに行ってるらしい。
「/etc/dovecot.conf」を見ると、ありましたこんな設定箇所が

# IP or host address where to listen in for connections. It’s not currently
# possible to specify multiple addresses. "*" listens in all IPv4 interfaces.
# "[::]" listens in all IPv6 interfaces, but may also listen in all IPv4
# interfaces depending on the operating system.
#
# If you want to specify ports for each service, you will need to configure
# these settings inside the protocol imap/pop3 { … } section, so you can
# specify different ports for IMAP/POP3. For example:
#   protocol imap {
#     listen = *:10143
#     ssl_listen = *:10943
#     ..
#   }
#   protocol pop3 {
#     listen = *:10100
#     ..
#   }

ということらしいので

listen = [*]

これを付け足して、一件落着。起動したーーー
ありがとう閃きー

Comments