Skip to content

Account for Timeout <= 0 for sending IMAP NOOP cmd

David Vernet requested to merge Decave/mutt:fix_timeout_gt_zero into master

In imap_check_mailbox(), there is an if clause where we potentially poll IMAP with a NOOP command. This can be invoked on many ops, including if we e.g. move to the next message on the index. According to http://www.mutt.org/doc/manual/#timeout, the expected behavior of Timeout is that a timeout value of <= 0 will cause Mutt to never time out. We're not accounting for this in this if check, so setting timeout to 0 will cause this NOOP command to be sent all the time, which is the opposite of what the user wants.

Instead, add a check for Timeout > 0. Doing this makes my mutt instance going from almost being completely unusable in the pager due to latencies on almost every command, to much more seamless.

Signed-off-by: David Vernet void@manifault.com

Note: I also sent this as a patch to the mutt dev list: http://lists.mutt.org/pipermail/mutt-dev/Week-of-Mon-20221017/001403.html. I'm not sure whether that's preferred to gitlab, so I did both.

Merge request reports