On Sun, 2009-04-05 at 01:41 +0100, Robert Goldsmith wrote:
I would like to make a feature request regarding IMAP Idle support.
Currently when a client triggers Idle support, Dovecot then sends 'OK
Still Here' messages every 2 minutes. This is apparently to prevent
NAT systems killing the tcp connection and disconnecting the client.
However, while this may be fine for desktop clients, this rapidly
drains the battery life of mobile clients such as phones.
Unfortunately, the timing control on this behaviour is a c define at
the top of cmd-idle.c and is only adjustable at compile-time. I have
experimented with this define and find a timeout of 20 minutes between
'OK' messages is perfectly adequate for my system setup and results in
a significant battery saving for my Nokia 6120c (increasing from ~ 6
hours to ~ 55 hours from full charge to low battery warning).
I had originally hoped not to have this setting, since there's really no good global value for it. Some people want to use mobile clients, others are behind NAT. Perhaps a single user has both, in which case all the values would be bad. So it would be nice if Dovecot was able to figure out automatically what the value should be, maybe based on IP address or something.
But that's too much work, so I just went and finally added the setting to v1.2: http://hg.dovecot.org/dovecot-1.2/rev/8de5b2a19a08
At least it's possible to make it a per-user setting (by returning from userdb). And perhaps if you really wanted to you could have the userdb do some kind of a IP lookup where it figures out if the source IP is mobile or not and return the value based on that.