Skip to content

Commit

Permalink
imap: increase connection-timeout to 90 seconds
Browse files Browse the repository at this point in the history
In case when the server does not support IDLE command, then default
value of the polling interval set in go-imap to 60 seconds is larger
then the default value of connection-timeout set to 30 seconds.
Therefore aerc disconnects while polling every 30 seconds, because there
is no activity.

This was tested on seznam.cz as well as a self hosted dovecot, where the
IDLE command was removed from announced capabilities.

Changelog-fixed: IMAP servers without IDLE support do not timeout
 while polling.
Changelog-changed: The default IMAP connection timeout has been
 increased to 90 seconds.
Signed-off-by: Jakub Růžička <[email protected]>
Tested-by: Karel Balej <[email protected]>
Acked-by: Robin Jarry <[email protected]>
  • Loading branch information
ruzickajakub authored and rjarry committed Mar 5, 2025
1 parent 5f97f73 commit 4038138
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/aerc-imap.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ are available:
Maximum delay to establish a connection to the IMAP server. See
https://pkg.go.dev/time#ParseDuration.

Default: _30s_
Default: _90s_

*keepalive-period* = _<duration>_
The interval between the last data packet sent (simple ACKs are not
Expand Down
2 changes: 1 addition & 1 deletion worker/imap/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (w *IMAPWorker) handleConfigure(msg *types.Configure) error {
w.config.idle_timeout = 10 * time.Second
w.config.idle_debounce = 10 * time.Millisecond

w.config.connection_timeout = 30 * time.Second
w.config.connection_timeout = 90 * time.Second
w.config.keepalive_period = 0 * time.Second
w.config.keepalive_probes = 3
w.config.keepalive_interval = 3
Expand Down

0 comments on commit 4038138

Please sign in to comment.