On Sun, Jun 15, 2003 at 05:47:42PM -0700, Christian G. Warden wrote:
> I'm running dbmail on debian with exim.  I'm using the
> dbmail-mysql_1.1.20030529-2 from http://debian.nfgd.net.  Mail to
> existing aliases works correctly, but mail to non-existent aliases
> creates bounces that don't seem to make it into exim.
> dbmail seems to generate a bounce, but it never shows up in exim.

Sorry to respond to my own message, but I tracked down the problem.  I
set the value of SENDMAIL to "/usr/sbin/sendmail -t", so popen() was
passing that entire to string to the shell as the process to run.
Changing it to SENDMAIL=/usr/sbin/sendmail -t fixed the problem.

Attached is a patch to detect such an error.

> I'm not sure it makes sense for dbmail to be generating the bounces
> anyway.  It seems like a better idea to have dbmail to return EX_NOUSER and
> let the MTA generate the bounce.

This, obviously, only makes sense if you pass a single recipient to
dbmail-smtp.
 
xn
--- bounce.c.orig       Thu Mar 20 07:08:03 2003
+++ bounce.c    Sun Jun 15 18:59:59 2003
@@ -15,6 +15,7 @@
 #include "db.h"
 #include "debug.h"
 #include <stdlib.h>
+#include <errno.h>
 #include <string.h>

 extern struct list mimelist;
@@ -79,6 +80,9 @@

              (FILE *)sendmail_stream=popen (sendmail,"w");

+             trace (TRACE_MESSAGE,"bounce(): sending 'no such user' to [%s]",
+                    (char *)tmpelement->data);
+
              if (sendmail_stream==NULL)
                {
                  /* could not open a succesfull stream */
@@ -100,7 +104,10 @@
              fprintf ((FILE *)sendmail_stream,"%s",header);
              fprintf ((FILE *)sendmail_stream,"--- end of header ---\n\n\n");
              fprintf ((FILE *)sendmail_stream,"\n.\n");
-             pclose ((FILE *)sendmail_stream);
+             if (pclose ((FILE *)sendmail_stream) != 0)
+               {
+                   trace(TRACE_ERROR, "Failed to execute %s [%s]", sendmail, 
strerror(errno));
+               }

              /* jump forward to next recipient */
              tmpelement=tmpelement->nextnode;
@@ -161,7 +168,10 @@
              fprintf ((FILE *)sendmail_stream,"%s",header);
              fprintf ((FILE *)sendmail_stream,"--- end of header ---\n\n\n");
              fprintf ((FILE *)sendmail_stream,"\n.\n");
-             pclose ((FILE *)sendmail_stream);
+             if (pclose ((FILE *)sendmail_stream) != 0)
+               {
+                   trace(TRACE_ERROR, "Failed to execute %s [%s]", sendmail, 
strerror(errno));
+               }

              /* jump forward to next recipient */
              tmpelement=tmpelement->nextnode;

Reply via email to