Not sure if this would work (I think each application has to support this), but the keepalive kernel parameter is, by default, set to 7200s (2 hours). So doing (as root) # cat 600 > /proc/sys/net/ipv4/tcp_keepalive_time should do the keepalive thing every 10min. I will try setting my IMAP polling interval to something longer (1 hour) with keepalive at 1200 (20min), and see what happens.