Subject: IMAP running on high port as regular user

From: "Matt Alexander" <[email-masked]>
Date: Tue, 9 Sep 2003 16:51:06 -0700 (PDT)

I built uw-imapd to run as me on port 1143.  Then I had the admin add this
line to /etc/inetd.conf:

imap-matt stream tcp nowait  m /home/m/local/sbin/imapd imapd

And /etc/services:

imap-matt       1143/tcp                        # local imap for Matt

When I connect to localhost:1143, I get this:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* PREAUTH [CAPABILITY IMAP4REV1 IDLE NAMESPACE MAILBOX-REFERRALS BINARY
UNSELECT SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND]
Pre-authenticated user m localhost IMAP4rev1 2003.338 at Tue, 9 Sep 2003
16:48:23 -0700 (PDT)

When I issue commands like Login, I get "BAD Missing command".  I'm using
SquirrelMail as my IMAP client to try and connect, but it fails with:

Bad request: Command unrecognized: LOGIN

Read data:

Any ideas on how to get this to work?
Thanks,
~M
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Tue, 9 Sep 2003 16:58:10 -0700 (Pacific Daylight Time)

> Pre-authenticated user m localhost IMAP4rev1 2003.338 at Tue, 9 Sep 2003

This means that the IMAP server is logged in as "m".  No login is needed
or accepted.

Running the IMAP server as non-root is intended to be done solely when the
communications link deals with authentication in some other way (e.g. rsh
or ssh external authentication).

> Bad request: Command unrecognized: LOGIN

You can't log in when you are already logged in.

> Any ideas on how to get this to work?

Run imapd as root if you don't want it automatically logged in.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

---

From: "Matt Alexander" <[email-masked]>
Date: Wed, 10 Sep 2003 09:29:38 -0700 (PDT)

> Run imapd as root if you don't want it automatically logged in.

Is it possible to run it as user "m" and also do the normal
authentication?  User "m" will be the only user authenticating anyway, but
I don't want other users to be able to access the mail for "m" if it's
pre-authenticated.
Thanks,
~M

---

From: Mark Crispin <[email-masked]>
Date: Wed, 10 Sep 2003 11:16:00 -0700 (PDT)

On Wed, 10 Sep 2003, Matt Alexander wrote:
> authentication?

No.  Authentication is a privileged operation on most systems (requires
access to the shadow password file); and logging in is privileged on all
systems.

> User "m" will be the only user authenticating anyway, but

The best that you can do is hack the code to recognize some password that
you wired in, and remove all the preauthentication support.

-- Mark --