diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
commit | f7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch) | |
tree | a3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /src/lib-imap/imap-keepalive.h | |
parent | Initial commit. (diff) | |
download | dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.tar.xz dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.zip |
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib-imap/imap-keepalive.h')
-rw-r--r-- | src/lib-imap/imap-keepalive.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/lib-imap/imap-keepalive.h b/src/lib-imap/imap-keepalive.h new file mode 100644 index 0000000..238cdbd --- /dev/null +++ b/src/lib-imap/imap-keepalive.h @@ -0,0 +1,24 @@ +#ifndef IMAP_KEEPALIVE_H +#define IMAP_KEEPALIVE_H + +/* This function can be used to set IMAP IDLE keepalive notification timeout + interval so that the client gets the keepalive notifications at exactly the + same time for all the IMAP connections. This helps to reduce battery usage + in mobile devices. + + One problem with this is that we don't really want to send the notifications + to everyone at the same time, because it would cause huge peaks of activity. + Basing the notifications on the username works well for one account, but + basing it on the IP address allows the client to get all of the + notifications at the same time for multiple accounts as well (of course + assuming Dovecot is running on all the servers :) + + One potential downside to using IP is that if a proxy hides the client's IP + address, the notifications are sent to everyone at the same time. This can + be avoided by using a properly configured Dovecot proxy, but we'll also try + to avoid this by not doing it for the commonly used intranet IP ranges. */ +unsigned int +imap_keepalive_interval_msecs(const char *username, const struct ip_addr *ip, + unsigned int interval_secs); + +#endif |