# 2013-08-02 Fetchmail and Gmail

I’m using fetchmail to keep a copy of all my Gmail stuff.

defaults mda "/usr/bin/procmail -d alex"
fetchsizelimit 0
limit 0
poll pop.gmail.com protocol
pop3
keep
ssl 

The reason for the mda lines up there is that I don’t have a working mail installation on this machine, I think. I haven’t touched this file in a long time.

Anyway, I’ve noticed this output:

fetchmail: Server certificate verification error: unable to get local issuer certificate
fetchmail: Server certificate verification error: certificate not trusted
577 messages (451 seen) for kensanata@gmail.com at pop.gmail.com (59586522 octets).
...
...
reading message kensanata@gmail.com@gmail-pop.l.google.com:577 of 577 (47301 octets) not flushed

What are these 451 “seen” messages doing? Can I get rid of them? Have I downloaded these before? Rerunning fetchmail keeps telling me about the 451 seen messages and downloading a new set of mails. It’s weird.

Tags:

“Seen” are emails in the inbox that fetchmail knows about – it probably caches the headers/msg ids locally, pop3 doesn’t really support this, but clients can hack around. So, basically, if you have emails lingering in the GMail Inbox, they will be listed over and over again whenever you poll via pop3. This may be clearer if you switch to a protocol that actually considers syncing mailboxes and state, i.e. IMAP rather than pop to get your messages from GMail.

– Harald 2013-08-02 21:05 UTC

Incorrect Harald. The same thing happens with IMAP, except I have 740,000 messages in my inbox!

fetchmail: skipping message webalert@cldssinc.com@gmail-imap.l.google.com:739191 not flushed
fetchmail: skipping message webalert@cldssinc.com@gmail-imap.l.google.com:739193 not flushed

Is there a better solution than using fetchmail? It seems to be very wasteful when polling, maybe there is something I am missing.

poll imap.gmail.com protocol IMAP and I use ssl and idle options