On Tue, 14 Nov 2000, Gary Mills and Ken Murchison corresponded thusly:

> >> Nov 14 14:33:46 setup16 master[9266]: [ID 970914 local6.debug] process
> >> 9900 exited, signaled to death by 11
> >
> >Hmmm.  This *might* be caused by cyrus and sasl being linked against two
> >different versions of Berkeley DB.  Or it could be caused by incorrect
> >permissions on the /var/imap/deliverdb tree.

This looks just like the behavior I was seeing in lmtpd.c ..

> No, nothing resembling an error when I'm testing vacation.  I just did
> another test while I was trussing the master daemon and any children.
> I couldn't see any attempt to respond.  It seems to me that lmtpd is
> deciding that a response is not necessary.  In the trace, I can see the
> LMTP dialogue with sendmail, I can see it open the sieve script, followed
> by nameserver queries, and I can see lots of activity against a DB
> file, conf/deliverdb/deliver-m.db.  I can also see it deliver the message
> to my mailbox.  However, there is nothing resembling a response.

Note that lmtpd won't send a response back if the mail looks like it
came from a bounce/root/daemon address, or if the From matches any
of the To :addresses 

Do you have a corefile in the deliverdb directory?  Run 'gdb -c' over 
it and if so and paste the results of a 'bt' backtrace. I'm betting
it's either the In-Reply-To header or the EX_USAGE error from sendmail
due to the commandline being wrong.

Here's a good way to debug all things lmtp-related: 

On your pre-production installation's cyrus.conf, set all the 'prefork'
values to 1. This will ensure that you know which pid the next connection
will come in on. For lmtpd, put sendmail into queue-only mode with 
"O DeliveryMode=queueonly" .. Send in a message you expect should trigger
the vacation response, and make sure it ends up sitting in the queue.

When you're ready, fire up gdb on the lmtpd process, like this:
# gdb
> file /cyrus/bin/lmtpd
> attach <pid>
> b setup_sieve
> b send_response
> [ other breakpoints as desired ] 
> c

Then run sendmail -v -q

I've attached a context diff against the latest cvs version, please
don't auto-apply it though (your from address will be different).

-=Eric

--- lmtpd.c     Tue Nov 14 22:25:01 2000
+++ /cyrus/src/cyrus-imapd-2.0.6d/imap/lmtpd.c  Tue Nov 14 13:35:49 2000
@@ -1,6 +1,6 @@
 /* lmtpd.c -- Program to deliver mail to a mailbox
  *
- * $Id: lmtpd.c,v 1.51 2000/11/11 05:02:50 ken3 Exp $
+ * $Id: lmtpd.c,v 1.3 2000/10/25 15:03:36 eric Exp $
  * Copyright (c) 1999-2000 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,7 @@
  *
  */
 
-/*static char _rcsid[] = "$Id: lmtpd.c,v 1.51 2000/11/11 05:02:50 ken3 Exp $";*/
+/*static char _rcsid[] = "$Id: lmtpd.c,v 1.3 2000/10/25 15:03:36 eric Exp $";*/
 
 #include <config.h>
 
@@ -148,7 +148,7 @@
 
 void shut_down(int code);
 
-struct lmtp_func mylmtp = { &deliver, &verify_user, 0, 0 };
+struct lmtp_func mylmtp = { &deliver, &verify_user, 0 };
 
 static int quotaoverride = 0;          /* should i override quota? */
 int dupelim = 0;
@@ -307,12 +307,8 @@
     prot_setflushonread(deliver_in, deliver_out);
     prot_settimeout(deliver_in, 300);
 
-    while ((opt = getopt(argc, argv, "aq")) != EOF) {
+    while ((opt = getopt(argc, argv, "q")) != EOF) {
        switch(opt) {
-       case 'a':
-           mylmtp.preauth = 1;
-           break;
-
        case 'q':
            quotaoverride = 1;
            break;
@@ -427,7 +423,8 @@
        close(fds[1]);
        /* make the pipe be stdin */
        dup2(fds[0], 0);
-       execv(SENDMAIL, (char **) argv);
+       
+       execv(SENDMAIL, (char **) argv);
 
        /* if we're here we suck */
        printf("451 deliver: didn't exec?!?\r\n");
@@ -488,10 +485,9 @@
 
     smbuf[0] = "sendmail";
     smbuf[1] = "-f";
-    smbuf[2] = "<>";
-    smbuf[3] = "--";
-    smbuf[4] = rejto;
-    smbuf[5] = NULL;
+    smbuf[2] = "[EMAIL PROTECTED]";
+    smbuf[3] = rejto;
+    smbuf[4] = NULL;
     sm_pid = open_sendmail(smbuf, &sm);
     if (sm == NULL) {
        return -1;
@@ -558,7 +554,7 @@
        fwrite(buf, i, 1, sm);
     }
     fprintf(sm, "\r\n\r\n");
-    fprintf(sm, "--%d/%s--\r\n", (int) p, config_servername);
+    fprintf(sm, "--%d/%s\r\n", (int) p, config_servername);
 
     fclose(sm);
     while (waitpid(sm_pid, &sm_stat, 0) < 0);
@@ -580,11 +576,10 @@
        smbuf[2] = return_path;
     } else {
        smbuf[1] = "-f";
-       smbuf[2] = "<>";
+       smbuf[2] = "[EMAIL PROTECTED]";
     }
-    smbuf[3] = "--";
-    smbuf[4] = forwardto;
-    smbuf[5] = NULL;
+    smbuf[3] = forwardto;
+    smbuf[4] = NULL;
     sm_pid = open_sendmail(smbuf, &sm);
        
     if (sm == NULL) {
@@ -811,10 +806,9 @@
 
     smbuf[0] = "sendmail";
     smbuf[1] = "-f";
-    smbuf[2] = "<>";
-    smbuf[3] = "--";
-    smbuf[4] = src->addr;
-    smbuf[5] = NULL;
+    smbuf[2] = "[EMAIL PROTECTED]";
+    smbuf[3] = src->addr;
+    smbuf[4] = NULL;
     sm_pid = open_sendmail(smbuf, &sm);
     if (sm == NULL) {
        *errmsg = "Could not spawn sendmail process";
@@ -852,8 +846,7 @@
            break;
        }
     fprintf(sm, "Subject: %s\r\n", src->subj);
-    if (m->id)
-       fprintf(sm, "In-Reply-To: %s\r\n", m->id);
+/*    fprintf(sm, "In-Reply-To: %s\r\n", m->id); */
     fprintf(sm, "Auto-Submitted: auto-replied (vacation)\r\n");
     if (src->mime) {
        fprintf(sm, "MIME-Version: 1.0\r\n");
@@ -868,7 +861,7 @@
     fprintf(sm, "%s\r\n", src->msg);
 
     if (src->mime) {
-       fprintf(sm, "\r\n--%d/%s--\r\n", (int) p, config_servername);
+       fprintf(sm, "\r\n--%d/%s\r\n", (int) p, config_servername);
     }
     fclose(sm);
     while (waitpid(sm_pid, &sm_stat, 0) < 0);
@@ -1047,7 +1040,7 @@
 static void
 usage()
 {
-    fprintf(stderr, "421-4.3.0 usage: lmtpd [-a] [-q]\r\n");
+    fprintf(stderr, "421-4.3.0 usage: lmtpd [-q]\r\n");
     fprintf(stderr, "421 4.3.0 %s\n", CYRUS_VERSION);
     exit(EC_USAGE);
 }

Reply via email to