# Override the IMAP CAPABILITY response.
#imap_capability =
+ # How many seconds to wait between "OK Still here" notifications when
+ # client is IDLEing.
+ #imap_idle_notify_interval = 120
+
# ID field names and values to send to clients. Using * as the value makes
# Dovecot use the default value. The following fields have default values
# currently: name, version, os, os-version, support-url, support-email.
#include <stdlib.h>
-/* Send some noice to client every few minutes to avoid NATs and stateful
- firewalls from closing the connection */
-#define KEEPALIVE_TIMEOUT (2*60)
-
struct cmd_idle_context {
struct client *client;
struct client_command_context *cmd;
{
struct client *client = cmd->client;
struct cmd_idle_context *ctx = cmd->context;
+ uoff_t orig_offset = client->output->offset;
if (cmd->cancel) {
idle_finish(ctx, FALSE, FALSE);
}
ctx->sync_ctx = NULL;
}
+ if (client->output->offset != orig_offset &&
+ ctx->keepalive_to != NULL)
+ timeout_reset(ctx->keepalive_to);
if (ctx->sync_pending) {
/* more changes occurred while we were sending changes to
ctx->cmd = cmd;
ctx->client = client;
- ctx->keepalive_to = timeout_add(KEEPALIVE_TIMEOUT * 1000,
- keepalive_timeout, ctx);
+ ctx->keepalive_to = client->set->imap_idle_notify_interval == 0 ? NULL :
+ timeout_add(client->set->imap_idle_notify_interval * 1000,
+ keepalive_timeout, ctx);
if (client->mailbox != NULL) {
const struct mail_storage_settings *set;
DEF(SET_BOOL, verbose_proctitle),
DEF(SET_UINT, imap_max_line_length),
+ DEF(SET_UINT, imap_idle_notify_interval),
DEF(SET_STR, imap_capability),
DEF(SET_STR, imap_client_workarounds),
DEF(SET_STR, imap_logout_format),
break large message sets to multiple commands, so we're pretty
liberal by default. */
MEMBER(imap_max_line_length) 65536,
+ MEMBER(imap_idle_notify_interval) 120,
MEMBER(imap_capability) "",
MEMBER(imap_client_workarounds) "outlook-idle",
MEMBER(imap_logout_format) "bytes=%i/%o",
/* imap: */
unsigned int imap_max_line_length;
+ unsigned int imap_idle_notify_interval;
const char *imap_capability;
const char *imap_client_workarounds;
const char *imap_logout_format;