[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Maildir on Reiser, and related musings



I just thought I'd pass this along.  I'm moving some stuff from mbox
to maildir. The maildirs are stored on reiserfs.  As a test, I moved
just some "small" folders in a test directory over.  They're stuff
under people, and a Sent folder.

sauer@zipper:~$ df -m Maildir
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/mapper/zipper-home
                          7680      6314      1367  83% /home
sauer@zipper:~$ du -mcs Maildir/.INBOX.cloud233.*
10      Maildir/.INBOX.cloud233.people.beth
1       Maildir/.INBOX.cloud233.people.jchaffee
3       Maildir/.INBOX.cloud233.people.norvin
3       Maildir/.INBOX.cloud233.people.people
1       Maildir/.INBOX.cloud233.people.sauerf
1       Maildir/.INBOX.cloud233.people.taveirne
1       Maildir/.INBOX.cloud233.people.tokarek
1       Maildir/.INBOX.cloud233.Sent
16      total
sauer@zipper:~$ rm -fr Maildir/.INBOX.cloud233.*
sauer@zipper:~$ df -m Maildir
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/mapper/zipper-home
                          7680      6305      1376  83% /home

sauer@cloud233:~/Mail > du -msc people/ Sent
8       people
0       Sent
8       total

So, on cloud233 the messages are stored in mbox format.  They're being
copied over via imap to zipper, which uses maildir on reiserfs.  The
significant points here are that du reported the mbox files to be 8
(actually 8.3) MB total.  On zipper, du says that they add up to about
16MB, but when they're removed, df says that only about 9BM of space was
freed.  The fine reiser developers say to trust df, due to the way file
tails are stored.  I'm inclined to think that's somewhat accurate.

Anyway, I basically just found it interesting that Reiserfs apparently
stores about 16MB of maildir-format messages in around 9MB, which is just
barely more than the space required to store the messages in just a few
flat mbox files.  Maybe someone else finds it similarly interesting...

As an aside, the IMAP server is Dovecot on Ubuntu with the messages stored
over NFS, and I'm pretty happy with Dovecot.  Also, I'm migrating the
messages with a simple one-liner sh script which uses mutt to read local
mbox files and save them to a remote IMAP server - it was quicker than
writing a perl script.  The script is broken up here for readability in
case anyone cares.

#!/bin/sh
D=${1:-'./'}
cmda='T.\n;simap://sauer@pyro/INBOX.cloud233.'
cmdb='\noPASSWORD\nyqn'
cd ~/Mail
for F in $(find $D -type f | sed 's/^\.\///')
do
  mutt -f "$F" -e "push \"$cmda$F$cmdb\""
done

PASSWORD is my password (not really), and I have to press "o" to accept the
ssl certificate for the IMAP server.  The script's run from within ~/Mail/,
which contains a structure of mbox files in folders.  The mail server's
pyro, and my username is sauer.  The push command is darned handy with mutt
- just remember the keys you typed, and put them in a string after push,
adding \n wherever you presed enter.  Actually, now I feel like I'm
recording a macro on Win 3.1. :(

Ok, off to start the full 2GB mail migration before going to bed.
Hopefully a piece of that's helpful to someone, someday. :)

--Danny

-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.