Imapsync excluding Gmail folders

Can anyone share if they have had success with Imapsync “Excluded folders” with Gmail.

Neth version is the latest and fully patched.

Program fiels location -
Cockpit > email > synchronization (imapsync) > user > Advance Options > “Excluded folders” field

I am wanting to excluded the Gmail Important folder as well Gmail All Mail folder

Entries I have tried (for the Important folder) without the folder been excluded -

\[Gmail\]\/Important
^\[Gmail\]\/Important$

“[Gmail]/Important”
‘[Gmail]/Important’
^[Gmail]/Important$
“Important”
‘Important’
^Important$
^Important

Thanks in advance.

I have never tried to do an imapsync with gmail, but aren’t those folders with Gmail some kind of ‘virtual’ folders? If so, I can imagine that, since they might not be real folders, they can’t be excluded… (not based on evidence, so consider this speculation)

More informative: the faq by the creator of imapsync on Gmail:
https://imapsync.lamiral.info/FAQ.d/FAQ.Gmail.txt
(search for ‘exclude’ in the file for clues)

2 Likes

Hi Rob,

Yes, I had read that document before posting, and from what I make of it, one of the above entries I would have expected to correct.

I am hoping someone in the community has experience in the use of Imapsync with Gmail “Excluded folders”

I can not find a log file to help.

Maybe this is a bug?

If logs are not disabled in the source code then they might be in /var/log/imapsync.

IIRC, some folder names are localized (they vary according to the Gmail language settings). You can verify them by listing the IMAP folders (fun fact, gmail treats labels as “folders”).

I’ve used imapsync (CLI) with gmail to exclude some folders, but not the Important folder. But have not used the imapsync UI implemented on NethServer.

Thanks found the log files. Helped with sorting the issue.

Yes Gmail implantation of labelling ends up on the same emails being in each label and so the All Mails and Important has extra copies at least.

Any way I worked out the solution -

^.*All Mail$
^.*Important$

PS - May I suggest the information note might like to be updated to reflect the above solution is needed -
For [Gmail]/All Maill is ^.*All Mail$