int negotiate(CLI *c) { int retval=-1; /* 0 = OK, -1 = ERROR */ if(!c->opt->protocol) return 0; /* No protocol negotiations */ s_log(LOG_NOTICE, "Negotiations for %s (%s side) started", c->opt->protocol, options.option.client ? "client" : "server"); if(!strcmp(c->opt->protocol, "cifs")) retval = options.option.client ? cifs_client(c) : cifs_server(c); else if(!strcmp(c->opt->protocol, "smtp")) retval = options.option.client ? smtp_client(c) : smtp_server(c); else if(!strcmp(c->opt->protocol, "pop3")) retval = options.option.client ? pop3_client(c) : pop3_server(c); else if(!strcmp(c->opt->protocol, "nntp")) retval = options.option.client ? nntp_client(c) : nntp_server(c); else { s_log(LOG_ERR, "Protocol %s not supported in %s mode", c->opt->protocol, options.option.client ? "client" : "server"); return -1; } if(retval) s_log(LOG_NOTICE, "Protocol negotiation failed"); else s_log(LOG_NOTICE, "Protocol negotiation succeded"); return retval; }
// DEBUG void Conf::dump() const { debug(" --- Account ---"); debug("fname : " + fname() ); debug("in_server : " + in_server() ); debug("in_port : " + in_port() ); debug("smtp_server: " + smtp_server()); debug("smtp_port : " + smtp_port() ); debug("from : " + from() ); debug("email : " + email() ); debug("user : "******"pass : " + pass() ); }