Skip to content

Use IMAP's IDLE (a.k.a. "push") to automatically update folders with new incoming emails instead of a polling static refresh timer #118

@nekohayo

Description

@nekohayo

By default, usermin 2.102's webmail interface does not show new mails as they arrive, you have to manually click the Refresh button.

You can configure (on a per-user basis) an optional automatic refresh delay for it, but that seems like the wrong solution in this day and age:

  • You shouldn't have to have to configure this (for each user!) in the first place
  • Most users won't ever think of this, and will just think their webmail is broken (or miss important emails throughout the day)
  • It is inefficient and disruptive, because you may be reloading the web interface even when there are no new emails, which wastes CPU / power and bandwidth (which can be a problem if you're on a high-latency or roaming mobile connection)

It would make much more sense to just use IMAP's IDLE feature (a.k.a. standard "push") to be notified by the server when new messages come into the various folders (particularly the inbox, but also the "currently displayed folder" or "currently displayed search results" if possible), so that it can update the messages list view and the sidebar's unread counts.

For a full explanation, see also this great article: https://www.imageway.com/2018/email-hosting-blog/imap-idle-the-best-approach-for-push-email ; that article also explains that you need to have a small keepalive every 15-30 minutes (when the web client is active on the user's computer) to maintain the IDLE connection:

Data usage for IMAP IDLE is essentially the 15 minute NOOP to keep the connection alive, plus a small amount of data to do the notification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions