#include <signal.h>
#ifdef USE_LIBESMTP
+#ifdef HAVE_GNUTLS_OPENSSL_H
+#define SSL_SESSION_ASN1_VERSION
+#include <gnutls/openssl.h>
+#endif
#include <auth-client.h>
#include <libesmtp.h>
#endif
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,...)
{
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: {
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;
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