[ale] Fetchmail IMAP backup

Steve Litt slitt at troubleshooters.com
Tue Jan 3 19:05:41 EST 2017


On Tue, 3 Jan 2017 13:37:43 -0500 (EST)
Chris Fowler <cfowler at outpostsentinel.com> wrote:


> I'm not moving anything on IMAP. He has a lot of mail and I need him
> to do auditing of data where the accurate data exists in his INBOX.
> To make it easier I'm making a copy of his INBOX and am filtering all
> those emails we need. Since I can program too I have MANY options of
> making it even more easier. We are going after serial numbers. I can
> search for serials in each email and then add a copy to a file for
> that serial number. Some of these emails have a XLS attachment with
> many serials. Perl SpreadSheet::ReadExcel can allow me to grok those
> with regex. 

So you're making a backup copy, and separating out the stuff that's
needed. The way I'd do that is as follows:

Make a very simple, brand new Dovecot IMAP server, and make sure it's
using Maildir.

Pull the mail down with fetchmail, making sure not to expunge, because
you want a duplicate. I have no idea what you mean by "daemon mode",
but I simply do the following:

fetchmail -f /home/slitt/mail/fm/.fetchmailrc

And within .fetchmailrc, near the top, I have the following line:

set daemon 180

When I want to grab mail right away, while fetchmail's already running,
I do the following:

fetchmail

I have fetchmail pass off each mail to procmail, where various recipes
would send each message to Dovecott Maildirs "Important" or
"Unimportant", as needed. The stuff in the Important folder is the
stuff of interest.

I'm not sure how procmail can use an external command to decide
something, but I bet it can, thereby accommodating your programming to
look in spreadsheets and the like.

SteveT

Steve Litt 
December 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21


More information about the Ale mailing list