Index: deliver.c =================================================================== RCS file: /cvs/sendmail/deliver.c,v retrieving revision 8.1000 diff -u -r8.1000 deliver.c --- deliver.c 2 Mar 2006 01:37:39 -0000 8.1000 +++ deliver.c 27 Mar 2006 19:21:31 -0000 @@ -3233,15 +3233,19 @@ if (result == SASL_OK && *ssf > 0) { + int tmo; + /* ** Convert I/O layer to use SASL. ** If the call fails, the connection ** is aborted. */ + tmo = DATA_PROGRESS_TIMEOUT * 1000; + if (sfdcsasl(&mci->mci_in, &mci->mci_out, - mci->mci_conn) == 0) + mci->mci_conn, tmo) == 0) { mci->mci_flags &= ~MCIF_EXTENS; mci->mci_flags |= MCIF_AUTHACT| Index: sfsasl.c =================================================================== RCS file: /cvs/sendmail/sfsasl.c,v retrieving revision 8.113 diff -u -r8.113 sfsasl.c --- sfsasl.c 2 Mar 2006 19:18:27 -0000 8.113 +++ sfsasl.c 27 Mar 2006 19:21:31 -0000 @@ -331,6 +326,7 @@ { while (outlen > 0) { + errno = 0; /* XXX result == 0? */ ret = sm_io_write(so->fp, SM_TIME_DEFAULT, &outbuf[total], outlen); @@ -354,6 +350,7 @@ ** fin -- the sm_io file encrypted data to be read from ** fout -- the sm_io file encrypted data to be writen to ** conn -- the sasl connection pointer +** tmo -- timeout ** ** Returns: ** -1 on error @@ -365,15 +362,16 @@ */ int -sfdcsasl(fin, fout, conn) +sfdcsasl(fin, fout, conn, tmo) SM_FILE_T **fin; SM_FILE_T **fout; sasl_conn_t *conn; + int tmo; { SM_FILE_T *newin, *newout; SM_FILE_T SM_IO_SET_TYPE(sasl_vector, "sasl", sasl_open, sasl_close, sasl_read, sasl_write, NULL, sasl_getinfo, NULL, - SM_TIME_FOREVER); + SM_TIME_DEFAULT); struct sasl_info info; if (conn == NULL) @@ -384,7 +382,7 @@ SM_IO_INIT_TYPE(sasl_vector, "sasl", sasl_open, sasl_close, sasl_read, sasl_write, NULL, sasl_getinfo, NULL, - SM_TIME_FOREVER); + SM_TIME_DEFAULT); info.fp = *fin; info.conn = conn; newin = sm_io_open(&sasl_vector, SM_TIME_DEFAULT, &info, @@ -405,6 +403,9 @@ } sm_io_automode(newin, newout); + sm_io_setinfo(*fin, SM_IO_WHAT_TIMEOUT, &tmo); + sm_io_setinfo(*fout, SM_IO_WHAT_TIMEOUT, &tmo); + *fin = newin; *fout = newout; return 0; Index: sfsasl.h =================================================================== RCS file: /cvs/sendmail/sfsasl.h,v retrieving revision 8.19 diff -u -r8.19 sfsasl.h --- sfsasl.h 27 Feb 2006 19:53:37 -0000 8.19 +++ sfsasl.h 27 Mar 2006 19:21:31 -0000 @@ -12,9 +12,9 @@ #ifndef SFSASL_H # define SFSASL_H -#if SASL -extern int sfdcsasl __P((SM_FILE_T **, SM_FILE_T **, sasl_conn_t *)); -#endif /* SASL */ +# if SASL +extern int sfdcsasl __P((SM_FILE_T **, SM_FILE_T **, sasl_conn_t *, int)); +# endif /* SASL */ # if STARTTLS extern int tls_retry __P((SSL *, int, int, time_t, int, int, Index: srvrsmtp.c =================================================================== RCS file: /cvs/sendmail/srvrsmtp.c,v retrieving revision 8.923 diff -u -r8.923 srvrsmtp.c --- srvrsmtp.c 22 Mar 2006 22:53:47 -0000 8.923 +++ srvrsmtp.c 27 Mar 2006 19:21:31 -0000 @@ -1292,14 +1292,17 @@ if (ssf != NULL && *ssf > 0) { + int tmo; + /* ** Convert I/O layer to use SASL. ** If the call fails, the connection ** is aborted. */ + tmo = TimeOuts.to_datablock * 1000; if (sfdcsasl(&InChannel, &OutChannel, - conn) == 0) + conn, tmo) == 0) { /* restart dialogue */ n_helo = 0;