Is fetchmail resumable?

1

I hope "resumable" is the correct term.

I just installed mutt on my laptop. AFAIK mutt itself cannot download mails to the local filesystem, so you'll need something like fetchmail. I installed it, and here's my ~/.fetchmailrc

poll imap.gmail.com                   
protocol IMAP                      
user 'xxxxx@xxxxxx.xxxxx.xxxxx'        
there with password 'xxxxxxxxxx'        
mda "/usr/bin/procmail -d %T"        
options                                                             
fetchall
keep
ssl                                  
sslcertck
sslcertpath /home/anta40/.certs/

As you can see, my email is a Google Apps mail. I ran fetchmail -v. It worked: fetchmail downloaded my mails, starting from my very first mail. Now the problem is: fetchmail takes a long time to download all of my mails. I ran it at this 3 AM, and now at 6.20 AM, it's still running. This is the current output:

fetchmail: IMAP< A8479 OK Success
 not flushed
fetchmail: IMAP> A8480 STORE 12783 +FLAGS (\Seen)
fetchmail: IMAP< * 12783 FETCH (FLAGS (\Seen))
fetchmail: IMAP< A8480 OK Success
fetchmail: IMAP> A8481 FETCH 12784 RFC822.HEADER
fetchmail: IMAP< * 12784 FETCH (RFC822.HEADER {1570}
reading message xxxxx@xxxxx.xxxxx.xxxxx@gmail-imap.l.google.com:12784 of 40346 (1570 header octets) #
fetchmail: IMAP< )
fetchmail: IMAP< A8481 OK Success
fetchmail: IMAP> A8482 FETCH 12784 BODY.PEEK[TEXT]
fetchmail: IMAP< * 12784 FETCH (BODY[TEXT] {4370}
 (4370 body octets) **********************************.******************************.**********************.*************************.*********
fetchmail: IMAP< )
fetchmail: IMAP< A8482 OK Success
 not flushed
fetchmail: IMAP> A8483 STORE 12784 +FLAGS (\Seen)
fetchmail: IMAP< * 12784 FETCH (FLAGS (\Seen))
fetchmail: IMAP< A8483 OK Success
fetchmail: IMAP> A8484 FETCH 12785 RFC822.HEADER
fetchmail: IMAP< * 12785 FETCH (RFC822.HEADER {2137}
reading message xxxxx@xxxxx.xxxxx.xxxxx@gmail-imap.l.google.com:12785 of 40346 (2137 header octets) #
fetchmail: IMAP< )
fetchmail: IMAP< A8484 OK Success
fetchmail: IMAP> A8485 FETCH 12785 BODY.PEEK[TEXT]
fetchmail: IMAP< * 12785 FETCH (BODY[TEXT] {10257}
 (10257 body octets) ***************************.********************************.*********************************.************************************.*******************************.*******************************************.****************************.*****************************************.**************************************.*****************************.*
fetchmail: IMAP< )
fetchmail: IMAP< A8485 OK Success
 not flushed
fetchmail: IMAP> A8486 STORE 12785 +FLAGS (\Seen)
fetchmail: IMAP< * 12785 FETCH (FLAGS (\Seen))
fetchmail: IMAP< A8486 OK Success

12785 mails of 40346 mails downloaded. Hopefully my laptop will not get overheat. Well If I stop this operation, is it possible for fetchmail to resume the download, so it will not download starting from zero again?

anta40

Posted 2011-12-22T11:30:25.000

Reputation: 525

Answers

2

It seems to me that using --fetchall and --keep means you can't resume an interrupted fetch without re-fetching all previously fetch mail.

fetchall
Retrieve both old (seen) and new messages from the mailserver. The default is to fetch only messages the server has not marked seen.

keep
Keep retrieved messages on the remote mailserver. Normally, messages are deleted from the folder on the mailserver after they have been retrieved.


You might be interested in offline Gmail (review)


Update:

Part of the difficulty is that, as I'm sure you know, IMAP is designed so that all the mail is kept in one place and you access that service online from a variety of clients - all presenting the same view. A POP service expects you to download all your mail to a single local client (and delete it from the POP server). What you are trying to do is neither one nor the other. Fetchmail attempts to deal with this by only downloading messages marked as unread. If you mark some messages as read by accessing the IMAP server with a client, the server won't present those messages to fetchmail when it asks for unread messages. You want a local mirror of your IMAP mailbox regardless of message status. I don't know how to use fetchmail to achieve that.

RedGrittyBrick

Posted 2011-12-22T11:30:25.000

Reputation: 70 632

Hmm... I removed fetchall and keep from .fetchmailrc, and when I ran fetchmail -v on mutt, there were no new mails in the inbox. I guess that was because I already read all the mails, via iPad. But when I ran Thunderbird, I could see those mails in the inbox. So can we assume that the iPad didn't mark the already read mails? – anta40 – 2011-12-31T20:49:49.270

@anta40: See updated Answer. – RedGrittyBrick – 2012-01-01T11:36:05.340