Article: GMAIL archiving and folder structure in MailStore Home

Symptom / Issue:

In MailStore Home one no longer sees the option to select what GMAIL folders to import (“Folders: All email folder. Spam and trash excluded […]” in the account setup).
Instead, all folders are imported. Furthermore, after the import, all emails are listed under ‘Inbox’, and the folder tree is available.

Is this intended behavior, or is there something to consider?

Resolution / Workaround

This is behavior is by design. The label concept in GMAIL never worked reliably and consistently with MailStore except in very narrow use-cases, and as a result, the new MailStore archiving profile for GMAIL focuses on archiving all messages, rather than specific labels.

Analysis / Background:

The issue comes down to the fact that when you label a message in GMAIL, a copy is added to a folder (whereas traditionally in IMAP, messages would be moved instead of copied). MailStore only allows a single instance of a message to be archived, so when a message is discovered in two folders, for example, in the [Gmail]/All Mail folder and a named label, only one instance is archived.

Even more confusing is the fact that labels are applied to messages with different rules in GMAIL’s web interface than on the IMAP server, so a conversation thread that appears to be in one label in the web User-Interface (UI) may not entirely exist in that label on IMAP, you might find some messages are missing in that IMAP label and that those messages are found elsewhere.

Due to the confusing nature of the way GMAIL handles labels and the fact that by design MailStore will only archive a single instance of any particular message within that account, this caused user confusion and so the choice was made to simplify the interface.

Resolution / Workaround:

Once you understand the situation and still want to have the old behavior back, this can be actually accomplished.
Instead of using the GMAIL archiving profile you can manually create an IMAP account, use Google’s IMAP server and an App-Specific password (or your account’s default password, if you have not yet set up the two-factor authentication), and enable Google’s “Allow less secure apps” option.

This will give you the same experience as was the default in earlier MailStore versions.

Finally, be aware that in IMAP mode a ‘Delete’ option will be offered. Do not use it with GMAIL as GMAIL does not actually honor deletes. Instead, it treats an IMAP ‘Delete’ instruction as a ‘Remove from this label’ instruction.

Also: App Passwords are only needed if your Google account uses Two-Factor Security, if not, you don’t need (and can’t create) an App Password. If you don’t use Two-Factor Security and therefore cannot create an App Password, then instead, you need to enable password based authentication, which is available at Google - Less Secure Apps :globe_with_meridians:

Further Reading and Information