Subject: [Imap-uw] mm_login and user/password

From: "Gard, Torbjorn" <[email-masked]>
Date: Wed, 25 May 2005 09:40:43 +0200

Hello
 
I have a question regarding how to supply user and password information
to the cclient library. The present use of mm_login should be quite
sufficient for display oriented client software.
 
We are using cclient in a server program which is able to send and
receive mail. Both pop3 and imap protocols are used. Sending mail
includes rfc2554 (authentication). So there are three cases where
user/password is needed.
 
Users and passwords are supplied in the mm_login callback. This seems to
be the only way to do it. This has worked in the past. However we are
migrating to a new threading model where this will no longer work as we
can not use a global variable.
 
As I see it we have three options.
 
- The first is to set a thread specific mm_login callback with
mail_parameters(). 
 
- The other is to somehow set a pointer to the information in the NETMBX
structure which is available in mm_login.
 
- The third is to supply the MAILSTREAM to mm_login and use an updated
"void *sparep" which is already present in MAILSTREAM to point out the
user/password information..
 
All of these approaches needs cclient modifications which I am reluctant
to do.
 
Have I missed something? 
 
regards

Torbjörn Gard
R&D
StreamServe AB, 
Vasagatan 45
SE 411 37 Gothenburg, Sweden
+46 31 778 26 00 Phone
+46 31 778 26 10 Fax
www.streamserve.com <http://www.streamserve.com/> 

_______________________________________________
Imap-uw mailing list
[email-masked]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

---

From: Mark Crispin <[email-masked]>
Date: Wed, 25 May 2005 17:42:12 -0700 (Pacific Daylight Time)

It isn't possible to supply a MAILSTREAM with mm_login(), since either 
there is no MAILSTREAM (sending with SMTP or NNTP) or the MAILSTREAM is in 
the process of being created (IMAP, POP3, or reading with NNTP).  Either 
way, there is no usable MAILSTREAM that can be used.

The right way to solve your problem is to have a global database in which 
you look up some set of host, orighost, user, authuser, and service from 
the NETMBX.  That probably means that you need to specify /user=??? in the 
specification that you supply to mail_open()/smtp_open()/nntp_open() in 
order to disambiguate which request the mm_login() is doing.

The need to use /user=??? is probably the missing piece of the puzzle; 
instead of letting mm_login() get the user name, it has to be supplied 
when you do the open call and mm_login() just copies it.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.
_______________________________________________
Imap-uw mailing list
[email-masked]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw