]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.3-RC5 v2.3-RC5
authorWietse Venema <wietse@porcupine.org>
Tue, 4 Jul 2006 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 Feb 2018 20:36:49 +0000 (15:36 -0500)
12 files changed:
postfix/HISTORY
postfix/README_FILES/MILTER_README
postfix/html/MILTER_README.html
postfix/html/master.5.html
postfix/man/man5/master.5
postfix/proto/MILTER_README.html
postfix/proto/master
postfix/src/cleanup/cleanup_milter.c
postfix/src/global/mail_version.h
postfix/src/milter/Makefile.in
postfix/src/milter/milter8.c
postfix/src/milter/test-milter.c

index 3349461565271484caad835b1eb22652fa28ee8d..3e27f5426a172d08de724ba6def4d829f38d6d5b 100644 (file)
@@ -12445,6 +12445,11 @@ Apologies for any names omitted.
        Compatibility: with OpenBSD 2.7 and later, the alias file
        is now in /etc/mail/aliases.
 
+20060704
+
+       Bugfix: the Milter client skipped zero-length body lines.
+       File: milter/milter8.c.
+
 Wish list:
 
        In the SMTPD policy client (encode or strip) non-printable
index 1d2bc52c7b78bab82fb37328ea42e70b20d21306..82ef3bac785905f0d59749c96af387dc72d5d6f4 100644 (file)
@@ -125,7 +125,11 @@ R\bRu\bun\bnn\bni\bin\bng\bg M\bMi\bil\blt\bte\ber\br a\bap\bpp\bpl\bli\bic\bca\bat\bti\bio\bon\bns\bs
 To run a Milter application, see the documentation of the filter for options. A
 typical command looks like this:
 
-    $ /\b/s\bso\bom\bme\be/\b/w\bwh\bhe\ber\bre\be/\b/d\bdk\bk-\b-f\bfi\bil\blt\bte\ber\br -\b-p\bp i\bin\bne\bet\bt:\b:p\bpo\bor\brt\btn\bnu\bum\bmb\bbe\ber\br@\b@l\blo\boc\bca\bal\blh\bho\bos\bst\bt .\b..\b..\b.o\bot\bth\bhe\ber\br o\bop\bpt\bti\bio\bon\bns\bs.\b..\b..\b.
+    # /\b/s\bso\bom\bme\be/\b/w\bwh\bhe\ber\bre\be/\b/d\bdk\bk-\b-f\bfi\bil\blt\bte\ber\br -\b-u\bu u\bus\bse\ber\bri\bid\bd -\b-p\bp i\bin\bne\bet\bt:\b:p\bpo\bor\brt\btn\bnu\bum\bmb\bbe\ber\br@\b@l\blo\boc\bca\bal\blh\bho\bos\bst\bt .\b..\b..\b.o\bot\bth\bhe\ber\br
+    o\bop\bpt\bti\bio\bon\bns\bs.\b..\b..\b.
+
+Please specify a userid value that isn't used for other applications (not
+"postfix", not "www", etc.).
 
 C\bCo\bon\bnf\bfi\big\bgu\bur\bri\bin\bng\bg P\bPo\bos\bst\btf\bfi\bix\bx
 
index c300ef7429d30f317aa4b25920c79ee5af6a0813..acfe5fae36a1cb23cd3ce9966f0fb7816ab985ae 100644 (file)
@@ -257,10 +257,13 @@ for options.  A typical command looks like this:</p>
 
 <blockquote>
 <pre>
-$ <b>/some/where/dk-filter -p inet:<i>portnumber</i>@localhost ...<i>other options</i>...</b>
+# <b>/some/where/dk-filter -u <i>userid</i> -p inet:<i>portnumber</i>@localhost ...<i>other options</i>...</b>
 </pre>
 </blockquote>
 
+<p> Please specify a <i>userid</i> value that isn't used for other
+applications (not "postfix", not "www", etc.). </p>
+
 <h2><a name="config">Configuring Postfix</a></h2>
 
 <p> Like Sendmail, Postfix has a lot of configuration options that
index 376ad3d1a12ab067364ebe906958669f9c6e1bf0..412a62657018b7f3b5784df438fe208fef2f417f 100644 (file)
@@ -16,7 +16,7 @@ MASTER(5)                                                            MASTER(5)
 
        Postfix  services  are  implemented  by  daemon processes.
        These run in the background under control of the <a href="master.8.html"><b>master</b>(8)</a>
-       process.   The  master.cf configuration file defines how a
+       process.   The  <a href="master.5.html">master.cf</a> configuration file defines how a
        client program connects to a service, and what daemon pro-
        gram  runs  when a service is requested.  Most daemon pro-
        cesses are short-lived and terminate after serving <b><a href="postconf.5.html#max_use">max_use</a></b>
@@ -28,17 +28,17 @@ MASTER(5)                                                            MASTER(5)
        <a href="local.8.html"><b>local</b>(8)</a>, <a href="pipe.8.html"><b>pipe</b>(8)</a> or <a href="spawn.8.html"><b>spawn</b>(8)</a> services, or run the  server
        under control by <b>inetd</b>(8) or equivalent.
 
-       After changing master.cf you must execute "<b>postfix reload</b>"
+       After changing <a href="master.5.html">master.cf</a> you must execute "<b>postfix reload</b>"
        to reload the configuration.
 
 <b>SYNTAX</b>
-       The general format of the master.cf file is as follows:
+       The general format of the <a href="master.5.html">master.cf</a> file is as follows:
 
        <b>o</b>      Each logical line defines a single Postfix service.
               Each  service is identified by its name and type as
               described below.  When multiple lines  specify  the
               same  service  name  and type, only the last one is
-              remembered.  Otherwise, the order of master.cf ser-
+              remembered.  Otherwise, the order of <a href="master.5.html">master.cf</a> ser-
               vice definitions does not matter.
 
        <b>o</b>      Empty  lines and whitespace-only lines are ignored,
@@ -51,7 +51,7 @@ MASTER(5)                                                            MASTER(5)
 
        Each  logical  line  consists of eight fields separated by
        whitespace.  These are described below  in  the  order  as
-       they appear in the master.cf file.
+       they appear in the <a href="master.5.html">master.cf</a> file.
 
        Where applicable a field of "-" requests that the built-in
        default value be used. For boolean fields specify  "y"  or
@@ -86,9 +86,9 @@ MASTER(5)                                                            MASTER(5)
 
                      Note: with Postfix  version  2.2  and  later
                      specify "<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a> = loopback-only</b>" in
-                     main.cf, instead of hard-coding loopback  IP
-                     address   information  in  master.cf  or  in
-                     main.cf.
+                     <a href="postconf.5.html">main.cf</a>, instead of hard-coding loopback  IP
+                     address   information  in  <a href="master.5.html">master.cf</a>  or  in
+                     <a href="postconf.5.html">main.cf</a>.
 
               <b>unix</b>   The service listens on a UNIX-domain  socket
                      and is accessible for local clients only.
@@ -96,7 +96,7 @@ MASTER(5)                                                            MASTER(5)
                      The  service  name is a pathname relative to
                      the Postfix queue directory  (pathname  con-
                      trolled  with the <b><a href="postconf.5.html#queue_directory">queue_directory</a></b> configura-
-                     tion parameter in main.cf).
+                     tion parameter in <a href="postconf.5.html">main.cf</a>).
 
                      On Solaris systems the <b>unix</b> type  is  imple-
                      mented with streams sockets.
@@ -107,7 +107,7 @@ MASTER(5)                                                            MASTER(5)
                      The service name is a pathname  relative  to
                      the  Postfix  queue directory (pathname con-
                      trolled with the <b><a href="postconf.5.html#queue_directory">queue_directory</a></b>  configura-
-                     tion parameter in main.cf).
+                     tion parameter in <a href="postconf.5.html">main.cf</a>).
 
        <b>Private (default: y)</b>
               Whether  or  not  access  is restricted to the mail
@@ -118,7 +118,7 @@ MASTER(5)                                                            MASTER(5)
               Whether the service runs with root privileges or as
               the owner of the Postfix system (the owner name  is
               controlled by the <b><a href="postconf.5.html#mail_owner">mail_owner</a></b> configuration variable
-              in the main.cf file).
+              in the <a href="postconf.5.html">main.cf</a> file).
 
               The <a href="local.8.html"><b>local</b>(8)</a>,  <a href="pipe.8.html"><b>pipe</b>(8)</a>,  <a href="spawn.8.html"><b>spawn</b>(8)</a>,  and  <a href="virtual.8.html"><b>virtual</b>(8)</a>
               daemons require privileges.
@@ -127,7 +127,7 @@ MASTER(5)                                                            MASTER(5)
               Whether  or  not  the  service runs chrooted to the
               mail queue directory (pathname is controlled by the
               <b><a href="postconf.5.html#queue_directory">queue_directory</a></b>   configuration   variable  in  the
-              main.cf file).
+              <a href="postconf.5.html">main.cf</a> file).
 
               Chroot  should  not  be  used  with  the  <a href="local.8.html"><b>local</b>(8)</a>,
               <a href="pipe.8.html"><b>pipe</b>(8)</a>,    <a href="spawn.8.html"><b>spawn</b>(8)</a>,   and   <a href="virtual.8.html"><b>virtual</b>(8)</a>   daemons.
@@ -136,9 +136,9 @@ MASTER(5)                                                            MASTER(5)
               service in the first place.
 
               The files in the examples/chroot-setup subdirectory
-              of  the  Postfix source archive describe how to set
-              up a Postfix chroot environment for  your  type  of
-              machine,  and  <a href="BASIC_CONFIGURATION_README.html">BASIC_CONFIGURATION_README</a> discusses
+              of the Postfix source archive can be used to set up
+              a Postfix chroot environment on a variety  of  sys-
+              tems.   See   also  <a href="BASIC_CONFIGURATION_README.html">BASIC_CONFIGURATION_README</a>  for
               issues related to running daemons chrooted.
 
        <b>Wake up time (default: 0)</b>
@@ -146,9 +146,9 @@ MASTER(5)                                                            MASTER(5)
               specified  number of seconds. The wake up is imple-
               mented by connecting to the service and  sending  a
               wake  up  request.   A  ? at the end of the wake-up
-              time field requests that wake  up  events  be  sent
-              only  to  services  that  are  actually being used.
-              Specify 0 for no automatic wake up.
+              time field requests that no wake up events be  sent
+              before the service is used.  Specify 0 for no auto-
+              matic wake up.
 
               The <a href="pickup.8.html"><b>pickup</b>(8)</a>, <a href="qmgr.8.html"><b>qmgr</b>(8)</a> and <a href="flush.8.html"><b>flush</b>(8)</a> daemons require
               a wake up timer.
@@ -182,21 +182,21 @@ MASTER(5)                                                            MASTER(5)
 
               <b>-D</b>     Run  the daemon under control by the command
                      specified with the <b><a href="postconf.5.html#debugger_command">debugger_command</a></b> variable
-                     in  the  main.cf  configuration  file.   See
+                     in  the  <a href="postconf.5.html">main.cf</a>  configuration  file.   See
                      <a href="DEBUG_README.html">DEBUG_README</a> for hints and tips.
 
               <b>-o</b> <i>name</i>=<i>value</i>
-                     Override  the  named  main.cf  configuration
+                     Override  the  named  <a href="postconf.5.html">main.cf</a>  configuration
                      parameter.  The parameter value can refer to
                      other parameters as <i>$name</i> etc., just like in
-                     main.cf.  See <a href="postconf.5.html"><b>postconf</b>(5)</a> for syntax.
+                     <a href="postconf.5.html">main.cf</a>.  See <a href="postconf.5.html"><b>postconf</b>(5)</a> for syntax.
 
                      NOTE 1: do not specify whitespace around the
                      "=".  In  parameter  values,  either   avoid
                      whitespace altogether, use commas instead of
                      spaces,  or  consider  overrides  like   "-o
                      name=$override_parameter"     with    $over-
-                     ride_parameter set in main.cf.
+                     ride_parameter set in <a href="postconf.5.html">main.cf</a>.
 
                      NOTE 2: Over-zealous use of parameter  over-
                      rides  makes  the Postfix configuration hard
index dddb6d43aeeadffbfba9d7d1ebcb0d1520e834f7..13cfcb1b77b59d4a81b5f3a263c45c1a51e1cbdc 100644 (file)
@@ -126,16 +126,16 @@ most of the purpose of having that service in the first
 place.
 .sp
 The files in the examples/chroot-setup subdirectory of the
-Postfix source archive describe how to set up a Postfix
-chroot environment for your type of machine, and
-BASIC_CONFIGURATION_README discusses issues related to
-running daemons chrooted.
+Postfix source archive can be used to set up a Postfix
+chroot environment on a variety of systems. See also
+BASIC_CONFIGURATION_README for issues related to running
+daemons chrooted.
 .IP "\fBWake up time (default: 0)\fR"
 Automatically wake up the named service after the specified
 number of seconds. The wake up is implemented by connecting
 to the service and sending a wake up request.  A ? at the
-end of the wake-up time field requests that wake up events
-be sent only to services that are actually being used.
+end of the wake-up time field requests that no wake up
+events be sent before the service is used.
 Specify 0 for no automatic wake up.
 .sp
 The \fBpickup\fR(8), \fBqmgr\fR(8) and \fBflush\fR(8)
index 0b2e53dcb1b1015e3b01873e97bb423cc814a119..b82d770ab79c6d87362b4c0c331cbbc00694dbf5 100644 (file)
@@ -257,10 +257,13 @@ for options.  A typical command looks like this:</p>
 
 <blockquote>
 <pre>
-$ <b>/some/where/dk-filter -p inet:<i>portnumber</i>@localhost ...<i>other options</i>...</b>
+# <b>/some/where/dk-filter -u <i>userid</i> -p inet:<i>portnumber</i>@localhost ...<i>other options</i>...</b>
 </pre>
 </blockquote>
 
+<p> Please specify a <i>userid</i> value that isn't used for other
+applications (not "postfix", not "www", etc.). </p>
+
 <h2><a name="config">Configuring Postfix</a></h2>
 
 <p> Like Sendmail, Postfix has a lot of configuration options that
index 751026072525f16dd72fe6e51b7e03914bb34e11..21ae98b9a9417a3e762ac0c832205e0ed45577eb 100644 (file)
 #      place.
 # .sp
 #      The files in the examples/chroot-setup subdirectory of the
-#      Postfix source archive describe how to set up a Postfix
-#      chroot environment for your type of machine, and
-#      BASIC_CONFIGURATION_README discusses issues related to
-#      running daemons chrooted.
+#      Postfix source archive can be used to set up a Postfix
+#      chroot environment on a variety of systems. See also
+#      BASIC_CONFIGURATION_README for issues related to running
+#      daemons chrooted.
 # .IP "\fBWake up time (default: 0)\fR"
 #      Automatically wake up the named service after the specified
 #      number of seconds. The wake up is implemented by connecting
 #      to the service and sending a wake up request.  A ? at the
-#      end of the wake-up time field requests that wake up events
-#      be sent only to services that are actually being used.
+#      end of the wake-up time field requests that no wake up
+#      events be sent before the service is used.
 #      Specify 0 for no automatic wake up.
 # .sp
 #      The \fBpickup\fR(8), \fBqmgr\fR(8) and \fBflush\fR(8)
index 4c08799b40789836b01f981841257ecec723fb4c..6c865f52bbad5bf0765a6a9ebd7f0569f4661bcb 100644 (file)
 /*     local call-back functions for macro expansion and for queue
 /*     file modification.
 /*
-/*     cleanup_milter_inspect() subjects a message to inspection
-/*     by mail filters. Each filter can accept or reject the message
-/*     and can request changes to the recipient list, to message
-/*     headers, and to replace the message body.
+/*     cleanup_milter_inspect() sends the current message headers
+/*     and body to the mail filters that were received with
+/*     cleanup_milter_receive(), or that are specified with the
+/*     cleanup_milters configuration parameter.
 /*
 /*     cleanup_milter_emul_mail() emulates connect, helo and mail
 /*     events for mail that does not arrive via the smtpd(8) server.
-/*     This pretends that mail arrives from localhost/127.0.0.1
-/*     via ESMTP.  This code reports a server configuration error
-/*     condition when the milter rejects the emulated commands.
+/*     The emulation pretends that mail arrives from localhost/127.0.0.1
+/*     via ESMTP. Milters can reject emulated connect, helo, mail
+/*     or data events, but not emulated rcpt events as described
+/*     next.
 /*
-/*     cleanup_milter_emul_rcpt() emulates an rcpt() event for
-/*     non-SMTP mail. See cleanup_milter_emul_mail() for the
-/*     handling of reject replies.
+/*     cleanup_milter_emul_rcpt() emulates an rcpt event for mail
+/*     that does not arrive via the smtpd(8) server. This reports
+/*     a server configuration error condition when the milter
+/*     rejects an emulated rcpt event.
 /*
-/*     cleanup_milter_emul_data() emulates a data event for non-SMTP
-/*     mail.  See cleanup_milter_emul_mail() for the handling of
-/*     reject replies.
+/*     cleanup_milter_emul_data() emulates a data event for mail
+/*     that does not arrive via the smtpd(8) server.  It's OK for
+/*     milters to reject emulated data events.
 /* SEE ALSO
 /*     milter(3) generic mail filter interface
-/* BUGS
-/*     Postfix prepends its own Received: header when it receives
-/*     mail from outside, or when it forwards mail internally.
-/*     This header is seen by mail filters, and is present when
-/*     mail filters edit the queue file.
 /* DIAGNOSTICS
 /*     Fatal errors: memory allocation problem.
 /*     Panic: interface violation.
-/*     state->errs is updated in case of I/O errors.
+/*     Warnings: I/O errors (state->errs is updated accordingly).
 /* LICENSE
 /* .ad
 /* .fi
@@ -226,14 +223,24 @@ static void cleanup_milter_set_error(CLEANUP_STATE *state, int err)
 
 static const char *cleanup_milter_error(CLEANUP_STATE *state, int err)
 {
+    const char *myname = "cleanup_milter_error";
 
     /*
-     * This error text will be ignored by cleanup_milter_apply(). It exists
-     * only to maintain a consistent error reporting interface to the milter
-     * infrastructure.
+     * For consistency with error reporting within the milter infrastructure,
+     * content manipulation routines return a null pointer on success, and an
+     * SMTP-like response on error.
+     * 
+     * However, when cleanup_milter_apply() receives this error response from
+     * the milter infrastructure, it ignores the text since the appropriate
+     * cleanup error flags were already set by cleanup_milter_set_error().
+     * 
+     * Specify a null error number when the "errno to error flag" mapping was
+     * already done elsewhere, possibly outside this module.
      */
     if (err)
        cleanup_milter_set_error(state, err);
+    else if (CLEANUP_OUT_OK(state))
+       msg_panic("%s: missing errno to error flag mapping", myname);
     return ("451 4.3.0 Server internal error");
 }
 
@@ -404,7 +411,7 @@ static off_t cleanup_find_header(CLEANUP_STATE *state, ssize_t index,
     if ((rec_type = rec_get_raw(state->dst, buf, 0, REC_FLAG_NONE)) < 0) { \
        msg_warn("%s: read file %s: %m", myname, cleanup_path); \
        cleanup_milter_set_error(state, errno); \
-       quit; \
+       do { quit; } while (0); \
     } \
     if (msg_verbose > 1) \
        msg_info("%s: read: %ld: %.*s", myname, (long) curr_offset, \
@@ -1055,7 +1062,8 @@ static const char *cleanup_del_rcpt(void *context, char *rcpt)
      * but to match against the expanded and rewritten recipient address.
      * 
      * XXX Remove the (dsn_orcpt, dsn_notify, orcpt, recip) tuple from the
-     * duplicate recipient filter.
+     * duplicate recipient filter. This requires that we maintain reference
+     * counts.
      */
     if (vstream_fseek(state->dst, 0L, SEEK_SET) < 0) {
        msg_warn("%s: seek file %s: %m", myname, cleanup_path);
index 889481b48721ea09eada3d5c0a6e09428babfede..94189cc2ec6d2f75ac559c0a63c06a2ccacd51bf 100644 (file)
@@ -20,8 +20,8 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20060703"
-#define MAIL_VERSION_NUMBER    "2.3-RC4"
+#define MAIL_RELEASE_DATE      "20060704"
+#define MAIL_VERSION_NUMBER    "2.3-RC5"
 
 #define VAR_MAIL_VERSION       "mail_version"
 #define DEF_MAIL_VERSION       MAIL_VERSION_NUMBER
index 755ecf5c9382e6f968c9b39691d4c1e41f70bf57..fb507c9cfa0ba7ee34dddc22354817498e793966 100644 (file)
@@ -67,7 +67,7 @@ milter:       milter.c $(LIB) $(LIBS)
        mv junk $@.o
 
 test-milter: test-milter.c
-       cc -o $@ $? -lmilter -lpthread
+       cc -g -o $@ $? -lmilter -lpthread
 
 depend: $(MAKES)
        (sed '1,/^# do not edit/!d' Makefile.in; \
index 45f67f459d635bfde6e65f5417ab821d27e41544..ccb833fd69c09c4210175c24161dc9ce49998be3 100644 (file)
@@ -1997,6 +1997,12 @@ static void milter8_body(void *ptr, int rec_type,
      */
     if (msg_verbose > 1)
        msg_info("%s: body milter %s: %.100s", myname, milter->m.name, buf);
+    /* To append \r\n, simply redirect input to another buffer. */
+    if (rec_type == REC_TYPE_NORM && todo == 0) {
+       bp = "\r\n";
+       todo = 2;
+       rec_type = REC_TYPE_EOF;
+    }
     while (todo > 0) {
        /* Append one REC_TYPE_NORM or REC_TYPE_CONT to body chunk buffer. */
        space = MILTER_CHUNK_SIZE - LEN(milter->body);
index a954024fc1af083abf6cf1ba842545dbf6e6ef3d..65c79ede02332519273ff4c4014b89189564c976 100644 (file)
@@ -106,6 +106,8 @@ static char *chg_val;
 
 static int test_reply(SMFICTX *ctx, int code)
 {
+    (void) fflush(stdout);                     /* In case output redirected. */
+
     if (code == SMFIR_REPLYCODE) {
        if (smfi_setreply(ctx, reply_code, reply_dsn, reply_message) != MI_SUCCESS)
            fprintf(stderr, "smfi_setreply failed\n");
@@ -205,7 +207,7 @@ static sfsistat test_body(SMFICTX *ctx, unsigned char *data, size_t data_len)
     if (verbose == 0)
        printf("test_body %ld bytes\n", (long) data_len);
     else
-       printf("%*s", data_len, data);
+       printf("%.*s", data_len, data);
     return (test_reply(ctx, test_body_reply));
 }