Getting [Gmail] All Mail from different languages - gmail

I'm using python imaplib to read Gmail messages from the [Gmail] All Mail folder.
For most accounts, the all mail folder is named "[Gmail] All Mail". However, a couple accounts have it as: "[Gmail]/&BBIEQQRP- &BD8EPgRHBEIEMA-"
It seems to be related to an account in a foreign language.
Does anyone recognize the encoding?
Is there a way to figure out which folder is the "All Mail" folder?
Alternatively, is there a systematic way of getting all the possible names of the All Mail folder so I can search for it?

GMail supports an XLIST function to get the localized name of the folder.
See Gmail IMAP Extensions

Related

Download links from email

I am trying to download pdf available in email as hyperlinks. The reason I need this is that I get emails with several such links that needs to be downloaded and saved on a location.
Is there a way this could be automated. Tried checking out ways to do it using python or VBA but no viable solutions so far. This is O365 that I need help on and the hyperlink is embedded in the text highlighted in blue..
You should check the smtp,smtpd modules for a direct interaction with the server.
In the smtp server module you could download the mail locally and extract the info directly and locally, it's useful if you want to keep a backup of your mail, and keep clean your inbox.
In the smtp client module, you could read the email, save it as a object and extract the elements with the mime module, the extract (file) should be translated to a file object and/or saved in de pc as a file with it's extension.
Note: you should look in the internet for the configuration of your mail service to connect in the correct way and the correct sequence of steps, because some servers need a validation of the connection before login and others after the login.

Need IFTTT recipe to send specific gmail attachments to specific dropbox folders

For example: Email arrives with subject "Report for domaina.com". It has an attachment. I want to setup the recipe to save domainareport.pdf to Dropbox under /reports/Domaina. I'd then create similar recipes for domainb, domainc, etc. Seems like this is possible, but I'm a total IFTTT nub. Thanks!
Create a trigger on gmail using email from search and typing in this
Create an action using Dropbox and it will have automatically filled
out everything EXCEPT the folder path edit the folder path so it looks like this
Hope this helps :)

Outlook REST API - getFolders not returning all folders

I'm just getting started with the Outlook REST API. My baseline is the tutorial that uses node-outlook.
First order of business is to retrieve all of the folders in my mail account.
So I issue this REST request:
GET https://outlook.office.com/api/v2.0/Me/MailFolders
Instead of returning all of my folders, it only returns the "well known" folders:
Clutter
Deleted Items
Drafts
Inbox
Junk Email
Outbox
Sent Items
Trash
Am I missing a query parameter or something that says, "no, really, all of them please"?
UPDATE
I tried a different email account, and I also don't get all of my actual folders, but I get a different subset (some of which are well-known, others aren't).
I am implementing the paging protocol (using the #nextLink parameter) so it's not a matter of page sizes. I am getting these 8 folders on one account, and 18 folders on another.
So there must be something that decides what folders will be returned.
UPDATE 2
I changed to doing a folder sync instead using the "beta" API. In this case, I also get an unnamed folder in the list, which is the parent of the other folders. It comes along with a ChildFolderCount which is accurate. However, when I do a child folder request on that folder id I get the same list.
UPDATE 3
Here's the request url I'm using when I attempt to read the child folders of the one folder that comes back with a non-zero ChildFolderCount.
GET https://outlook.office.com/api/beta/Me/MailFolders/AAMkADRmMzFmNjZmLWU3MjctNGZiNi1iZTg4LTRmNGQwYTVhMDgxYgAuAAAAAAB8IxaZ5KGbQom4EPywGCSdAQDVy0eYwAzLS63k5pohzykCAAAAAAEJAAA=/childfolders
Here's what appears to define what folders are returned by this API and what are not:
If I create a folder in office365 directly on outlook webmail, it shows up in this query.
If I create a folder in Mac Mail, it does not.
Mac Mail accesses the service using EWS, so I would expect a folder created by it would be like any other folder.
So there is something about folders created on Mac Mail that prevents them from being returned by this API.
Folders created in Mac Mail DO show up in web mail and vice versa.
Folders created on an iPhone DO show up, so in my limited testing it looks like Mac Mail may be the only app suffering from this problem. The problem I have is most of my folders were created in Mac Mail and I have no easy way of rebuilding them.
I'm thinking this is just a BUG in the API. At any rate, this answers my original question and should help anyone out there trying to use the new API.
If I find a workaround I'll post it here.

How to scan ALL mail via Gmail API?

After I OAuth my google account I can connect to it via the IMAP protocol. Listing folders lists all the "labels" plus "[Gmail]" which isn't selectable.
Is there any way to list ALL mail and/or at least get into the trash? Also what about archived - those don't show up in the INBOX folder
I did some digging around and tried this:
var_dump($storage->getFolders('[Gmail]'));
which doesn't list anything... but this does:
var_dump($storage->getFolders('[Gmail]/Trash'));
How can I list all those folders
[Gmail]/All Mail contains all of your messages in Gmail, including your sent and archived messages. Any messages that you see in your inbox will also appear in the [Gmail]/All Mail folder.

Setting up a MRA (fetchmail/getmail) to pull all folders from Gmail over POP/IMAP

I would like to setup fetchmail or getmail to pull email from Gmail. I would prefer it to be IMAP but I can live with POP as well. The issue I'm running into is that all these seem to want you to specify the exact list of folders you want checked (this is cleaner in IMAP than POP).
This is a hassle since I frequently change my list of folders and when I do, I don't want to have to change my configuration file to add/remove folders. When something changes, I automatically want a mbox or a maildir directory to 'show up' with the contents of my new folder. I would also prefer the mbox to have the same name as the folder on the server
The closest thing I could find was the -r option in fetchmail but that doesn't seem to do this either. I'm sure I must be missing something since every email client is able to do this and I'm hoping that that functionality lives inside the MRA and not in the MUA.
Update: I'd like to move this thread to Serverfault and I'm ok with voting to close this and migrate. Unfortunately, I dont have the rep to do it myself yet
With getmail you can use the following line in your configuration to get all your mail :
mailboxes = ("[Google Mail]/All Mail",)
With IMAP you can list the folders on the server, that way email clients can do whatever they need. In getmail it depends on how the email retrievers are written. If this configuration does not work, you can check the IMAP retriever code and write a specific one that suits your needs ;-)
my 2 cents
PS: I have no getmail installation to check if that do the trick ...
You could look into imapsync. It is designed to recursively sync up IMAP accounts. You will need an IMAP account for the destination. I have not tested it with gmail but if gmail is a well behaved IMAP server it should work.

Resources