Index: bounce.c
===================================================================
RCS file: /cvsroot-dbmail/dbmail/bounce.c,v
retrieving revision 1.25.4.3
diff -u -r1.25.4.3 bounce.c
--- bounce.c	2003/11/14 15:43:02	1.25.4.3
+++ bounce.c	2003/12/01 20:20:45
@@ -46,6 +46,7 @@
   void *sendmail_stream;
   struct list from_addresses;
   struct element *tmpelement;
+  char *destination_domain=NULL;
   field_t dbmail_from_address, sendmail, postmaster;
 
 
@@ -83,6 +84,16 @@
       trace (TRACE_MESSAGE,"%s,%s: sending 'no such user' bounce "
 	     "for destination [%s]", __FILE__, __FUNCTION__,
 	     destination_address);
+
+      /* If the dbmail_from_address or postmaster has no domain component, set it to
+       * the domain that had the non-existant user
+       */
+      destination_domain=strchr(destination_address, '@');
+      if (!strchr(dbmail_from_address, '@'))
+          strncat(dbmail_from_address, destination_domain, FIELDSIZE);
+      if (!strchr(postmaster, '@'))
+          strncat(postmaster, destination_domain, FIELDSIZE);
+
       list_init(&from_addresses);
       /* scan the from header for addresses */
       mail_adr_list ("Return-Path", &from_addresses,&mimelist);
