Subject: smtp_mail() with a username, how?

From: Karsten Ballueder <[email-masked]>
Date: Tue, 30 May 2000 11:02:37 +0100 (GMT)

Currently my applicaion uses smtp_open()/smtp_mail() just fine to send messages.
However, a new mailserver I'm trying to use requires a username in order to
access it (found out using netscape messenger which detected this problem, while
smtp_mail() just said that "one or more recipients failed").

How can I set a username when accessing an smtp server?

Thanks!
--
 Karsten Ballüder  http://Ballueder.home.dhs.org/  mailto:[email-masked]
 Physics Department, Heriot-Watt University, Edinburgh, EH14 4AS, Scotland
                     Tel. +44-(0)-131-4513068  Fax. +44-(0)-131-4513136
            "In a world without fences, who needs Gates?"  

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Yiorgos Adamopoulos <[email-masked]>
Date: Tue, 30 May 2000 15:08:40 +0300

> How can I set a username when accessing an smtp server?

This means that the particular mail server likes to talk SMTP-AUTH.  I do
not think that c-client supports this yet.
-- 
# more coffee

---

From: John-Paul Robinson <[email-masked]>
Date: Tue, 30 May 2000 11:02:04 -0500

I think the solution is to use smtp_open_full().  smtp_open() is a
#define which sets the service type to "smtp".  With smtp_open_full()
you can set the service type to "service=esmtp".  You will also need to
use a network mailbox form of  hostname for the hostlist in the call to
smtp_open_full(). mail_valid_net_parse() is called on these host names
so you can just use the your.host.name/user=myname format for the
hostname. (Hint: You can also use "/debug" in the hostname to turn on
telemetry debugging or OP_DEBUG in the options to smtp_open_full().)

You will need to have linked a mailauthenticator via auth_link() before
this open call.The authenticator will need to handle the AUTH= spec
given in the SMTP negotiation.I don't know enough about SMTP authing,
but the basic authenticators in linkage.c include MD5 and log. I'm not
sure if they will do.  I guess you'll need to try it.If the
authentication fails you'll get an appropriate error via mm_log().The
code in smtp_auth() "looks" like it's similar to general c-client
authentication.

I haven't tested this yet, its just my take from reading
smpt_open_full() and related functions.  Let me know how it works for
you.

Thanks.

---

From: Mark Crispin <[email-masked]>
Date: Tue, 30 May 2000 12:49:42 -0700 (PDT)

> How can I set a username when accessing an smtp server?

Did you try using /user=... after the system name in the smtp_open() call?

---

From: Mark Crispin <[email-masked]>
Date: Tue, 30 May 2000 12:51:22 -0700 (PDT)

On Tue, 30 May 2000 11:02:04 -0500, John-Paul Robinson wrote:
> you can set the service type to "service=esmtp".

This is incorrect.  SMTP is the correct service type.  ESMTP is selected
automatically.

> hostname.

This is the important thing.

---

From: Mark Crispin <[email-masked]>
Date: Tue, 30 May 2000 14:11:05 -0700 (PDT)

On Tue, 30 May 2000 16:08:49 -0500, John-Paul Robinson wrote:
> Is there a general preference for or against calling "_full" functions?

Not really.  The shorter forms are shims for compatibility with the past, but
they will last forever so it's alright to use them.

---

From: John-Paul Robinson <[email-masked]>
Date: Tue, 30 May 2000 16:08:49 -0500

> This is incorrect.  SMTP is the correct service type.  ESMTP is selected

Ah, I misread mail_valid_net_parse(). I skipped right over the check for
"smtp" making me think it would return a parse error without it.

Thanks.

---

From: Karsten Ballueder <[email-masked]>
Date: Wed, 31 May 2000 10:39:14 +0100 (GMT)

> Did you try using /user=... after the system name in the smtp_open() call?

After I read John-Paul's reply I got that far. Now the smtp code tells me that
there are no SMTP authenticators available. So I guess I have to tell it which
auth_xxx function to use. He mentioned auth_link().

Could you tell me how to do that, or where to find the info?

---

From: Mark Crispin <[email-masked]>
Date: Wed, 31 May 2000 09:51:46 -0700 (PDT)

> auth_xxx function to use. He mentioned auth_link().

If you include linkage.c at the start of your application (which is
required of all c-client applications) then you should get all supported
drivers and authenticators lunk automatically.

If you get a "no SMTP authenticators available" then either you aren't
including linkage.c, or the SMTP server doesn't support any of c-client's
supported authenticators (meaning that you have to write code to add
support for one of the ones that it does support).

-- Mark --

* RCW 19.190 notice: This email address is located in Washington State.	*
* Unsolicited commercial email may be billed $500 per message.		*
Science does not emerge from voting, party politics, or public debate.