somnisoft / smtp-client

SMTP Client Library in C
Creative Commons Zero v1.0 Universal
109 stars 31 forks source link

authentication problem #6

Open jwwalker opened 4 years ago

jwwalker commented 4 years ago

smtp_auth was failing for me. When I traced through the smtp_parse_cmd_line calls in a debugger, I saw several 250 lines like "250-CHUNKING", and finally "250 HELP". Since that does not have a hyphen, cmd->more is set to 0, so we never look at the next line. When I forced cmd->more = 1, I found that the next line was "235 Authentication succeeded". So I tried a hack at the end of smtp_parse_cmd_line:

if ( (cmd->code == SMTP_DONE) && (0 == strcmp( cmd->text, "HELP" )) )
{
    cmd->more = 1;
}

Then everything seemed to work. I don't know if this makes any sense in terms of what the protocol is supposed to be doing.