[ale] Fetchmail IMAP backup

Chris Fowler cfowler at outpostsentinel.com
Tue Jan 3 14:24:08 EST 2017


> From: "Steve Litt" <slitt at troubleshooters.com>
> To: ale at ale.org
> Sent: Tuesday, January 3, 2017 12:50:40 PM
> Subject: Re: [ale] Fetchmail IMAP backup

> On Tue, 3 Jan 2017 10:14:53 -0500 (EST)
> Chris Fowler <cfowler at outpostsentinel.com> wrote:

> > I'm a bit confused on what I can do with fetchmail with IMAP.


> > I want to connect to a remote IMAP server, fetch email, but not
> > delete them (keep). I want to do this all the time so that I can use
> > procmail on where fetchmail is running to search these emails, sort
> > them based on criteria.

> poll mail.bagelpatunias.com protocol IMAP:
> user 'slitt at bagelpatunias.com' there is 'slitt' here
> pass 'wouldnt_you_like_to_know'
> limit 50000000
> warnings 3200
> expunge 60
> mda "/usr/bin/procmail -d %T"
> fetchall
> ssl;

> To leave the mail on the IMAP server, eliminate the expunge command
> (try it to make sure, I've been wrong before).

I think I found a combo that work. 

I need to use POP3 instead of IMAP. This is allowed over VPN. Blocked on the Internet side. No problem. I use -U (uidl) option with fetchmail. I use keep with fetchmail. Dovecot support UUIDs. 

Fetchmail updates a file with UUIDs seen. 

I can do this processing in cron instead of a daemon. If no ~/.fetchids exists I create it, give it the correct perms, and do a fetchall. Each execute of fetchmail will only retrieve the new ones. 

when fetchmail craps out this time I should just be able to pick up. 

--fetchall may not be related to UIDL in the client. Fetchall tells fetchmail to retrieve all emails, even the ones marked by the server as seen. UIDL tracking is done by the client using a file. If I'm guessing right then this should do exactly what I need it to do. Now continuing this typing I noticed I was wrong. 

This is correct: 
1. Remove option fetchall from .fetchmailrc 
2. In wrapper calling fetchmail look for ~/.fetchids. If not there create it and use -a (fetchall) 
3. If there do not use -a fetchmail will do the right thing. 

I've added flock to the bash wrapper to make sure only one at a time from cron. I'll run this from cron every 30 minutes or so. It will do what it needs to do. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20170103/8af9eff2/attachment.html>


More information about the Ale mailing list