[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sender rewriting fixed and other misc things



Hello,
here are several unimportant notes and diffs, but at the very end there
is a very important one.  Please have a look.

1. make install does not make $POSTOFFICE/public and $POSTOFFICE/router
   world-writable as they should be (or is it my mistake?)

2. PRIO_PROCESS is #defined in sys/resource.h and cannot be used
   if this header does not exist:

Index: scheduler/transport.c
===================================================================
RCS file: /cvsroot/zmailer/scheduler/transport.c,v
retrieving revision 1.96
diff -u -r1.96 transport.c
--- scheduler/transport.c       2000/12/04 12:20:00     1.96
+++ scheduler/transport.c       2000/12/17 21:23:50
@@ -772,7 +772,7 @@
          for (i = 3; i < scheduler_nofiles; ++i)
            close(i);
 
-#ifdef HAVE_SETPRIORITY
+#if defined(HAVE_SETPRIORITY) && defined(HAVE_SYS_RESOURCE_H)
          if (prio >= 80) { /* MAGIC LIMIT VALUE FOR ABSOLUTE SET! */
            setpriority(PRIO_PROCESS, 0, i - 100);
          } else
Index: scheduler/readconfig.c
===================================================================
RCS file: /cvsroot/zmailer/scheduler/readconfig.c,v
retrieving revision 1.22
diff -u -r1.22 readconfig.c
--- scheduler/readconfig.c      2000/12/01 23:33:41     1.22
+++ scheduler/readconfig.c      2000/12/17 21:23:53
@@ -661,7 +661,7 @@
          sfprintf(sfstderr, "%s: Bad UNIX priority value, acceptable in
range: -20..19; input=\"%s\"\n", progname, arg);
          return 1;
        }
-#ifdef HAVE_SETPRIORITY
+#if defined(HAVE_SETPRIORITY) && defined(HAVE_SYS_RESOURCE_H)
        /* PRIO_PROCESS depends likely of  HAVE_SYS_RESOURCE_H */
        setpriority(PRIO_PROCESS, 0, i);
 #endif
===================================================================

3. X-Envelope-To: contains irrelevant figure for uid (nobody's?)

4. In router/rfc822.c, result of crossbar() is printed if D_sequencer,
   but arguments of crossbar() is inside "#if 0".  I suggest to print
   them as well:

Index: router/rfc822.c
===================================================================
RCS file: /cvsroot/zmailer/router/rfc822.c,v
retrieving revision 1.47
diff -u -r1.47 rfc822.c
--- router/rfc822.c     2000/08/30 11:57:54     1.47
+++ router/rfc822.c     2000/12/17 23:15:40
@@ -1927,14 +1927,14 @@
                        GCVARS6;
 
                        /* secondlevel is XORs */
-#if 0
-                       printf("crossbar sender: ");
-                       s_grind(sender, stdout);
-                       putchar('\n');
-                       printf("crossbar to: ");
-                       s_grind(to, stdout);
-                       putchar('\n');
-#endif
+                       if (D_sequencer) {
+                         printf("crossbar sender: ");
+                         s_grind(sender, stdout);
+                         putchar('\n');
+                         printf("crossbar to: ");
+                         s_grind(to, stdout);
+                         putchar('\n');
+                       }
 
                        if ((x = crossbar(sender, to)) == NULL)
                          continue;
===================================================================

5. The last and most important.  The problem of envelope senders
   automagically moving to default domain if they originally where
   in one of local domains is hopefully pinpointed.  The culprit
   was aliases.cf.  When routeuser expands recipient address, it
   returns quad (((... "$user$plustail$domain" ...))).  But when
   it expands sender address, it returns the quad that it received
   as first argument and therefore "@domain" is not added to the
   user element.  As a result, router() called from router/rfc822.c
   around line 1580 returns user element of the quad in local form,
   without domain.  Later on, crossbar takes care of qualifying
   local name into canonic domain address using $mydomain.  Voila!
   sender address is changed.  Simple fix follows.  I wonder if
   it may break if $chan != local.  OTOH, it cannot be non-local
   in routeuser?  Or am I missing something?  Matti?

Index: proto/cf/aliases.cf
===================================================================
RCS file: /cvsroot/zmailer/proto/cf/aliases.cf,v
retrieving revision 1.37
diff -u -r1.37 aliases.cf
--- proto/cf/aliases.cf 2000/10/10 21:00:58     1.37
+++ proto/cf/aliases.cf 2000/12/18 02:51:25
@@ -217,6 +217,7 @@
        plustail2=""
        attr="$(attributes $quad)"
        chan="$(channel $quad)"
+       host="$(host $quad)"
        
        # For the expansions control tag we can use only
        # the 'channel',  and the 'username' strings, we CAN'T
@@ -232,8 +233,9 @@
 
        case "$type" in
        sender)
-               a=$(userdb "$user:mailname") || return (($quad))
-               return ((("$chan" "$a" "$user" $attr)))
+               a=$(userdb "$user:mailname")
+                 || return ((("$chan" "$host" "$user$plustail$domain"
$attr)))
+               return ((("$chan" "$a" "$user$plustail$domain" $attr)))
                ;;
        esac
 
===================================================================

--
Eugene, who is not going to sleep this night because in an hour
it's time to take shower, have breakfast and go to the office.
Ouch!