Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
C
Makefile
Latest commit
3883f5b
Apr 6, 2015
With truncated messages some bug happened. The imap parsing has been improved to detected split (seperate in 2 packets) "\r\n" sequence as well as split numbers. The imap parsing engine has been updated to be more robust and avoid infinite loop. This has been test by playing a connection scenario with 1 byte packets in userland, no crashes nor valgrind issues happened.
| Failed to load latest commit information. | |||
|
|
tools | ||
|
|
.gitignore | ||
|
|
Makefile | ||
|
|
README | ||
|
|
mfs_client.c | ||
|
|
mfs_client.h | ||
|
|
mfs_cmdqueue.c |
|
|
|
|
mfs_cmdqueue.h | ||
|
|
mfs_dir.c |
|
|
|
|
mfs_dir.h |
|
|
|
|
mfs_file.c | ||
|
|
mfs_file.h | ||
|
|
mfs_imap.c | ||
|
|
mfs_imap.h |
|
|
|
|
mfs_imap_parse.c | ||
|
|
mfs_imap_parse.h | ||
|
|
mfs_imap_send.c |
|
|
|
|
mfs_imap_send.h | ||
|
|
mfs_inode.c |
|
|
|
|
mfs_inode.h | ||
|
|
mfs_mod.c | ||
|
|
mfs_super.c | ||
|
|
mfs_super.h |
|
|
README
MFS === Mfs or Mailfs is a linux kernel IMAP file system. It allows to mount an IMAP server in a directory and reading mails by reading files. NOTICE ------ This project is at its early stage, and has only a pedagogic purpose to help me learn how fs and networking work inside linux kernel. If you still want to give it a shot I strongly recommend to test it in a VM. Build it -------- Simply run "make". Hopefully everything will build ok. To compile with debug kernel messages run "make DEBUG=1" How to use it ------------- As root user: insmod ./build/fs/mfs.ko mount -o port=IMAPPORT,login=IMAPLOGIN,pass=IMAPPASS -tmfs IPADDR /mnt/mail As normal user: ls /mnt/mail/INBOX cat /mnt/mail/INBOX/12 Mount helper ------------ In order to avoid to write your password in clear text on the command line, a helper is in build/tools/mount.mfs. First as root user copy build/tools/mount.mfs in /sbin then use mount as below: insmod ./build/fs/mfs.ko mount -o port=IMAPPORT,login=IMAPLOGIN -tmfs IPADDR /mnt/mail It will ask you to enter imap password at mount time without printing it. TODO (not in order) ------------------- - Export mail in an maildir/mbox/understandable format - Implement mail body cache, so not to fetch mail body too often (use address_space_operation to use buffer cache) - Support mail deletion when doing a "rm" on it. - Support concurrent file access (protect imap structure) - and so on ...