At least since stunnel 4.15 - but not yet in 4.09 (don't know about the
intermediate versions) - there is a (cosmetic only?) bug in the "welcome"
forwarding of the smtp_server in protocol.c (lines 177-187 in 4.16):
fdgetline(c, c->remote_fd.fd, line);
if(!isprefix(line, "220")) {
s_log(LOG_ERR, "Unknown server welcome");
longjmp(c->err, 1);
}
fdprintf(c, c->local_wfd.fd, "220%s + stunnel", line);
fdgetline(c, c->local_rfd.fd, line);
if(!isprefix(line, "EHLO ")) {
s_log(LOG_ERR, "Unknown client EHLO");
longjmp(c->err, 1);
}
Although the line read from remote_fd.fd already starts with "220", another
220 is prepended in forwarding to local_wfd.fd, line 182. This seems to haveno adverse effects, but this line should better be changed to:
fdprintf(c, c->local_wfd.fd, "%s + stunnel", line);