Forgive me if this violates the RTFM principle, but I've researched this in the past without finding a concise answer. If someone has the answer at hand, it might save a lot of time and effort.
My understanding from past preliminary research is that IMAP is (or was, as of a year+ ago) a better option in terms of performance and convenience (e.g. no crapout after X number of messages fetched). However, I'd like to be able to remove messages from my gmail hosted mailbox image without losing them in my locally hosted mailbox image. The IMAP instructions I found were not clear (to me, at least) on how to achieve this. (It seemed possible / a feature at least nominally supported, but I had trouble identifying clearly defined instructions and implementations.)
Two questions: Is this indeed a possible/good/best approach? If so, does anyone have a pointer to a decent set of instructions?
IIRC, getmail and fetchmail both are focused on delivery of email and not with local management of emails. Using IMAP, to fetch emails in such a fashion doesn't really work. You would basically have to tell getmail/fetchmail to download only new emails... and even then you would end up with duplicate emails between runs.
On the other hand, Gmail's POP is non-standard. It records the last time that you pinged the POP server and only shows messages that were received after that time to the POP client talking to it. That's why it tells you the last time you fetched in the POP3 settings. Gmail's IMAP is more like a standard IMAP server and will show you all the email in the folder regardless of the last time that it was run.
To use IMAP effectively in the way that you want to, you would have to use something like offlineimap that syncs with IMAP, and somehow tell it to not delete emails that were fetched from the server. Or you could do full syncing with offlineimap and then do snapshot backups (rsync,rdiff,etc) of the gmail-backup folder. That way, you have the state of your Gmail account at different points. You could even have it do the snapshots as part of the syncing process (e.g. run the snapshot updater, then run offlineimap to sync new changes).
My understanding from past preliminary research is that IMAP is (or was, as of a year+ ago) a better option in terms of performance and convenience (e.g. no crapout after X number of messages fetched). However, I'd like to be able to remove messages from my gmail hosted mailbox image without losing them in my locally hosted mailbox image. The IMAP instructions I found were not clear (to me, at least) on how to achieve this. (It seemed possible / a feature at least nominally supported, but I had trouble identifying clearly defined instructions and implementations.)
Two questions: Is this indeed a possible/good/best approach? If so, does anyone have a pointer to a decent set of instructions?