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

3

7

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

Arbutus answered 19/8, 2009 at 9:30 Comment(2)
You should ask this sort of questions on Server Fault.Knighten
If you re-asked this on serverfault you should add a link here to the post there.Lexicographer
T
2

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 ...

Tympanites answered 22/8, 2009 at 8:47 Comment(2)
I was hoping I wouldn't have to roll some code to do this :). I know of the 'All Mail' route but that pulls down the 'unified' 'All Mail' view which is not really what I want.Arbutus
@sriram: Well, just check on server fault, someone should have had the same problem. If not just write the retriever, it seems that python is really easy ;-)Tympanites
A
1

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.

Alinealinna answered 28/8, 2009 at 17:27 Comment(0)
C
0
getmail --all

will get all mail (may have to run repeatedly)

Controversial answered 19/4, 2023 at 13:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.