*** stunnel-3.11/protocol.c Thu Dec 21 18:57:17 2000 --- stunnel-3.11.smtpClient/protocol.c Thu Jan 18 15:54:01 2001 *************** *** 88,95 **** static int smtp_client(int local, int remote) { ! log(LOG_ERR, "Protocol not supported"); ! return -1; } static int smtp_server(int local, int remote) --- 88,117 ---- static int smtp_client(int local, int remote) { ! char line[STRLEN]; ! ! fdscanf(remote, "%[^\r]", line); ! while (strncmp(line,"220-",4)==0) { ! if(fdprintf(local, line)<0) ! return -1; ! fdscanf(remote, "%[^\r]", line); ! } ! if(fdprintf(local, line)<0) ! return -1; ! ! if(fdprintf(remote, "STARTTLS")<0) ! return -1; ! ! fdscanf(remote, "%[^\r]", line); ! while (strncmp(line,"220-",4)==0) { ! fdscanf(remote, "%[^\r]", line); ! } ! if(strncmp(line,"220 ",4)!=0) { ! log(LOG_ERR, "Server does not support TLS!"); ! return -1; ! } ! ! return 0; } static int smtp_server(int local, int remote)