maildirdMaildird is a small Python program I use to sort my email.Download Maildird attempts to solve the problem of sorting mail that has
already been delivered to a Maildir. When Procmail wants to be
inserted in the middle of the delivery chain, Maildird calmly waits
until the mail is delivered, notices that a new mail has arrived in
the Maildir it monitors, writes something useful in the log that
(hopefully) is connected to stdout, runs some tests and moves the
mail safely to the correct Maildir. On the other hand it is nothing
more than a few lines of Python, so it performs no magic.
Safety is first priority. Maildird is designed to avoid getting in
situations where mail might be lost. But of course it comes WITHOUT
ANY WARRANTY, see below.
This is currently something of a hack. It should work safely and
reliably, but there is no separate configuration file, command line
arguments or even external documentation. Configure by changing the
source.
I use Maildird like this:
.forward directs mail to /home/jc/mail/unsorted/
Maildird is running on another computer which mounts that directory
through NFS. A cron job runs once every hour and runs
if it notices that Maildird is not running.
If a mail is received, Maildird notices within a second, logs and
moves the mail to the right place.
There is not much that can go wrong. If the mail server ignores
.forward every mail is stored in the inbox. If Maildird is not
running every mail is left in the unsorted folder until Maildird is
restarted.
If a mail is sorted incorrectly, I teach Bogofilter or update the
rules and then simply move the mail back to the unsorted mailbox to
let Maildird process it again.
Mostly relevant for Lysator users: The script I use to start
maildird looks like this:
and my crontab on koeberg contains
. /var/mail/jc/.forward contains the single line
.
Note: Some programs like MUAs and mail syncing programs might add
headers, which will make the mails SHA-1 not match the ones in the
log. For me, running the mail through
before calculating the SHA-1 makes the hash identical to the logged
one. YMMV.
The latest version of maildird is probably available somewhere
around http://www.lysator.liu.se/~jc/hacks/maildird .
Changelog:
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 2
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.
|
|
Jörgen Cederlöf <jc@lysator.liu.se> |