views:

950

answers:

2

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

+2  A: 

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

neuro
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.
Sriram Krishnan
@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 ;-)
neuro
A: 

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.

Craig
interesting ...
neuro