Subject: Where do I put referrals into UW imapd?

From: Rich Graves <[email-masked]>
Date: Thu, 4 Nov 1999 00:53:47 -0500 (EST)

(First of all, is this worth my time? If I got my server to redirect
particular users and the #shared/ namespace appropriately, what are the
minimum versions of Netscape and Outlook that would take notice? .pinerc
are trivial to fix by comparison.)

I've seen this asked a couple times in the archives, but no answers specific
enough to get me going. What function(s) do I need to hack at to implement
referrals for the #shared/ namespace and nonexistent local users to another
server? I've spent some time in env_unix, but the mailbox functions all seem
to want to return a pathname or stream and the authentication functions all
seem to want to return a paswordish struct for success or NIL for failure.
The only references I found to referral/i in the source (4.6 release) are
the CAPABILITY banner and the basic _client_ functionality in imap_manage().

A simple sample of bouncing #shared/ to another server would get me started.
-- 
Rich Graves <[email-masked]>
UNet Systems Administrator

-- 
------------------------------------------------------------------
 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: Wed, 3 Nov 1999 23:25:38 -0800 (PST)

Basically, to implement referrals, you need to have some database to look up
your referrals, and then percolate the referral via mm_log() to the resulting
OK or NO response.

For example, with login referrals, you probably want to do the look up in the
database in server_login().  If there's a referral, then do an mm_log() with
errflg NIL (for successful logins with referral) or ERROR (for failed logins
with referral) in addition to the other stuff that server_login() does.  The
text of the mm_log() string should comply with the login referral RFC.

With mailbox referrals, you do something similar, only in mailboxfile().

I think what you were missing was the use of mm_log() to percolate the
referrals up to imapd.

Please feel free to ask me more detailed questions once you get further along.
A lot depends upon your implementation, such as what sort of database you have
and what sort of referrals you want to do.  You have to decide this for
yourself.

---

From: Rich Graves <[email-masked]>
Date: Thu, 4 Nov 1999 10:19:44 -0500 (EST)

> your referrals, and then percolate the referral via mm_log() to the resulting

Of course. I had it in my head that referrals are a separate response code,
but they're actually more like attached comments.

> database in server_login().  If there's a referral, then do an mm_log() with

OK, I think I can do that.

> and what sort of referrals you want to do.  You have to decide this for

On all servers but one, #shared/, #ftp/, and #public/ get referred to a
specific server (a CNAME alias, so I'll probably just put the hostname into
the code). This is isn't very site-specific so if someone has a sample
implementation, please pass it along offline to get me started.

If a user doesn't exist locally (we'll be using nsswitch_ldap), do an LDAP
lookup for uid=username and return imap://${maildrop}/mailbox;AUTH=* (yes I
need to read the RFCs a few more times) where the LDAP maildrop attribute is
a fully qualified email address.  This is very site-specific but should be
trivial once I understand the basics of passing along referrals.

Remaining question: Is there much point to this? What are the minimum
versions of Netscape and Outlook that understand referrals?
-- 
Rich Graves <[email-masked]>
UNet Systems Administrator