Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for zipped maildirs #519

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

fxkr
Copy link

@fxkr fxkr commented Jul 3, 2016

This pull request adds support for maildirs stored in zip files.

The huge number of files in my maildir slows down my backups
tremendously. Therefore, I want to create yearly archives (single
files) of my emails -- but still have them in my mail client.
And I want the conversion to be fully reversible.

The alternative would be to convert the emails to mbox files.
There is http://archivemail.sf.net/ which hasn't been updated
in years, but seems to still work. However, I'm not confident
that the conversion will be correct (there are multiple mbox
variants and intricacies around escaping) and can safely be
reversed.

Why zip, why not tar+gzip? Because zip allows random access
whereas tar+gzip only allows sequential access.
There are a few downsides:

  1. It adds a dependency on rubyzip.
  2. Writeback isn't supported. It could be added.
    But it's not necessary for the intended use case.
  3. Apparently, no other mailclient supports it.
  4. The downside of zip is that a bit error at the wrong location
    (within the central directory of the zip file) can corrupt
    the entire zip file.

The implementation is straightforward. It adds a BaseMaildir
class of which Maildir and ZippedMaildir inherit and which
holds the common methods. There is relatively little code that
is actually new, but see ZippedMaildir for the new code.

I'm not happy with the method name do_poll (called by poll,
it's the first section of poll and contains the parts of poll
that are different in Maildir and ZippedMaildir), but
couldn't find a better name.

fxkr added 2 commits July 2, 2016 01:00
For example, the 'save message to disk' code currently expects
the method to be there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant