Configure MRA (fetchmail / getmail) to pull all folders from Gmail via POP / IMAP

I would like to configure fetchmail or getmail to output email from Gmail. I would prefer it to be IMAP, but I can live with POP too. The problem I'm running into is that all of this seems to want you to specify the exact list of folders you want to check (this is cleaner in IMAP than POP).

This is a problem because I often change my list of folders, and when I do this, I do not want to change my configuration file to add / remove folders. When something changes, I automatically want the mbox or maildir directory to appear along with the contents of my new folder. I would also prefer mbox to have the same name as the folder on the server

The closest I could find is the -r option in fetchmail, but that doesn't seem to be the same either. I am sure that something is missing for me, since every email client can do this, and I hope that this functionality lives inside the MRA, and not in the MUA.

Update: I would like to move this thread to Serverfault, and I'm fine with the vote to close it and migrate. Unfortunately, I do not have a reputation to do it myself yet

+4
source share
2 answers

Using getmail, you can use the following line in your configuration to receive all your mail:

mailboxes = ("[Google Mail]/All Mail",) 

Using IMAP, you can list folders on the server so that email clients can do whatever they need. In getmail, it depends on how the email retriever is written. If this configuration does not work, you can check the IMAP relay code and write a specific one that suits your needs; -)

my 2 cents

PS: I don't have getmail installed to check if this is handling the trick ...

+2
source

You can see imapsync . It is designed to recursively synchronize IMAP accounts. You need an IMAP account for the recipient. I have not tested it with gmail, but if gmail is a well-managed IMAP server, it should work.

0
source

All Articles