Fetchmail Ate my inbox!

Hello All.

I was messing around with Fetchmail on a Test Email account. Here's what my fetchmailrc file looks like:

poll imap.gmail.com proto IMAP fetchall
ssl

When I ran this, it removed all the test emails from my Google Account. There were a few emails that I needed, however, I can still access them from my Linux machine, but would like to know if there was a way that I can move the email from my linux machine back to Google. Is there such a way I can do this, or am I screwed, and have to just read those emails I "lost" from my Linux box?

I believe for this not to happen again, I need to put "keep" in my fetchmail config file. But for now ... can I push those emails back to the server by any chance?

Regards,
Drew

There are tools for moving stuff between IMAP boxes; the simplest to set up is probably something like Thunderbird. Just set it up with a local mbox account and a remote Gmail IMAP account, and you should be able to drag messages back and forth. (Message orders, dates, etc might end up different from what they originally were, of course.)

Thanks for the reply. Do you have any idea what "tools" that I could use that pertain to the command line? This is a base install of CentOS 5.2. X is not installed. There is no GUI.

Thanks in advanced.
Drew

If you are familiar with Perl or Python, they come with IMAP libraries which let you do something like this, although you would have to write a wrapper script around those libraries.

examples/migrate_mbox.pl - metacpan.org vaguely looks like it might do what you want. Otherwise, the append method as described in lib/Mail/IMAPClient.pod - metacpan.org is the thing you should probably use.

I don't know the feature set of Mutt because I don't use it; perhaps it has support for moving between folders on different servers, too. My experience with Gnus IMAP support is that this particular functionality used to be a bit lacking.