UW Imap patches

What are those?

I have written those patches after having deployed UW Imap at VA Software (formerly VA Linux Systems).
My main goal was to convert most mailboxes to an efficient format (unix mailbox format isn't efficient), while still supporting users who read their mail by other means (like mounting /var/spool/mail via NFS, or wanting IMAP folders in mbox format in their NFS mounted homedir because they also access those folders with mutt)

While looking for a way to do this, I stumbled over Jauder Ho's work which told uwimap not to store mailboxes in users' homedirs, because when you select the efficient MBX format, you can't do so over NFS (and the homedirs he admined, just like mine, were mounted over NFS)

After looking at his patches, I kept his getrusage() patch, which logs lots of info about each imap session when it ends, and wrote my own patches to achieve the following:

If you wonder about the anti-FS wandering patch.

4 select /etc/passwd
* 1 EXISTS
* * 1 RECENT
* * OK [UIDVALIDITY 998431567] UID validity status
* * OK [UIDNEXT 2] Predicted next UID
* * NO [UIDNOTSTICKY] Non-permanent unique identifiers: /etc/passwd
* * FLAGS (\Answered \Flagged \Deleted \Draft \Seen)
* * OK [PERMANENTFLAGS ()] Permanent flags
* * OK [UNSEEN 1] first unseen message in /etc/passwd
* 4 OK [READ-ONLY] SELECT completed
* 5 fetch 1 body[]
* * 1 FETCH (BODY[] {2507}
* Date: Tue, 21 Aug 2001 15:06:07 -0700
* From: root@servername
* Subject: /etc/passwd
* MIME-Version: 1.0
* Content-Type: TEXT/PLAIN; charset=US-ASCII

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
(...)
5 list "" "/home/%"
* LIST (\NoSelect) "/" /home/
* LIST (\NoSelect) "/" /home/user1
* LIST (\NoSelect) "/" /home/user2
(...)
I consider this bad :-)
With my patch:
2 select /etc/passwd
2 NO SELECT failed: Can't open mailbox /etc/passwd: no such mailbox
3 select /home/merlin/.profile
3 NO SELECT failed: Can't open mailbox /home/merlin/.profile: no such mailbox
4 list "../" "%"
4 NO LIST failed: Security: mailboxfile() blocked access to ../ by merlin
10 delete "/home/merlin/Sent"
10 NO DELETE failed: Can't delete mailbox /home/merlin/Sent: no such mailbox
While syslog shows:
Oct 29 18:58:16 kenny imapd-test[22870]: Security: mailboxfile() blocked access to /etc/passwd by merlin
Oct 29 18:59:00 kenny imapd-test[22870]: Security: mailboxfile() blocked access to /home/merlin/.profile by merlin
Oct 29 19:03:28 kenny imapd-test[22870]: Security: mailboxfile() blocked access to ../ by merlin
Oct 29 19:05:48 kenny imapd-test[22870]: Security: mailboxfile() blocked access to /home/merlin/Sent by merlin

All the patch files can also be found here

Feedback is appreciated


[ms free site] Email
Link to Home Page

2001/10/31 (18:35): Version 1.0. Initial version
2001/11/01 (16:00): Version 1.1. Updated blcokfswandering patch
2001/11/05 (16:14): Version 1.2. Added two heads up about fswandering patch