On Mon, Mar 01, 2004 at 07:58:00PM +0100, Oskar Eyb wrote:
> Hello,
> 
> I'm wondering about an incomprehensibly "failure" with two qmail-ldap's.
> 
> On the sending MTA there is an "failure" (unfortunately not specified
> more precisely) which causes a bounce.
> 
> In the logs of the MTA on the other side is all OK, and the mail arrives.
> 
> 
> Patch is 20040201 with enabled DDATA_COMPRESS and
> -DTLS_REMOTE -DTLS_SMTPD -DTLSDEBUG on both sides.
> 

OK. I think I tracked the error down. It's the TLSDEBUG option that
confuses qmail-rspawn because the quit message starts with a S
(STARTTLS...) instead of a K, Z or D.

I'm running qmail-ldap with ssl and I'm using it heavily and never
noticed the problem so I think it is definitifly the TLSDEBUG option.

You can also try this not yet tested patch.

-- 
:wq Claudio

Index: qmail-remote.c
===================================================================
RCS file: /home/cvs-djbware/CVS/qmail-ldap/qmail-remote.c,v
retrieving revision 1.37
diff -u -p -r1.37 qmail-remote.c
--- qmail-remote.c      30 Jan 2004 14:37:55 -0000      1.37
+++ qmail-remote.c      3 Mar 2004 15:48:10 -0000
@@ -352,6 +352,24 @@ void quit(const char *prepend, const cha
   int r;
   char num[FMT_ULONG];
 #endif
+  substdio_putsflush(&smtpto,"QUIT\r\n");
+  /* waiting for remote side is just too ridiculous */
+  out(prepend);
+  outhost();
+  out(append);
+  out(".\n");
+#ifdef DATA_COMPRESS
+  if (wantcomp == 2) {
+         r = 100 - (int)(100.0*stream.total_out/stream.total_in);
+         if (r < 0) {
+           num[0] = '-'; r*= -1;
+         } else
+           num[0] = ' ';
+         num[fmt_uint(num+1,r) + 1] = 0;
+         out("DDC saved ");
+         out(num); out(" percent.\n");
+  }
+#endif
 /* TAG */
 #if defined(TLS_REMOTE) && defined(TLSDEBUG)
 #define ONELINE_NAME(X) X509_NAME_oneline(X,NULL,0)
@@ -379,24 +397,6 @@ void quit(const char *prepend, const cha
  }
 #endif
 
-  substdio_putsflush(&smtpto,"QUIT\r\n");
-  /* waiting for remote side is just too ridiculous */
-  out(prepend);
-  outhost();
-  out(append);
-  out(".\n");
-#ifdef DATA_COMPRESS
-  if (wantcomp == 2) {
-         r = 100 - (int)(100.0*stream.total_out/stream.total_in);
-         if (r < 0) {
-           num[0] = '-'; r*= -1;
-         } else
-           num[0] = ' ';
-         num[fmt_uint(num+1,r) + 1] = 0;
-         out("DDC saved ");
-         out(num); out(" percent.\n");
-  }
-#endif
   outsmtptext();
   zerodie();
 }
@@ -554,12 +554,20 @@ void smtp(void)
       substdio_puts(&smtpto,"\r\n");
       substdio_flush(&smtpto);
 
-      if (smtpcode() != 250)
-       {
-        quit("ZTLS connected to "," but my name was rejected");
-       }
-     } 
-   }
+      if (smtpcode() != 250) {
+       quit("ZTLS connected to "," but my name was rejected");
+      }
+      /* extension handling */
+      for (i = 0; i < smtptext.len; i += str_chr(smtptext.s+i,'\n') + 1) {
+       if (i+8 < smtptext.len && !case_diffb("SIZE", 4, smtptext.s+i+4) )
+         flagsize = 1;
+#ifdef DATA_COMPRESS
+       else if (i+9 < smtptext.len && !case_diffb("DATAZ", 5, smtptext.s+i+4))
+         wantcomp = 1;
+#endif
+      }
+    } 
+  }
 #endif
 
   substdio_puts(&smtpto,"MAIL FROM:<");

Reply via email to