Author Topic: IMAP optimizations  (Read 5587 times)

kunibald

  • Newbie
  • *
  • Posts: 7
IMAP optimizations
« on: January 19, 2016, 09:48:45 am »
Hi everyone,

short question: What does "IMAP optimizations" exactly do? What are "better mail servers"? What settings are necessary on server side?

Kind regards

mikeone

  • Hero Member
  • *****
  • Posts: 2746
Re: IMAP optimizations
« Reply #1 on: January 19, 2016, 09:59:43 am »
Hi,

You will find some information about this option in this post (the first one) from Kostya - sole developer of AquaMail -:

http://www.aqua-mail.com/forum/index.php?topic=2566.msg10635#msg10635
« Last Edit: January 19, 2016, 10:02:17 am by mikeone »

kunibald

  • Newbie
  • *
  • Posts: 7
Re: IMAP optimizations
« Reply #2 on: January 19, 2016, 10:20:28 am »
Thank you so far :) I'd love to know the settings for Dovecot to support the "whole-account mail checks".

Kind regards

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12742
Re: IMAP optimizations
« Reply #3 on: January 20, 2016, 05:28:03 pm »
You will need Dovecot 2.2 (Debian 8 is at 2.2.13, Ubuntu 14.04 LTS is at 2.2.9, both are fine).

To check that it's working:

Send yourself a test message, refresh "whole account" in AquaMail.

When that's done, do it again, you'll see that the app detects very quickly that there are no changes on the server, in any of the folders -- without checking each folder one by one.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

kunibald

  • Newbie
  • *
  • Posts: 7
Re: IMAP optimizations
« Reply #4 on: January 21, 2016, 01:22:42 pm »
I have a private server with Dovecot 2.2.18 installed but the "whole account" checks don't work (every folder is checked one by one). However the mail account of my university works fine, but I'm not sure about the used IMAP server or the configuration.

Does Dovecot need any special configuration?

Kind regards

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12742
Re: IMAP optimizations
« Reply #5 on: January 22, 2016, 03:02:01 pm »
The code checks server capabilities with IMAP's "CAPABILITY" command:

First, this has to be present:

- CONDSTORE

And then:

If the server is Dovecot (as seen in server greeting):

- There is a SPECIAL-USE capability (this indicates Dovecot 2.2+)

If the server is not Dovecot:

- QRESYNC capability

Here is what I get on my server:

Server greeting (sent when network connection is completed):

* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LOGINDISABLED AUTH=CRAM-MD5] Dovecot ready.

CAPABILITY after logging in:

CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE BINARY MOVE COMPRESS=DEFLATE

My dovecot-imapd version is 2.2.13-12~deb8u
« Last Edit: January 22, 2016, 03:23:05 pm by Kostya Vasilyev, Aqua Mail »
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

kunibald

  • Newbie
  • *
  • Posts: 7
Re: IMAP optimizations
« Reply #6 on: January 22, 2016, 05:15:33 pm »
Thanks for the details! I checked my server and got the following results:

OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN AUTH=DIGEST-MD5 AUTH=CRAM-MD5] Dovecot ready.

And after loggin in:

OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE NOTIFY QUOTA] Logged in

My server doesn't provide the SPECIAL-USE capability but it's definitely Dovecot version 2.2.18. Bug or feature?

EDIT: It seems like my Dovecot server doesn't provide the SPECIAL-USE capability as there are no SPECIAL-USE flags in mailbox configuration (see: http://www.dovecot.org/list/dovecot-cvs/2015-May/025779.html [nofollow]).
« Last Edit: January 22, 2016, 05:42:24 pm by kunibald »

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12742
Re: IMAP optimizations
« Reply #7 on: January 22, 2016, 05:25:12 pm »
Please see:

http://www.dovecot.org/list/dovecot/2011-December/132205.html

My 15-mailboxes.conf right now has those "special_use" values, but I'm not sure if it was me who added them, or they were already there with the default install.

##
## Mailbox definitions
##

# NOTE: Assumes "namespace inbox" has been defined in 10-mail.conf.
namespace inbox {

  #mailbox name {
    # auto=create will automatically create this mailbox.
    # auto=subscribe will both create and subscribe to the mailbox.
    #auto = no

    # Space separated list of IMAP SPECIAL-USE attributes as specified by
    # RFC 6154: \All \Archive \Drafts \Flagged \Junk \Sent \Trash
    #special_use =
  #}

  # These mailboxes are widely used and could perhaps be created automatically:
  mailbox Drafts {
    auto = create
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Trash {
    auto = create
    special_use = \Trash
  }

  # For \Sent mailboxes there are two widely used names. We'll mark both of
  # them as \Sent. User typically deletes one of them if duplicates are created.
  mailbox Sent {
    auto = create
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }

  # If you have a virtual "All messages" mailbox:
  #mailbox virtual/All {
  #  special_use = \All
  #}

  # If you have a virtual "Flagged" mailbox:
  #mailbox virtual/Flagged {
  #  special_use = \Flagged
  #}
}
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

kunibald

  • Newbie
  • *
  • Posts: 7
Re: IMAP optimizations
« Reply #8 on: January 22, 2016, 06:36:18 pm »
I added the "special_use" parameters as mentioned here: http://wiki.dovecot.org/MailboxSettings [nofollow] And it works finally! :) I have absolutely no idea why my Dovecot server missed these configurations...

I have one minor cosmetical issue: AquaMail now checks Inbox -> Sent -> finished. Why is the Sent folder checked?

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12742
Re: IMAP optimizations
« Reply #9 on: January 22, 2016, 06:52:24 pm »
Re: AquaMail now checks Inbox -> Sent -> finished. Why is the Sent folder checked

First, it depends on the number of folders to check -- it checks a few at a time, in batches.

Second, if your sent folder has ever had very few messages (over its lifetime) -- then it doesn't have a plausible looking HIGHESTMODSEQ yet. It should after it gets more use.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

kunibald

  • Newbie
  • *
  • Posts: 7
Re: IMAP optimizations
« Reply #10 on: January 22, 2016, 07:08:07 pm »
I think it's your first guess as I have around 10 folders to check.

Thanks for your patience! :) I think you've won another premium user ;)