Subject: MH format folders

From: "Peter Derr" <[email-masked]>
Date: Tue, 07 Jan 97 16:04:53 -0500

Hi,

I'm trying to figure out how to get imapd to use existing mh mail folders.
I've searched the documentation, the source code, and the mailing list archive
to no avail.  There seems to be code to handle mh folders but I can't get it
to work.  Forgive me if I'm missing something obvious.

I'm running imapd on Digital UNIX (formerly OSF/1) and I've been using
PCPine 3.95 and Netscape Communicator 4.0 as test clients on a Win95 box.
As long as I use the standard UNIX mail flat-file folder format (I believe
this is your "bezerk" driver) everything works fine.

Isn't there some directive in the ~/.imaprc file to specify mh folders?  The
closest thing I can find is "set empty-folder-format mh"

I can get Pine to look in the right directory where my mh folders are but
when I try to access them I get messages like "SELECT failed:"... <folder
name> "is not in valid mailbox format."

If I could get imapd to use the mh folders, and read new mail from an
mh-format inbox I'd be happy.  The next thing I'd like to do is use the mh
folders for refiling messages, but read new messages from the standard
/usr/spool/mail/<user> mail spool file -- is that possible?

BTW, I've made some small changes to allow imapd to work with C2 security on
Digital UNIX, and also to use fcntl() instead of flock() so locking works on
NFS-mounted file systems.  I'd be glad to forward the diffs if you're
interested.

Thanks,
Peter

-- 
+----------------------------------------------------------+
|Peter Derr                          Unix Software Group   |
|Mailstop: ZKO3-2/W17                (dtn) 381-2977        |
|Digital Equipment Corp.             (603) 881-2977        |
|110 Spitbrook Road             fax: (603)881-2257         |
|Nashua, NH 03062-2698  USA   email: [email-masked]     |
+----------------------------------------------------------+

---

From: Mark Crispin <[email-masked]>
Date: Tue, 7 Jan 1997 19:17:15 -0800 (PST)

Have you tried prefixing the MH folder name with #mh/ ?

In other words, #mh/foo is your "foo" MH folder.

To get your MH INBOX with automatic moving of mail from /var/spool/mail, use
#mhinbox

Don't use .imaprc and especially do not use "set empty-folder-format mh" (it
does *NOT* do what you think).

Use the SOS port instead of OSF for C2 security.

Rumors to the contrary notwithstanding, fcntl() locking does NOT work over
NFS, and attempts to use it with imapd are an excellent way to cause a cluster
wide hang.

---

From: "Peter Derr" <[email-masked]>
Date: Wed, 08 Jan 97 15:35:56 -0500

> To get your MH INBOX with automatic moving of mail from /var/spool/mail, use

OK, after I sent my question I finally figured this out by reading the
source code.  This really ought to be documented somewhere. (If it is, I
couldn't find it.)

It seems strange to me that the mail client should have to know or care
what format the mail messages are stored in on the server.  Don't you
think this ought to be configurable in the .imaprc?

> does *NOT* do what you think).

I don't understand.  Why wouldn't you want to do that, especially if
all your folders are in mh format?

Thanks,
Peter

---

From: Mark Crispin <[email-masked]>
Date: Mon, 13 Jan 1997 22:57:55 -0800 (PST)

> source code.  This really ought to be documented somewhere. (If it is, I

The Pine Technical Notes documents MH usage.  The IMAP toolkit documentation
tends to lag behind the source code, unfortunately; the distribution is for
developers primarily and less for end-users.

> what format the mail messages are stored in on the server.

I agree.  However, the #mh isn't for the format; rather, it's because MH
introduces a different namespace than the filesystem.  "foo" refers to a file
called foo on the user's home directory; #mh/foo refers to an MH directory
called foo, located under the Path defined in the ~/.mh_profile file.

In other words, it's like news; #news.comp.mail.misc is different from
comp.mail.misc, since the latter could be a file in the user's home directory.

> Don't you

Do not use .imaprc or /etc/imapd.conf -- these files are evil black magic and
reliance upon it is almost certain to bite you sooner or later.  This feature
is for UW internal use only.

> > Don't use .imaprc and especially do not use "set empty-folder-format mh"
> > (it does *NOT* do what you think).

"set empty-folder-format mh" causes empty files to be considered to be MH
format.  But an MH folder can not be a file, not even an empty file; nor can a
file name be an MH name.  So, the sole result of this command is to cause the
software to fail to work.

The only valid arguments to empty-folder-format are bezerk, mmdf, tenex, and
mtx.  Under certain highly limited "black box" circumstances (specifically,
where tmail is the delivery agent) mbx is also valid.

This is an example of what I mean by black magic; there are other pitfalls.