diff options
Diffstat (limited to 'libproto/mailer/smtp_starttls.c')
-rw-r--r-- | libproto/mailer/smtp_starttls.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/libproto/mailer/smtp_starttls.c b/libproto/mailer/smtp_starttls.c index 2040a2138..db91093d6 100644 --- a/libproto/mailer/smtp_starttls.c +++ b/libproto/mailer/smtp_starttls.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2010-2019 Free Software Foundation, Inc. + Copyright (C) 2010-2024 Free Software Foundation, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -81,7 +81,6 @@ mu_smtp_starttls (mu_smtp_t smtp) { #ifdef WITH_TLS int status; - mu_stream_t tlsstream, streams[2]; if (!smtp) return EINVAL; @@ -101,22 +100,11 @@ mu_smtp_starttls (mu_smtp_t smtp) else if (smtp->replcode[0] != '2') return MU_ERR_FAILURE; - mu_stream_flush (smtp->carrier); - status = _mu_smtp_get_streams (smtp, streams); - MU_SMTP_CHECK_ERROR (smtp, status); - - status = mu_tls_client_stream_create (&tlsstream, - streams[0], streams[1], 0); - mu_stream_unref (streams[0]); - mu_stream_unref (streams[1]); - MU_SMTP_CHECK_ERROR (smtp, status); - streams[0] = streams[1] = tlsstream; - status = _mu_smtp_set_streams (smtp, streams); - mu_stream_unref (streams[0]); - mu_stream_unref (streams[1]); + status = mu_starttls (&smtp->carrier, NULL, MU_TLS_CLIENT); MU_SMTP_CHECK_ERROR (smtp, status); /* Invalidate the capability list */ mu_list_destroy (&smtp->capa); + smtp->state = MU_SMTP_EHLO; return 0; #else return ENOSYS; |