mboxvievfs
Tomi Ollila
tomi.ollila at iki.fi
Fri Oct 24 07:47:23 PDT 2014
Hi
mboxviewfs is a FUSE filesystem program which shows mbox file
as a separate files under YYYY-MM directories in a mountpoint.
example usage transcript:
$ cd ~
$ mkdir notmuchmailbox
$ cd notmuchmailbox
$ wget https://raw.githubusercontent.com/domo141/nottoomuch/master/mboxviewfs.c
...
2014-10-24 17:23:33 (524 KB/s) - ‘mboxviewfs.c’ saved [31966/31966]
$ sh mboxviewfs.c
+ exec gcc -std=c99 -Wall -Wno-long-long -Wstrict-prototypes -pedantic -Wcast-align -Wpointer-arith -W -Wwrite-strings -Wcast-qual -Wshadow -O2 -o mboxviewfs mboxviewfs.c -D_FILE_OFFSET_BITS=64 -isystem /usr/include/fuse -pthread -lfuse
$ wget -c http://notmuchmail.org/archives/notmuch.mbox
$ mkdir notmuch
$ ./mboxviewfs notmuch.mbox notmuch
$ find notmuch -ls
$ find notmuch | xargs stat -c '%x %n'
$ wget -c http://notmuchmail.org/archives/notmuch.mbox
$ fusermount -u notmuch
$ ./mboxviewfs notmuch.mbox notmuch
$ mkdir bin
$ echo '#!/bin/sh' > bin/notmuch
$ echo "HOME=$HOME/notmuchmailbox; export HOME" >> bin/notmuch
$ echo "exec \"`which notmuch`\" \"\$@\"" >> bin/notmuch
$ chmod 755 bin/notmuch
$ mkdir mail
$ mkdir mail/notmuch
$ cd mail/notmuch
$ : symbolic links to mail directories
$ for d in ../../notmuch/*; do test -d "$d" || continue; ln -s "$d" .; done
$ ls -l
$ cd ../..
$ ./bin/notmuch setup ;: careful here, to run ./bin/notmuch '!!!'
$ ./bin/notmuch new
Found 19424 total files (that's not much mail).
Warning: /home/too/notmuchmailbox/mail/notmuch/2009-11/000002e4 is an mbox containing a single message,
likely caused by misconfigured mail delivery. Support for single-message
mboxes is deprecated and may be removed in the future.
Processed 19424 total files in 1m 21s (239 files/sec.).
Added 19414 new messages to the database.
$ ./bin/notmuch count
19414
$ find notmuch -type f | wc
19424 19424 485600
$ : have to look that difference later...
$ PATH=$PWD/bin:$PATH emacs -f notmuch
19 414 inbox 19 414 unread 40 unread-1d
C-x C-c
$ fusermount -u notmuch
$ ./bin/notmuch count
19414
$ ./bin/notmuch new
Error reading file /home/too/notmuchmailbox/mail/notmuch/2009-11: No such file or directory
No new mail.
Note: A fatal error was encountered: Something went wrong trying to read or write a file
zsh: exit 1 ./bin/notmuch new
$ wget -c http://notmuchmail.org/archives/notmuch.mbox
$ ./mboxviewfs notmuch.mbox notmuch
$ ./bin/notmuch new
Warning: /home/too/notmuchmailbox/mail/notmuch/2014-10/00004be0 is an mbox containing a single message,
likely caused by misconfigured mail delivery. Support for single-message
mboxes is deprecated and may be removed in the future.
Processed 1 file in almost no time.
Added 1 new message to the database.
$ ./bin/notmuch count
19415
---8<---
Next: to set nmbug to this system...
Tomi
More information about the notmuch
mailing list