+1 vote

Hi,

I want to "unarchive" emails from a certain sender - I need to flag them with \Inbox flag.

In the case where Folderinfos.AllMail.CanSelect is true, it's ok, I can reach them.

CommonFolders = new CommonFolders(imap.GetFolders());
imap.Select(CommonFolders.AllMail);
List<long> uids = imap.Search().Where(
    Expression.GmailRawSearch(@"from:(""me@domain.com""")));

But there are some Gmail address where there is no AllMail folder.
In that case, how to reach the archived messages ?

thx

by (260 points)
How do you mean "All Mail" is unavailable? I thought "All Mail" folder is available for all Gmail accounts? Can you provide a log (of Imap.GetFolders) for such account?
here is one :

Mail.dll:  7 10:02:52 S: * OK Gimap ready for requests from 82.229.177.37 ll10mb3163469wic
Mail.dll:  7 10:02:52 C: c78d8ddf14314f8e CAPABILITY
Mail.dll:  7 10:02:53 S: * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENTTOKEN
Mail.dll:  7 10:02:53 S: c78d8ddf14314f8e OK Thats all she wrote! ll10mb3163469wic
Mail.dll:  7 10:02:53 C: cc2d92c2545e49f2 ID (name Mail.dll version 3.0.14209.1116 vendor www.limilabs.com contact support@limilabs.com)
Mail.dll:  7 10:02:53 S: * ID ("name" "GImap" "vendor" "Google, Inc." "support-url" "http://support.google.com/mail" "remote-host" "82.229.177.37" "connection-token" "ll10mb3163469wic")
Mail.dll:  7 10:02:53 S: cc2d92c2545e49f2 OK Success ll10mb3163469wic
Mail.dll:  7 10:02:53 C: e70205f3540f4cc3 AUTHENTICATE XOAUTH2 dXNlcj1mcmFuY2lzLmRlbGVtZXJAZ21haWwuY29tAWF1dGg9QmVhcmVyIHlhMjkucWdEUS0tQk1oTzJLMWs1V0RRTXpmTTFScnI0RFl1emV3MDhIVDFIa1RuQjJDNzVGSkhJajV2LTUBAQ==
Mail.dll:  7 10:02:54 S: * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT
Mail.dll:  7 10:02:54 S: e70205f3540f4cc3 OK xxxxxxxxxxxxxxxxxx@gmail.com authenticated (Success)
Mail.dll:  7 10:02:54 C: 884480dfe96d47c7 XLIST "" "*"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "Archives"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "Call log"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "Freewares"
Mail.dll:  7 10:02:54 S: * XLIST (\HasChildren \Inbox) "/" "Bo&AO4-te de r&AOk-ception"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "INBOX/Api"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "Jean-Albert"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "PCPSA"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "Paul"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "Salons et Expos"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "Sent"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "Simenon"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "TAKAD BED"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "Trash"
Mail.dll:  7 10:02:54 S: * XLIST (\Noselect \HasChildren) "/" "[Gmail]"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren \Trash) "/" "[Gmail]/Corbeille"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren \Spam) "/" "[Gmail]/Spam"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "&AOA- conserver"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "&AOk-crituriale"
Mail.dll:  7 10:02:54 S: * XLIST (\HasNoChildren) "/" "&AOk-dition"
Mail.dll:  7 10:02:54 S: 884480dfe96d47c7 OK Success
Ah - of course, "All Mail" folder is there but it's not visible in IMAP. You must check "Show in IMAP" for this folder in Gmail' settings.

1 Answer

+1 vote

"All Mail" folder is there, but it's not visible in IMAP.

Make sure that "Show in IMAP" is checked for "All Mail" under "Gear icon"/Settings/System labels.

by (301k points)
So it's due to the user settings.
OK, thx !
Exactly - user settings.
...