Maintains maildir archives synced with current maildirs

git clone


2021-09-19 Switch to SHA256 for mail checksum calculation Sören Tempel
2021-02-22 Use less APIs deprecated with go 1.16 Sören Tempel
2021-02-22 tests: Rename all files to fix go install warning Sören Tempel
2021-02-22 go.mod: Initialize Sören Tempel
2020-07-25 Rename isMaildir function to isMaildirFn Sören Tempel

Clone the repository to access all 62 commits.


Maintains maildir archives synced with current maildirs.


I only store the last N messages in the maildir on my mail server, I maintain a local archive which contains all mails I ever received. This tool helps propagating new and modified messages from the maildir on my server to my archive.


Sample usage for archiving the INBOX and GitHub maildir:

$ archive-mail mail/INBOX→/srv/nfs/archive/mail/INBOX \

This will propagate the following changes to the archive:

  1. New messages from the current maildir, which were previously not tracked in the archive.
  2. Changed flags, or file names in general, of messages already tracked in the maildir archive.
  3. Location changes of messages in the archive. For example, messages moved between new/ and cur/ and messages moved between different maildirs. For example, between INBOX and GitHub in the example above.

The current maildir will never be modified. Messages deleted from the current maildir will also not be deleted from the archive.


After cloning this repository compile the software as follows:

$ go build

Afterwards copy the binary to your $PATH or use go install.


A minimal test suite is provided it can be invoked as follows:

$ ./tests/


This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see