How to declare port 143
Hi all,
I have Dovecot 2.4.2 working (plain text only) on my Qemu virtual machine, with Claws-Mail able to work with all its files. However, I want to declare the Dovecot server as running on Port 143, and when I do, I dovecot -F throws the error message shown later in this message. If I comment out the explicit port declaration, it works fine, and I want to know why. To the best of my knowledge, my declaration of port 143 exactly matches your 2.4.2 documentation:
The following is my attempt to tell Dovecot to serve *explicitly* at port 143:
===============================================
My Dovecot server will operate on Localhost
listen = 127.0.0.1
service imap { inet_listener imap-login { port = 143 }
inet_listener imaps {
port = 993
ssl = yes
}
}
The following is the result:
=============================================== [root@dovecotvoid ~]# dovecot -F doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf: duplicate listener: 143:127.0.0.1 [root@dovecotvoid ~]#
If I comment out the port = 143, it works. Why is it griping about a duplicate listener? At the bottom of this email is the entire dovecot.conf and the result of dovecot -n, and there are no sub-configuration files in conf.d :
===============================================
Start new configs with the latest Dovecot version numbers here:
dovecot_config_version = 2.4.2 # Must be current version dovecot_storage_version = 2.4.2 # Must be current version or earlier # 2.3 is minimum
I only want imap
protocols { imap = yes lmtp = no pop3 = no }
My Dovecot server will operate on Localhost
listen = 127.0.0.1
service imap { inet_listener imap-login { port = 143 }
inet_listener imaps {
port = 993
ssl = yes
}
}
mail_home is only for virtual users
A virtual user is a user with no system account
I have no virtual users, so I've commented out mail_home.
#mail_home = /srv/mail/%{user}
mail_driver is the storage format
mail_driver = maildir
mail_path is location of top of storage data
WARNING: For troubleshooting be prepared to switch
to literal location of ~
mail_path = ~/mail/Maildir # In my case
mail_home is the home directory of the user identified as ~
WARNING: system users have no ~ without it.
mail_home = /home/slitt
You need a log you can locate
There might not be a
log_path=/var/log/dovecot.log
#mail_uid = slitt #mail_gid = slitt mail_uid = vmail mail_gid = vmail
By default first_valid_uid is 500.
#If your vmail user's UID is smaller,
you need to modify this:
#first_valid_uid = uid-number-of-vmail-user
namespace inbox { inbox = yes separator = / }
Authenticate as system users:
passdb pam { driver = pam #driver = passwd }
userdb passwd { driver = passwd }
#ssl_server_cert_file = /etc/dovecot/ssl-cert.pem #ssl_server_key_file = /etc/dovecot/ssl-key.pem
The following is the output of dovecot -n:
===============================================
2.4.2 (0962ed2104): /etc/dovecot/dovecot.conf
OS: Linux 6.12.71_1 x86_64
Hostname: dovecotvoid
dovecot_config_version = 2.4.2 dovecot_storage_version = 2.4.2 listen = 127.0.0.1 log_path = /var/log/dovecot.log mail_driver = maildir mail_gid = vmail mail_home = /home/slitt mail_path = ~/mail/Maildir mail_uid = vmail protocols { imap = yes lmtp = no pop3 = no } service imap { inet_listener imap-login { port = 143 } } namespace inbox { inbox = yes separator = / } passdb pam { driver = pam } userdb passwd { driver = passwd }
===============================================
On February 20, 2026 3:40:59 AM GMT+02:00, Steve Litt via dovecot <dovecot@dovecot.org> wrote:
Hi all,
I have Dovecot 2.4.2 working (plain text only) on my Qemu virtual machine, with Claws-Mail able to work with all its files. However, I want to declare the Dovecot server as running on Port 143, and when I do, I dovecot -F throws the error message shown later in this message. If I comment out the explicit port declaration, it works fine, and I want to know why. To the best of my knowledge, my declaration of port 143 exactly matches your 2.4.2 documentation:
The following is my attempt to tell Dovecot to serve *explicitly* at port 143:
===============================================
My Dovecot server will operate on Localhost
listen = 127.0.0.1
service imap { inet_listener imap-login { port = 143 }
inet_listener imaps {
port = 993
ssl = yes
}
}
The following is the result:
=============================================== [root@dovecotvoid ~]# dovecot -F doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf: duplicate listener: 143:127.0.0.1 [root@dovecotvoid ~]#
If I comment out the port = 143, it works. Why is it griping about a duplicate listener? At the bottom of this email is the entire dovecot.conf and the result of dovecot -n, and there are no sub-configuration files in conf.d :
===============================================
Start new configs with the latest Dovecot version numbers here:
dovecot_config_version = 2.4.2 # Must be current version dovecot_storage_version = 2.4.2 # Must be current version or earlier # 2.3 is minimum
I only want imap
protocols { imap = yes lmtp = no pop3 = no }
My Dovecot server will operate on Localhost
listen = 127.0.0.1
service imap { inet_listener imap-login { port = 143 }
inet_listener imaps {
port = 993
ssl = yes
}
}
mail_home is only for virtual users
A virtual user is a user with no system account
I have no virtual users, so I've commented out mail_home.
#mail_home = /srv/mail/%{user}
mail_driver is the storage format
mail_driver = maildir
mail_path is location of top of storage data
WARNING: For troubleshooting be prepared to switch
to literal location of ~
mail_path = ~/mail/Maildir # In my case
mail_home is the home directory of the user identified as ~
WARNING: system users have no ~ without it.
mail_home = /home/slitt
You need a log you can locate
There might not be a
log_path=/var/log/dovecot.log
#mail_uid = slitt #mail_gid = slitt mail_uid = vmail mail_gid = vmail
By default first_valid_uid is 500.
#If your vmail user's UID is smaller,
you need to modify this:
#first_valid_uid = uid-number-of-vmail-user
namespace inbox { inbox = yes separator = / }
Authenticate as system users:
passdb pam { driver = pam #driver = passwd }
userdb passwd { driver = passwd }
#ssl_server_cert_file = /etc/dovecot/ssl-cert.pem #ssl_server_key_file = /etc/dovecot/ssl-key.pem
The following is the output of dovecot -n:
===============================================
2.4.2 (0962ed2104): /etc/dovecot/dovecot.conf
OS: Linux 6.12.71_1 x86_64
Hostname: dovecotvoid
dovecot_config_version = 2.4.2 dovecot_storage_version = 2.4.2 listen = 127.0.0.1 log_path = /var/log/dovecot.log mail_driver = maildir mail_gid = vmail mail_home = /home/slitt mail_path = ~/mail/Maildir mail_uid = vmail protocols { imap = yes lmtp = no pop3 = no } service imap { inet_listener imap-login { port = 143 } } namespace inbox { inbox = yes separator = / } passdb pam { driver = pam } userdb passwd { driver = passwd }
===============================================
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
This is because of service imap-login. It already has listener for port 143. Adding it to service imap directly won't work.
See doveconf service/imap-login
Aki
My install via homebrew of 2.4.2 is still crashing regularly. Same problem as before:
Feb 20 10:34:05 master: Panic: file ./time-util.h: line 40 (timeval_add_usecs): assertion failed: (usecs >= 0)
This started with the upgrade to 2.4. I was hoping that the (long in coming) upgrade to the homebrew formula would solve it, but no luck. In fact it might be happening more frequently (just an impression and not something I've actually timed).
John
On 20. Feb 2026, at 12.35, John Muccigrosso via dovecot <dovecot@dovecot.org> wrote:
My install via homebrew of 2.4.2 is still crashing regularly. Same problem as before:
Feb 20 10:34:05 master: Panic: file ./time-util.h: line 40 (timeval_add_usecs): assertion failed: (usecs >= 0)
This started with the upgrade to 2.4. I was hoping that the (long in coming) upgrade to the homebrew formula would solve it, but no luck. In fact it might be happening more frequently (just an impression and not something I've actually timed).
When laptop is opened after being suspended, I guess? This probably fixes it: commit 3da6d4d08990bcf4eded07156fa61335c5c8ac81 Author: Timo Sirainen <timo.sirainen@open-xchange.com> Date: Fri Feb 20 13:20:39 2026 +0200 lib: timeval_add/sub_usecs() - Fix usecs type Some callers expect it to be 64bit, but suseconds_t isn't guaranteed to be. Added assert mainly to catch callers that try to provide negative values as parameter, which wrap to large unsigned values. diff --git a/src/lib/time-util.h b/src/lib/time-util.h index 00516b11b5..6a0b30d7ba 100644 --- a/src/lib/time-util.h +++ b/src/lib/time-util.h @@ -35,9 +35,9 @@ timeval_from_usecs(struct timeval *tv_r, unsigned long usecs) } static inline void -timeval_add_usecs(struct timeval *tv, suseconds_t usecs) +timeval_add_usecs(struct timeval *tv, unsigned long long usecs) { - i_assert(usecs >= 0); + i_assert(usecs <= LLONG_MAX); tv->tv_sec += (time_t)(usecs / 1000000); tv->tv_usec += (usecs % 1000000); if (tv->tv_usec >= 1000000) { @@ -47,9 +47,9 @@ timeval_add_usecs(struct timeval *tv, suseconds_t usecs) } static inline void -timeval_sub_usecs(struct timeval *tv, suseconds_t usecs) +timeval_sub_usecs(struct timeval *tv, unsigned long long usecs) { - i_assert(usecs >= 0); + i_assert(usecs <= LLONG_MAX); tv->tv_sec -= (time_t)(usecs / 1000000); tv->tv_usec -= (usecs % 1000000); if (tv->tv_usec < 0) {
Hi, Timo. Yes, in this case I was waking up the laptop, but I'm not sure that's always the case. John
On Feb 20, 2026, at 12:27, Timo Sirainen <timo@sirainen.com> wrote:
On 20. Feb 2026, at 12.35, John via dovecot <dovecot@dovecot.org> wrote:
My install via homebrew of 2.4.2 is still crashing regularly. Same problem as before:
Feb 20 10:34:05 master: Panic: file ./time-util.h: line 40 (timeval_add_usecs): assertion failed: (usecs >= 0)
This started with the upgrade to 2.4. I was hoping that the (long in coming) upgrade to the homebrew formula would solve it, but no luck. In fact it might be happening more frequently (just an impression and not something I've actually timed).
When laptop is opened after being suspended, I guess?
This probably fixes it:
commit 3da6d4d08990bcf4eded07156fa61335c5c8ac81 Author: Timo Sirainen <timo.sirainen@open-xchange.com> Date: Fri Feb 20 13:20:39 2026 +0200
lib: timeval_add/sub_usecs() - Fix usecs type
Some callers expect it to be 64bit, but suseconds_t isn't guaranteed to be. Added assert mainly to catch callers that try to provide negative values as parameter, which wrap to large unsigned values.
diff --git a/src/lib/time-util.h b/src/lib/time-util.h index 00516b11b5..6a0b30d7ba 100644 --- a/src/lib/time-util.h +++ b/src/lib/time-util.h @@ -35,9 +35,9 @@ timeval_from_usecs(struct timeval *tv_r, unsigned long usecs) }
static inline void -timeval_add_usecs(struct timeval *tv, suseconds_t usecs) +timeval_add_usecs(struct timeval *tv, unsigned long long usecs) { - i_assert(usecs >= 0); + i_assert(usecs <= LLONG_MAX); tv->tv_sec += (time_t)(usecs / 1000000); tv->tv_usec += (usecs % 1000000); if (tv->tv_usec >= 1000000) { @@ -47,9 +47,9 @@ timeval_add_usecs(struct timeval *tv, suseconds_t usecs) }
static inline void -timeval_sub_usecs(struct timeval *tv, suseconds_t usecs) +timeval_sub_usecs(struct timeval *tv, unsigned long long usecs) { - i_assert(usecs >= 0); + i_assert(usecs <= LLONG_MAX); tv->tv_sec -= (time_t)(usecs / 1000000); tv->tv_usec -= (usecs % 1000000); if (tv->tv_usec < 0) {
participants (4)
-
Aki Tuomi
-
John Muccigrosso
-
Steve Litt
-
Timo Sirainen