Getting Mail from PRIMARY folder (Inbox)

Hello guys!

I just created this account to type this question out.
I want to get some mail from an account, using IMAP. The “Get IMAP Mail Messages” works, but not as I intended. The “Inbox” folder that I selected in the activity properties consists of “Primary”, “Promotions” and “Social”. The activity looks for the mail in ALL THREE of the folders.

Is there any way to make it look only for the mails in the “Primary” folder of Inbox?

Thank you in advance.

Set the MailFolder argument of the activity to “Inbox/Primary”.

Unfortunately, it did not work.
I get the following exception after changing to “Inbox/Primary”.

Source: Get IMAP Mail Messages
Message: The requested folder could not be found.
Exception Type: MailKit.FolderNotFoundException

Is it able to access the folder by just supplying “Primary” as an argument?

No, it gives the same exception. So far I’ve tried “Inbox/Primary” and “Primary”.

Any other suggestion?

I think the activity is not be able to identify subfolders within a parent folder. Being able to go into subfolders should be added to the UiPath activity.

There is likely a way to do this using visual basic, but it will likely not be convenient.

Hi
Welcome to uipath community
Can I have a view on the folder structure in gmail with a screenshot if possible

Cheers @andrei.nicolaescu15

This is what I’m talking about. The activity also gets the mail from the “Social” and “Promotions” subfolders of the big “INBOX” folder.

I only want the “Primary” subfolder to be searched for mail.

Thank you, @Palaniyappan

Fine
I think Primary is a default inbox tags and if we just mention as “Inbox” in the folder property it will usually get the mails from Primary category
And for others only we need to mention them as sub folder structure.

Kindly Just mention as “Inbox” and try

Cheers @andrei.nicolaescu15

That is what I tried the first time.
Mentioning only “Inbox” gets mail from all three subfolders (Primary + Social + Promotions).

1 Like

Hello @andrei.nicolaescu15 @Palaniyappan,

I have the same issue, it’s by default assigned to Inbox however the activity stores from the Primary and Promotions folder

even i faced the same issue, couldnt find any solution for this, but found a trick to neglect those emails, you can simply delete the latest 10-20 mails of both promotions and social, and select “newest-first” in the activity and run it, it would fetch all of them from the primary itself. (only if you don’t need those mails)

I Tried the below activity and I can read the mails, I used the Modren activity

@Divyashreem