Subject: Accessing mail remotely: How do I set up rimapd? (on Linux)

From: [email-masked] (Jeff Davey)
Date: 27 Jun 1996 00:30:26 GMT

I'm trying to set up a 'mail gateway' scheme, and so far all outgoing mail 
works fine.  The only way for me to get incoming mail is to use a popclient 
for each user, which moves all mail downstream to the client machine.

However, I would like to manage these mailboxes remotely on the gateway 
machine.  I set up pine on the client to access the remote machine via IMAP, 
but the error I get says "Can't connect to ideatest1.idea.com,143: Connection 
refused".  I read in this newsgroup that is because the gateway does not have 
the IMAP daemon running.

How do I do this???  The imapd manpage says it must be linked to /etc/rimapd, 
which doesn't exist!

---

From: Mike Brudenell <[email-masked]>
Date: Fri, 28 Jun 1996 12:40:08 +0100 (BST)

You're almost there, but heading along the road in the wrong direction...

First of all forget about /etc/rimapd ... I'll come to that later.

So... to access you e-mail via IMAP you must first set up an IMAP server
by installing the imapd server software.  The general steps to do this
are:

1.  Put the imapd executable somewhere convenient (eg, /etc, /usr/etc,
    /usr/local/etc, or wherever) and make sure it has execute access to
    everyone.

2.  Configure your inetd so that connection requests arriving on port 143
    fire up the imapd executable.  (ie, edit your inetd.conf file and get
    inetd to reread the config file -- typically by sending it a HUP
    signal if I recall correctly).

3.  As a convenience add "imap" as a name mapping to port 143 in your
    /etc/services file.  (Probably should be done before HUP-ing inetd ...
    I forget.)

Now test your imapd is working properly by using telnet to connect to port
143 of that machine.  For example:

	telnet imap.myhost.mydomain 143

You _should_ get a welcome banner appearing from the IMAP server, to which
you should respond by typing "A01 logout" to disconnect again.  If it
fails then you probably didn't get the inetd.conf line right, or didn't
manage to get inetd to reread the config file.

Now you should be able to set Pine to use IMAP to access your mail folders
(which involves changing their entries in the Setup Configuration screen
from things like "mailinglists" to "{imap.myhost.mydomain}mailinglists".)

HOWEVER whenever you start Pine up it will ask you to enter your username
and password so as to be able to authenticate you to the IMAP server.

Now we get back to the /etc/rimapd thing...

It is possible to set up a "pre-authenticated" version of the IMAP server
so that Pine can use the trusted "rsh" command to start the server, which
then magically deduces your username and trusts you are that user (by
virtue of the rsh mechanism).

This setting up is straightforward at the IMAP server level, but trickier
at the UNIX level (you may need help from others familiar with the
process)...

1.  (Easy bit) Set up a link so that /etc/rimapd connects to the real
    imapd executable (wherever you put it).  For example:

	ln -si /etc/imapd /etc/rimapd

2.  (Trickier bit) Now set up the UNIX rsh mechanism so that you can rsh
    to your server machine.  Typically this is done by you setting up a
    ".rhosts" file for your username *on the IMAP server machine* that
    names the machine you normally use to work on as a "trusted host".
    BE CAREFUL WHEN DOING THIS!  IF YOU GET IT WRONG IT CAN LET OTHERS GET
    ACCESS TO YOUR USERNAME, AND HENCE COMPUTER AND SITE!  SEEK EXPERT
    ADVICE IF YOU NEED IT!

    Alternatively this step can be obviated if the system manager sets up
    a system-wide file on the IMAP server listing trusted hosts (usually
    this file is called something like "hosts.equiv" -- I forget the
    directory).

3.  Test that you have set up the rsh mechanism properly by logging in to
    your normal work machine and giving the command:

	rsh imap.myhost.mydomain /etc/rimapd

    If all goes well you'll see a welcome banner like before, but saying
    "PREAUTH" near the beginning of the line.  Again, disconnect by typing
    "A01 logout" and pressing Return.

    Otherwise look at the error message and try and deduce the problem.
    This will either be with rsh (are you allowed to use it?), the trusted
    host list (you probably set up the .rhosts file wrongly), or the link
    from /etc/rimapd to the real imapd executable.

If you set this up Pine will no longer ask you to enter a username and
password when you start it up (assuming the IMAP server started up within
a given timeout period!).

Sites which decide NOT to set up the /etc/rimapd link should instead
include port 143 explicitly when setting up the folders.  For example:

	{imap.myhost.mydomain:143}inbox

This prevents Pine from trying the rsh mechanism first and then falling
back to a direct connection to port 143.  Instead it just goes straight to
port 143, which can make start-up a bit quicker.

Cheers,

Mike Brudenell                                         <[email-masked]>
------------------------------------------------------------------------
The Computing Service, University of York, Heslington, York, YO1 5DD, UK
Tel: +44-1904-433811  FAX: +44-1904-433740  http://www.york.ac.uk/~pmb1/