X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=blobdiff_plain;f=src%2Fsmtp.c;h=f5107d342699d587e1cc3be09c09971f9bbfdb7a;hp=a3b5a37890743fe7a75e50d9479a765fb3587613;hb=309b87a3d8b8835d403c5455b436abe6c4adfb74;hpb=036b63d8fc5a8c6e1ff150737226122c174c39cb diff --git a/src/smtp.c b/src/smtp.c index a3b5a3789..f5107d342 100644 --- a/src/smtp.c +++ b/src/smtp.c @@ -31,7 +31,7 @@ static gint verbose = 1; static gchar smtp_response[MSGBUFSIZE]; -gint smtp_helo(gint sock, const char *hostname, gboolean use_smtp_auth) +gint smtp_helo(SockInfo *sock, const char *hostname, gboolean use_smtp_auth) { if (use_smtp_auth) { sock_printf(sock, "EHLO %s\r\n", hostname); @@ -48,7 +48,7 @@ gint smtp_helo(gint sock, const char *hostname, gboolean use_smtp_auth) } } -gint smtp_from(gint sock, const gchar *from, +gint smtp_from(SockInfo *sock, const gchar *from, const gchar *userid, const gchar *passwd, gboolean use_smtp_auth) { @@ -81,7 +81,7 @@ gint smtp_from(gint sock, const gchar *from, return smtp_ok(sock); } -gint smtp_rcpt(gint sock, const gchar *to) +gint smtp_rcpt(SockInfo *sock, const gchar *to) { gchar buf[MSGBUFSIZE]; @@ -97,7 +97,7 @@ gint smtp_rcpt(gint sock, const gchar *to) return smtp_ok(sock); } -gint smtp_data(gint sock) +gint smtp_data(SockInfo *sock) { sock_printf(sock, "DATA\r\n"); if (verbose) @@ -106,7 +106,7 @@ gint smtp_data(gint sock) return smtp_ok(sock); } -gint smtp_rset(gint sock) +gint smtp_rset(SockInfo *sock) { sock_printf(sock, "RSET\r\n"); if (verbose) @@ -115,7 +115,7 @@ gint smtp_rset(gint sock) return smtp_ok(sock); } -gint smtp_quit(gint sock) +gint smtp_quit(SockInfo *sock) { sock_printf(sock, "QUIT\r\n"); if (verbose) @@ -124,7 +124,7 @@ gint smtp_quit(gint sock) return smtp_ok(sock); } -gint smtp_eom(gint sock) +gint smtp_eom(SockInfo *sock) { sock_printf(sock, ".\r\n"); if (verbose) @@ -133,7 +133,7 @@ gint smtp_eom(gint sock) return smtp_ok(sock); } -gint smtp_ok(gint sock) +gint smtp_ok(SockInfo *sock) { while ((sock_read(sock, smtp_response, sizeof(smtp_response) - 1)) != 1) { @@ -149,9 +149,12 @@ gint smtp_ok(gint sock) return SM_OK; else if (smtp_response[3] != '-') return SM_ERROR; - else if (smtp_response[0] == '5' && smtp_response[1] == '0' && - (smtp_response[3] == '4' || smtp_response[3] == '3' || smtp_response[3] == '1')) - return SM_ERROR; + else if (smtp_response[0] == '5' && + smtp_response[1] == '0' && + (smtp_response[2] == '4' || + smtp_response[2] == '3' || + smtp_response[2] == '1')) + return SM_ERROR; } return SM_UNRECOVERABLE;