Linux kernel IMAP filesystem
C Makefile
Switch branches/tags
Nothing to show
Latest commit 3883f5b Apr 6, 2015 @repk repk [mfs_imap_parse] Fix imap message parsing.
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.
Permalink
Failed to load latest commit information.
tools
.gitignore
Makefile
README
mfs_client.c
mfs_client.h
mfs_cmdqueue.c Live update of mail list for INBOX and real smtp server integration: Feb 23, 2015
mfs_cmdqueue.h
mfs_dir.c Improve mailbox support : Mar 24, 2015
mfs_dir.h Improve mailbox support : Mar 24, 2015
mfs_file.c
mfs_file.h
mfs_imap.c
mfs_imap.h Fix multiple command sending Apr 1, 2015
mfs_imap_parse.c
mfs_imap_parse.h
mfs_imap_send.c Fix multiple command sending Apr 1, 2015
mfs_imap_send.h
mfs_inode.c Fix mailbox directory access rights for normal users Apr 7, 2015
mfs_inode.h
mfs_mod.c
mfs_super.c
mfs_super.h Modularize code separating in different files Feb 23, 2015

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 ...