cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: CURL SMTP - Bypass Authentication

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Mon, 24 Mar 2014 21:31:32 +0000

On Mon, 24 Mar 2014, Tom Sparrow wrote:

> In case of relay server without authentication. I am getting
> error at following location

Thank you for your email... I tend to look after the 3 email protocols in
curl and unfortunately I may not have taken your use case into account with
some of the SMTP modifications I have done over the last couple of years -
assuming we supported it prior to v7.23.0 ;-)

> lib/smtp.c - function smtp_perform_authentication()
> infof(conn->data, "No known authentication mechanisms supported!\n");
> result = CURLE_LOGIN_DENIED;

Mmmm...

It seems that we would need to perform a SMTP_STOP if no mechanisms are
available.

> Now it works fine. I have doubt regarding side effect of this change.

I suspect that the side effects of modifying the code like this would mean
that it breaks the case when a user requests a certain authentication
mechanism but it isn't available at the server, ie smtp_calc_sasl_details()
returns CURLE_OK but mech is NULL - it would then continue when it shouldn't
:(

I am assuming you are compiling the latest code base?

If so can you try the following modification in
smtp_perform_authentication() please?

Replace the following line (line 486):

  if(!conn->bits.user_passwd) {

With:

  if(!conn->bits.user_passwd || !smtpc->authmechs) {

You'll also need to insert the following at line 483 as smtpc is not
declared in this function:

  struct smtp_conn *smtpc = &conn->proto.smtpc;

Kind Regards

Steve
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-03-24