Josip Rodin writes:

I'm only not sure what happens to messages that actually do arrive at
<MAILER-DAEMON> somehow - they would get their FROM emptied upon leaving
maildrop. Maybe a more special string should be used instead, in case
someone actually has such a semi-broken MTA set up.

Yes, this is extremely ugly, and disgusting.  This is not the way to fix it.

I'm going to try the following patch instead.


diff -U3 -r1.52 main.C
--- maildrop/main.C     12 May 2005 15:21:53 -0000      1.52
+++ maildrop/main.C     17 Sep 2006 23:56:23 -0000
@@ -1,5 +1,5 @@
 /*
-** Copyright 1998 - 2005 Double Precision, Inc.
+** Copyright 1998 - 2006 Double Precision, Inc.
 ** See COPYING for distribution information.
 */
 
@@ -352,6 +352,7 @@
 const  char *deliverymode=0;
 char *embedded_filter=0;
 const  char *from=0;
+int     explicit_from=0;
 Buffer recipe;
 uid_t  orig_uid;
 gid_t  orig_gid, orig_gid2;
@@ -430,7 +431,10 @@
                case 'f':
                        if (!*optarg && argn < argc)    optarg=argv[argn++];
                        if (*optarg)
+                       {
                                from=optarg;
+                               explicit_from=1;
+                       }
                        break;
                case 'w':
                        if (!*optarg && argn < argc)    optarg=argv[argn++];
@@ -737,6 +741,9 @@
                maildrop.msginfo.fromname=maildrop.init_logname;
        }
 
+       if (explicit_from)
+               maildrop.msginfo.fromname=from;
+
        name="FROM";
        value=maildrop.msginfo.fromname;
        SetVar(name, value);

Attachment: pgpteoUrCSO9h.pgp
Description: PGP signature

Reply via email to