Subject: IMAP x NFS in Unix

From: "M.Bordin, ICTP/IAEA, Unix Sys & Net Adm" <[email-masked]>
Date: Thu, 10 Nov 1994 09:59:16 +0100 (MET)

Hi,

First of all, I would like to thank people who are/were involved in
the PINE development. It's great!

We have about 30 Unix workstations, we are using BSD-Sendmail on
our "mailhost" machine (the machine which were our incoming mail 
arrives) and mounting "/var/spool/mail" on the clients via NFS. We
experimented several problem in the past, probably associated
to NFS and Elm (inbox corrupted, an so on).

I had no problem with NFS and PINE, but it was not a *real* life
experiment (only a few users were using it).

Now, we are re-installing our mail services, and I was wondering 
if we couldn't use IMAP access from UNIX "clients", other than
from PCs.

(sorry for the long description of the problem)

My questions are:

1) To get IMAP access on Unix, I should configure in my ".pinerc"
   something like:

	inbox-path={mailhost}/var/spool/mail/my_user_name

   Is that all and right?         (it seems to work)

2) With the above configuration, PINE asks for "username" and "password"
   to open the INBOX. That check couldn't be avoided for the Unix users?
   Actually they have already logged on...

3) What are the (dis)advantages of using IMAP instead of NFS? Do 
   you recommend it?

Many thanks in advance,

    Marcos

============================================
Marcos F. Bordin, Unix Systems & Network Adm
ICTP/Scientific Computing Section
[email-masked]

---

From: David L Miller <[email-masked]>
Date: Thu, 10 Nov 1994 13:08:48 -0800

On Thu, 10 Nov 1994, M.Bordin, ICTP/IAEA, Unix Sys & Net Adm wrote:

> Date: Thu, 10 NOV 1994 08:59:16 GMT 
> From: M.Bordin, ICTP/IAEA, Unix Sys & Net Adm <[email-masked]>
> Newgroups: comp.mail.pine
> Subject: IMAP x NFS in Unix 
> 

Accessing remote folders via NFS, particularly the INBOX is _discouraged_. 
There are unavoidable locking problems with NFS that are not present with
IMAP. 

> if we couldn't use IMAP access from UNIX "clients", other than

Definitely.

>    Is that all and right?         (it seems to work)

It would work, but 

	inbox-path={mailhost}INBOX

is the recommended form.

>    Actually they have already logged on...

If you enable RSH access without a password, Pine will use it for
pre-authenticated access to the server.  Otherwise it falls back to using
port 143, wich requires a login procedure. 

> 3) What are the (dis)advantages of using IMAP instead of NFS? Do 

There may be some slight performance gains from NFS, but IMAP performs better
under some circumstances too.  As mentioned above, folder locking actually
works over IMAP, so you don't have to worry about corrupted folders due to
failed locks.  If you have a dedicated server that does not allow interactive
logins for general users, you can also take advantage of alternate folder
formats (e.g. Tenex) with improved performance and better shared access. 

--DLM

|\ |  |\/|  David L. Miller    [email-masked]  (206) 685-6240
|/ |_ |  |  Software Engineer, Pine Development Team   (206) 685-4045 (FAX)
University of Washington, Networks & Distributed Computing, JE-20
4545 15th Ave NE, Seattle WA 98105, USA

---

From: Mike Brudenell <[email-masked]>
Date: Fri, 11 Nov 1994 12:28:33 +0000 (GMT)

This comment (which I already knew about) has just raised an interesting 
flag in my mind...

Here we are currently using the mbox driver.  This means that newly 
arrived mail (which arrives in the file /var/mail/username in IRIX 5) is 
moved by Pine or imapd into a file called "mbox" in the user's home 
directory.

Currently all users' home directories and the /var/mail store itself are 
accessed over NFS.  We know of the inherent problems (and indeed have 
fallen foul of them once or twice).  We are looking to set up a separate 
mail server which has the /var/mail store on a local disk and which runs 
the imapd's to access it.  Then we would reconfigure Pine to use IMAP for 
mail access.

However what about the mbox driver?  This will still be making use of the 
"mbox" file in the users' home areas.  These are held on our Auspex file 
server and would need to be NFS mounted on the mail server machine.

Is there still a file locking problem here?

We really do need to use the mbox driver in order to force people to be 
selective about the mail they keep (the /var/mail disk doesn't have disk 
quotas enabled to ease mail delivery problems, but users' areas do have 
them turned on).

If there is a problem can someone suggest a way forward?

Mike Brudenell
------------------------------------------------------------------------------
The Computing Service, University of York, Heslington, York, YO1 5DD, UK
Phone: +44-1904-433811  FAX: +44-1904-432767

---

From: [email-masked] (Jason Haar)
Date: 11 Nov 1994 08:39:53 GMT

In article <Pine.SUN.3.91.941110093719.9782B-100000@ictpsp4> [email-masked] wrote:

: 2) With the above configuration, PINE asks for "username" and "password"
:    to open the INBOX. That check couldn't be avoided for the Unix users?
:    Actually they have already logged on...

On the server, put a link between where you have the imapd binary and 
/usr/etc/rimapd

e.g

ln -s /usr/local/etc/imapd /usr/etc/rimapd

That will allow the pine client to use rsh instead of an imap connection 
(i.e. no password required).

 : 3) What are the (dis)advantages of using IMAP instead of NFS? 

Advantages of IMAP: 	- doesn't need NFS ;-)
			- No more worries about file locking - which is 
			broken under quite a few commercial implementations 
			of NFS
			- faster than NFS

Disadvantages:		- slower than NFS

UDP-based NFS is inherently faster than TCP-based IMAP, but there's a 
gotcha. If you receive heaps of large MIME messages (Framemaker 
attachments/etc), then IMAP should be faster on indexing than NFS as the 
indexing is done locally with IMAP, but remotely (i.e. other end of NFS 
link) with NFS. I think that 99% of the time NFS should still be faster 
though...

--

Cheers,

Jason
+------------------------------+------------------------------------------+
| Jason Haar, European SysAdmin   Phone: + 44 (256) 790111                |
| Motorola Cellular Subscriber      Fax: + 44 (256) 790519                |
| Basingstoke, Hampshire                                                  |
| RG21 1PL,  ENGLAND           Internet: [email-masked] |
+------------------------------+------------------------------------------+

---

From: Mark Crispin <[email-masked]>
Date: Sun, 13 Nov 1994 16:25:41 -0800

> link) with NFS. I think that 99% of the time NFS should still be faster 

I'd like to offer some corrections to this.  Like most complex questions, 
there is no single ``best'' solution; to make an intelligent decision you 
have to have an understanding of the fundamental nature of the two 
mechanisms.

Byte-per-byte, NFS will be faster than IMAP because of the underlying
transport (UDP-based file access vs. transaction-based TCP).  What can tip
the balance in favor of IMAP is that IMAP avoids having to send
substantial amounts of data.  Specifically: 

1) IMAP never needs to send message data *back* to the folder when doing
   an EXPUNGE or folder checkpoint.

2) IMAP never needs to retrieve message data from messages that the user
   does not look at.  With NFS, you are effectively downloading the entire
   mailbox to the client.  With IMAP, it is access on demand.

3) IMAP permits server-based execution of certain operations (RFC822 parse,
   MIME parse, and searching) that can be difficult on some limited-resource
   clients and/or require downloading of data that may turn out to be
   uninteresting.

What are the implications of this?

1) IMAP is almost always better over low-speed links, such as SLIP, because
   of its fetch-on-demand nature.  I'll go out on a limb here, and say that
   based on my experience NFS is not viable unless you have a high-speed
   interconnect.

2) NFS is probably better for users whose model of mail is to read all 
   of it and delete it from the server; *provided* that the client has
   adequate memory to hold the data and avoid repeated NFS retrievals of
   the same data.

3) IMAP is better for users who have very large folders, read their new
   mail and keep their old mail in the folder for archival purposes.  You
   would not want to use a 5,000 message folder with NFS.

Of course, there are also the issues of synchronization of multiple
simultaneous access and locking which NFS, due to its stateless nature,
handles poorly.  These require state, and NFS is stateless.  This is why
the tenex format isn't supported over NFS.  SVR4 makes an attempt to
implement state for locking, but usually ends up falling flat on its face.