<div dir="ltr"><div>So, the tool I use to get mail from Gmail and save it locally is 'getmail4' (name of package in Ubuntu).<br><br>I run it as follows, once a day from cron:<br><br>getmail -r gmail.rc<br><br></div>The gmail.rc file has the following:<br><div><div><br></div><div>#=== START<br></div><div>[retriever]<br>type = SimpleIMAPSSLRetriever<br>server = <a href="http://imap.gmail.com">imap.gmail.com</a><br>username = YOUR_EMAIL_ID # without @...<br>password = YOUR_PASSWORD<br>mailboxes = ( "[Gmail]/All Mail", "[Gmail]/Sent Mail", "[Gmail]/Drafts" )<br><br>[destination]<br>type = Maildir<br>path = ~/mail/gmail/<br><br>[options]<br>verbose = 0<br>message_log = ~/mail/gmail.log<br>read_all = false<br>max_messages_per_session = 1000<br>received = false<br>delete = false<br clear="all"><div><div>#=== END<br><br></div><div>You may need to enable that setting in Gmail that allows low grade encryption (or was it plain text?), forgot its exact name.<br><br></div><div>In the directory ~/mail/gmail, the script will create subdirectories
called 'cur', 'tmp', and 'new'. The first is what contains your emails. The
'new' directory contains some emails, not sure how they are different
from the ones in 'cur'.<br><br></div></div><div>As I mentioned, the objectives were to: <br><br>a) have a backup, and <br>b) find out which messages take the most space and delete them from Gmail<br><br></div><div>The first one is achieved, but all the messages are in one directory, one file each. So they are not sorted in any useful order nor by Gmail Label or date or anything. <br><br></div><div>They are searchable by grep and friends though, and size can be determined via ls (but that will just give you a list of cryptic file names, and you have to use less or something to look inside it).<br><br>You can point something like mutt to the directory, but not sure how the performance will be.<br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Khalid M. Baheyeldin<br><a href="http://2bits.com" target="_blank">2bits.com</a>, Inc.<br>Fast Reliable Drupal<br>Drupal optimization, development, customization and consulting.<br>Simplicity is prerequisite for reliability. -- Edsger W.Dijkstra<br>Simplicity is the ultimate sophistication. -- anonymous<br><br></div></div></div>
</div></div></div></div>