-/* $OpenBSD: mta_session.c,v 1.64 2014/04/30 12:49:54 gilles Exp $ */
+/* $OpenBSD: mta_session.c,v 1.65 2014/05/12 14:37:32 eric Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
#define MTA_LMTP 0x0800
#define MTA_WAIT 0x1000
#define MTA_HANGON 0x2000
+#define MTA_RECONN 0x4000
#define MTA_EXT_STARTTLS 0x01
#define MTA_EXT_PIPELINING 0x02
else if ((s->ext & MTA_EXT_STARTTLS) == 0) {
if (s->flags & MTA_FORCE_TLS || s->flags & MTA_WANT_SECURE) {
mta_error(s, "TLS required but not supported by remote host");
- mta_connect(s);
+ s->flags |= MTA_RECONN;
}
else
/* server doesn't support starttls, do not use it */
mta_free(s);
return;
}
+ if (s->flags & MTA_RECONN) {
+ s->flags &= ~MTA_RECONN;
+ mta_connect(s);
+ return;
+ }
iobuf_normalize(&s->iobuf);