X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=sendlib.c;fp=sendlib.c;h=0f336164a6118362eb6c6e5590c94662e5f66ff5;hb=e87df0bb071ba21d6e3d6a47cb797c135605eba5;hp=8891280168f55ca88348e2cb1ca32860118d4921;hpb=97e1d274dfbeb8b4a5da3f2b68fb66f96b7739d3;p=apps%2Fmadmutt.git diff --git a/sendlib.c b/sendlib.c index 8891280..0f33616 100644 --- a/sendlib.c +++ b/sendlib.c @@ -12,6 +12,10 @@ #include #ifdef USE_LIBESMTP +#ifdef HAVE_GNUTLS_OPENSSL_H +#define SSL_SESSION_ASN1_VERSION +#include +#endif #include #include #endif @@ -186,17 +190,6 @@ _send_smtp_messagefp_cb(void **buf, int *len, void *arg) return *buf; } -static int handle_invalid_peer_certificate (long vfy_result) { -#if defined (HAVE_GNUTLS_OPENSSL_H) - mutt_error (_("Error verifying certificate: %s"), - NONULL (X509_verify_cert_error_string (vfy_result))); -#else - mutt_error (_("Error verifying certificate. Error Code: %lu"), vfy_result); -#endif - sleep(2); - return 1; /* Accept the problem */ -} - static void event_cb (smtp_session_t session __attribute__ ((unused)), int event_no, void *arg,...) { @@ -225,8 +218,9 @@ static void event_cb (smtp_session_t session __attribute__ ((unused)), case SMTP_EV_INVALID_PEER_CERTIFICATE: { long vfy_result; vfy_result = va_arg(alist, long); ok = va_arg(alist, int*); - *ok = handle_invalid_peer_certificate(vfy_result); - sleep(1); + mutt_error (_("Error verifying certificate. Error Code: %lu"), vfy_result); + sleep(2); + *ok = 1; break; } case SMTP_EV_NO_PEER_CERTIFICATE: { @@ -317,8 +311,8 @@ int send_smtp_check_usetls (const char* option, unsigned long p, static int send_smtp_invoke(address_t *from, address_t *to, address_t *cc, address_t *bcc, const char *msg, int eightbit) -{ /* message contains 8bit chars */ - int ret = 0; /* return value, default = success */ +{ + int ret = 0; smtp_session_t session; smtp_message_t message; char *hostportstr = NULL; @@ -334,9 +328,9 @@ send_smtp_invoke(address_t *from, address_t *to, address_t *cc, SMTPFAIL ("smtp_create_session"); #ifdef HAVE_GNUTLS_OPENSSL_H - if (SmtpUseTLS != NULL && ascii_strncasecmp("enabled", SmtpUseTLS, 7) == 0) { + if (!ascii_strncasecmp("enabled", SmtpUseTLS, 7)) { smtp_starttls_enable(session, Starttls_ENABLED); - } else if (SmtpUseTLS != NULL && ascii_strncasecmp("required", SmtpUseTLS, 8) == 0) { + } else if (!ascii_strncasecmp("required", SmtpUseTLS, 8)) { smtp_starttls_enable(session, Starttls_REQUIRED); } #endif