[Dovecot] Problem with opening ports in alpha5 ?
If I leave the "listen" value as the default in /etc/dovecot.conf I'll get a message similar to the following on each port that it tries to open during startup:
# dovecot -F Fatal: listen(::, 143) failed: Address already in use
If I set either: listen = *
or listen = [::]
then it will start up fine. Perhaps it is as though the code tries to open the port twice for both ip4 and ip6?
- Bruce
On Tue, 2009-01-06 at 09:55 -0500, Bruce A. Mallett wrote:
If I leave the "listen" value as the default in /etc/dovecot.conf I'll get a message similar to the following on each port that it tries to open during startup:
# dovecot -F Fatal: listen(::, 143) failed: Address already in use
If I set either: listen = *
or listen = [::]
then it will start up fine. Perhaps it is as though the code tries to open the port twice for both ip4 and ip6?
I can't reproduce this with current hg. Could you try if this still happens with nightly snapshots? If it does, dovecot -n output might show something useful. Oh and what OS are you using?
CentOS 5.2 - 64 bit
I'll give it a try later tonight and report back tomorrow.
Timo Sirainen wrote:
On Tue, 2009-01-06 at 09:55 -0500, Bruce A. Mallett wrote:
If I leave the "listen" value as the default in /etc/dovecot.conf I'll get a message similar to the following on each port that it tries to open during startup:
# dovecot -F Fatal: listen(::, 143) failed: Address already in use
If I set either: listen = *
or listen = [::]
then it will start up fine. Perhaps it is as though the code tries to open the port twice for both ip4 and ip6?
I can't reproduce this with current hg. Could you try if this still happens with nightly snapshots? If it does, dovecot -n output might show something useful. Oh and what OS are you using?
Timo Sirainen wrote:
On Tue, 2009-01-06 at 09:55 -0500, Bruce A. Mallett wrote:
If I leave the "listen" value as the default in /etc/dovecot.conf I'll get a message similar to the following on each port that it tries to open during startup:
# dovecot -F Fatal: listen(::, 143) failed: Address already in use
If I set either: listen = *
or listen = [::]
then it will start up fine. Perhaps it is as though the code tries to open the port twice for both ip4 and ip6?
I can't reproduce this with current hg. Could you try if this still happens with nightly snapshots? If it does, dovecot -n output might show something useful. Oh and what OS are you using?
Timo,
I've now had a change to try this using ... http://www.dovecot.org/nightly/dovecot-20090107.tar.gz It still fails as before. It is curious however that the failure does not occur in a Centos 5.2-64bit install under VMWare but it does occur on a Centos 5.2-64bit VPS.
The output is below. Let me know how else I might help.
- Bruce
=================================================== -bash-3.2# uname -a Linux mail 2.6.18-92.1.18.el5xen #1 SMP Wed Nov 12 09:48:10 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-bash-3.2# iptables -L -v iptables v1.3.5: can't initialize iptables table `filter': iptables who? (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
-bash-3.2# lsof -i COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME master 1069 root 11u IPv4 2879 TCP *:smtp (LISTEN) avahi-dae 1144 avahi 13u IPv4 3192 UDP *:mdns avahi-dae 1144 avahi 14u IPv4 3194 UDP *:44308 sshd 2493 root 3u IPv4 36284 TCP *:ssh (LISTEN) sshd 26501 root 3u IPv4 422259 TCP vaserv.com:ssh->c-75-67-244-49.hsd1.nh.comcast.net:33143 (ESTABLISHED)
-bash-3.2# dovecot -F Fatal: listen(::, 143) failed: Address already in use
-bash-3.2# dovecot -n # 1.2.alpha4: /etc/dovecot.conf # OS: Linux 2.6.18-92.1.18.el5xen x86_64 CentOS release 5.2 (Final) ext3 info_log_path: /var/log/dovecot.log protocols: imap imaps pop3 pop3s managesieve ssl_cert_file: /etc/postfix/ssl/smtpd.crt ssl_key_file: /etc/postfix/ssl/smtpd.key login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login login_executable(managesieve): /usr/libexec/dovecot/managesieve-login max_mail_processes: 100 first_valid_uid: 150 last_valid_uid: 150 mail_location: maildir:/var/vmail/%d/%n mail_debug: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_executable(managesieve): /usr/libexec/dovecot/managesieve mail_plugin_dir(default): /usr/lib64/dovecot/imap mail_plugin_dir(imap): /usr/lib64/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 mail_plugin_dir(managesieve): /usr/lib64/dovecot/managesieve auth default: mechanisms: digest-md5 cram-md5 plain debug: yes debug_passwords: yes passdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf userdb: driver: prefetch userdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf socket: type: listen client: path: /var/run/dovecot/auth-client mode: 432 master: path: /var/run/dovecot/auth-master mode: 384 user: vmail group: mail plugin: sieve: ~/.dovecot.sieve sieve_storage: /var/vmail/%d/%n/sieve -bash-3.2# clear -bash-3.2# uname -a Linux mail 2.6.18-92.1.18.el5xen #1 SMP Wed Nov 12 09:48:10 EST 2008 x86_64 x86_64 x86_64 GNU/Linux -bash-3.2# dovecot -F Fatal: listen(::, 143) failed: Address already in use -bash-3.2# dovecot -n # 1.2.alpha4: /etc/dovecot.conf # OS: Linux 2.6.18-92.1.18.el5xen x86_64 CentOS release 5.2 (Final) ext3 info_log_path: /var/log/dovecot.log protocols: imap imaps pop3 pop3s managesieve ssl_cert_file: /etc/postfix/ssl/smtpd.crt ssl_key_file: /etc/postfix/ssl/smtpd.key login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login login_executable(managesieve): /usr/libexec/dovecot/managesieve-login max_mail_processes: 100 first_valid_uid: 150 last_valid_uid: 150 mail_location: maildir:/var/vmail/%d/%n mail_debug: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_executable(managesieve): /usr/libexec/dovecot/managesieve mail_plugin_dir(default): /usr/lib64/dovecot/imap mail_plugin_dir(imap): /usr/lib64/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 mail_plugin_dir(managesieve): /usr/lib64/dovecot/managesieve auth default: mechanisms: digest-md5 cram-md5 plain debug: yes debug_passwords: yes passdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf userdb: driver: prefetch userdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf socket: type: listen client: path: /var/run/dovecot/auth-client mode: 432 master: path: /var/run/dovecot/auth-master mode: 384 user: vmail group: mail plugin: sieve: ~/.dovecot.sieve sieve_storage: /var/vmail/%d/%n/sieve
On Wed, 2009-01-07 at 07:31 -0500, Bruce A. Mallett wrote:
I've now had a change to try this using ... http://www.dovecot.org/nightly/dovecot-20090107.tar.gz .. -bash-3.2# dovecot -n # 1.2.alpha4: /etc/dovecot.conf
Something's wrong. It should say alpha5.
Timo Sirainen wrote:
On Wed, 2009-01-07 at 07:31 -0500, Bruce A. Mallett wrote:
I've now had a change to try this using ... http://www.dovecot.org/nightly/dovecot-20090107.tar.gz
..
-bash-3.2# dovecot -n # 1.2.alpha4: /etc/dovecot.conf
Something's wrong. It should say alpha5.
You are true, I messed up. Sorry.
This turned out to be more complicated than I initially expected. Why? Well, FWIW ...
I've a spec file that I use to build an RPM for Centos5.2-64 which combines the dovecot-alphaX with the corresponding sieve and managesieve sources. So building a nightly with this does not work because the managesieve is not in sync (unless you can point me to a nightly of that as well) and won't build with the existing managesieve-alpha5.
I ended up dropping back to building an RPM of just the dovecot sans the sieve portion using the nightly tar file. Having no sieve of course means that I had to delete that stuff from the dovecot.conf.
Here is what I now get with the install of just the dovecot nightly (no sieve):
================================================== First with the "listen = *" commented out: -bash-3.2# dovecot -F Fatal: listen(::, 143) failed: Address already in use
-bash-3.2# dovecot -n # 1.2.alpha5: /etc/dovecot.conf # OS: Linux 2.6.18-92.1.18.el5xen x86_64 CentOS release 5.2 (Final) ext3 info_log_path: /var/log/dovecot.log ssl_cert_file: /etc/postfix/ssl/smtpd.crt ssl_key_file: /etc/postfix/ssl/smtpd.key login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login max_mail_processes: 100 first_valid_uid: 150 last_valid_uid: 150 mail_location: maildir:/var/vmail/%d/%n mail_debug: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/lib64/dovecot/imap mail_plugin_dir(imap): /usr/lib64/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 auth default: mechanisms: digest-md5 cram-md5 plain debug: yes debug_passwords: yes passdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf userdb: driver: prefetch userdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf socket: type: listen client: path: /var/run/dovecot/auth-client mode: 432 master: path: /var/run/dovecot/auth-master mode: 384 user: vmail group: mail
Next with the "listen = *" enabled:
-bash-3.2# dovecot -F # It works! Had to ^C the above
-bash-3.2# dovecot -n # 1.2.alpha5: /etc/dovecot.conf # OS: Linux 2.6.18-92.1.18.el5xen x86_64 CentOS release 5.2 (Final) ext3 info_log_path: /var/log/dovecot.log listen: * ssl_cert_file: /etc/postfix/ssl/smtpd.crt ssl_key_file: /etc/postfix/ssl/smtpd.key login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login max_mail_processes: 100 first_valid_uid: 150 last_valid_uid: 150 mail_location: maildir:/var/vmail/%d/%n mail_debug: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/lib64/dovecot/imap mail_plugin_dir(imap): /usr/lib64/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 auth default: mechanisms: digest-md5 cram-md5 plain debug: yes debug_passwords: yes passdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf userdb: driver: prefetch userdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf socket: type: listen client: path: /var/run/dovecot/auth-client mode: 432 master: path: /var/run/dovecot/auth-master mode: 384 user: vmail group: mail
Next I change to "listen = [::]" :
-bash-3.2# dovecot -F # It works again! ^C'd the above
-bash-3.2# dovecot -n # 1.2.alpha5: /etc/dovecot.conf # OS: Linux 2.6.18-92.1.18.el5xen x86_64 CentOS release 5.2 (Final) ext3 info_log_path: /var/log/dovecot.log listen: [::] ssl_cert_file: /etc/postfix/ssl/smtpd.crt ssl_key_file: /etc/postfix/ssl/smtpd.key login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login max_mail_processes: 100 first_valid_uid: 150 last_valid_uid: 150 mail_location: maildir:/var/vmail/%d/%n mail_debug: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/lib64/dovecot/imap mail_plugin_dir(imap): /usr/lib64/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 auth default: mechanisms: digest-md5 cram-md5 plain debug: yes debug_passwords: yes passdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf userdb: driver: prefetch userdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf socket: type: listen client: path: /var/run/dovecot/auth-client mode: 432 master: path: /var/run/dovecot/auth-master mode: 384 user: vmail group: mail
================================================== Lastly with an explicit "listen = *, [::]"
-bash-3.2# dovecot -F Fatal: listen(::, 143) failed: Address already in use -bash-3.2# dovecot -n # 1.2.alpha5: /etc/dovecot.conf # OS: Linux 2.6.18-92.1.18.el5xen x86_64 CentOS release 5.2 (Final) ext3 info_log_path: /var/log/dovecot.log ssl_cert_file: /etc/postfix/ssl/smtpd.crt ssl_key_file: /etc/postfix/ssl/smtpd.key login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login max_mail_processes: 100 first_valid_uid: 150 last_valid_uid: 150 mail_location: maildir:/var/vmail/%d/%n mail_debug: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/lib64/dovecot/imap mail_plugin_dir(imap): /usr/lib64/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 auth default: mechanisms: digest-md5 cram-md5 plain debug: yes debug_passwords: yes passdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf userdb: driver: prefetch userdb: driver: sql args: /etc/dovecot/dovecot-mysql.conf socket: type: listen client: path: /var/run/dovecot/auth-client mode: 432 master: path: /var/run/dovecot/auth-master mode: 384 user: vmail group: mail
Interesting: I notice that the "listen" does not show up in the last case.
- Bruce
On Wed, 2009-01-07 at 14:08 -0500, Bruce A. Mallett wrote:
Lastly with an explicit "listen = *, [::]"
-bash-3.2# dovecot -F Fatal: listen(::, 143) failed: Address already in use -bash-3.2# dovecot -n .. Interesting: I notice that the "listen" does not show up in the last case.
That's because in your configuration it's the default and -n doesn't show if the value is identical with the default.
But Dovecot distribution's default is "*", so you have applied some patches to it. Is it possible that one of those patches breaks it?
Also..
then it will start up fine. Perhaps it is as though the code tries to open the port twice for both ip4 and ip6?
This is correct. It does that. But that shouldn't be a problem because they are handled separately. This code should make sure of that:
/* If using IPv6, bind only to IPv6 if possible. This avoids
ambiguities with IPv4-mapped IPv6 addresses. */
#ifdef IPV6_V6ONLY if (so.sin.sin_family == AF_INET6) { opt = 1; setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt)); } #endif
Maybe it's not working for you for some reason. Did you have this problem with earlier Dovecot versions? If you set listen = [::], can you still log in with IPv4?
participants (2)
-
Bruce A. Mallett
-
Timo Sirainen