summaryrefslogtreecommitdiff
path: root/libproto/mailer/smtp_ehlo.c
diff options
context:
space:
mode:
Diffstat (limited to 'libproto/mailer/smtp_ehlo.c')
-rw-r--r--libproto/mailer/smtp_ehlo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libproto/mailer/smtp_ehlo.c b/libproto/mailer/smtp_ehlo.c
index f75e66cf7..1c4dc5f26 100644
--- a/libproto/mailer/smtp_ehlo.c
+++ b/libproto/mailer/smtp_ehlo.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
@@ -54,6 +54,8 @@ mu_smtp_ehlo (mu_smtp_t smtp)
return EINVAL;
if (MU_SMTP_FISSET (smtp, _MU_SMTP_ERR))
return MU_ERR_FAILURE;
+ if (smtp->state != MU_SMTP_EHLO)
+ return MU_ERR_SEQ;
if (!smtp->param[MU_SMTP_PARAM_DOMAIN])
{
@@ -125,7 +127,6 @@ mu_smtp_ehlo (mu_smtp_t smtp)
if (smtp->replcode[0] != '2')
return MU_ERR_REPLY;
}
- if (smtp->state == MU_SMTP_EHLO)
- smtp->state = MU_SMTP_MAIL;
+ smtp->state = MU_SMTP_MAIL;
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.