NOEXPORT char *smtp_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
    (void)opt; /* squash the unused parameter warning */
    switch(phase) {
    case PROTOCOL_MIDDLE:
        smtp_client_negotiate(c);
        break;
    case PROTOCOL_LATE:
        if(opt->protocol_username && opt->protocol_password) {
            char *line;

            ssl_putline(c, "HELO localhost");
            line=ssl_getline(c); /* ignore the reply */
            str_free(line);
            if(!strcasecmp(c->opt->protocol_authentication, "LOGIN"))
                smtp_client_login(c,
                    opt->protocol_username, opt->protocol_password);
            else /* use PLAIN by default */
                smtp_client_plain(c,
                    opt->protocol_username, opt->protocol_password);
        }
        break;
    default:
        break;
    }
    return NULL;
}
NOEXPORT char *smtp_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
    (void)opt;  
    switch(phase) {
    case PROTOCOL_MIDDLE:
        smtp_client_negotiate(c);
        break;
    case PROTOCOL_LATE:
        if(opt->protocol_username && opt->protocol_password) {
            char *line;

            ssl_putline(c, "HELO localhost");
            line=ssl_getline(c);  
            str_free(line);
            if(!strcasecmp(c->opt->protocol_authentication, "LOGIN"))
                smtp_client_login(c,
                    opt->protocol_username, opt->protocol_password);
            else  
                smtp_client_plain(c,
                    opt->protocol_username, opt->protocol_password);
        }
        break;
    default:
        break;
    }
    return NULL;
}