]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.6-20081002
authorWietse Venema <wietse@porcupine.org>
Thu, 2 Oct 2008 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:34:08 +0000 (06:34 +0000)
35 files changed:
postfix/HISTORY
postfix/README_FILES/XFORWARD_README
postfix/RELEASE_NOTES
postfix/WISHLIST
postfix/html/XFORWARD_README.html
postfix/proto/XFORWARD_README.html
postfix/src/bounce/Makefile.in
postfix/src/cleanup/Makefile.in
postfix/src/cleanup/cleanup_envelope.c
postfix/src/discard/Makefile.in
postfix/src/global/deliver_request.h
postfix/src/global/mail_open_ok.c
postfix/src/global/mail_proto.h
postfix/src/global/mail_version.h
postfix/src/local/Makefile.in
postfix/src/milter/Makefile.in
postfix/src/oqmgr/Makefile.in
postfix/src/oqmgr/qmgr_deliver.c
postfix/src/oqmgr/qmgr_message.c
postfix/src/oqmgr/qmgr_transport.c
postfix/src/pipe/Makefile.in
postfix/src/qmgr/Makefile.in
postfix/src/qmgr/qmgr_deliver.c
postfix/src/qmgr/qmgr_message.c
postfix/src/qmgr/qmgr_transport.c
postfix/src/qmqpd/qmqpd.c
postfix/src/qmqpd/qmqpd.h
postfix/src/smtp/Makefile.in
postfix/src/smtp/smtp_proto.c
postfix/src/smtpd/smtpd.c
postfix/src/smtpd/smtpd.h
postfix/src/smtpd/smtpd_xforward.c
postfix/src/util/Makefile.in
postfix/src/util/write_buf.c
postfix/src/virtual/Makefile.in

index fe7540a700a7dcb62935a738dd92ebd8c998f9ff..e306ca0e0d5f7770735e0ca6f533f79e556d8733 100644 (file)
@@ -13248,7 +13248,7 @@ Apologies for any names omitted.
        cleanup/cleanup_final.c, cleanup/cleanup_bounce.c,
        cleanup/cleanup_api.c.
 
-20050217
+20070217
 
        Streamline the compile time selection of event handling
        styles, replacing multiple on/off macros by just one
@@ -14642,3 +14642,27 @@ Apologies for any names omitted.
 
        Cleanup: remove obsolete Rhapsody and MacOS targets from
        makedefs.
+
+20080929
+
+       Workaround: don't log "file has 2 links" warnings when the
+       condition appears to be temporary. As kernels have evolved
+       from non-interruptible system calls towards fine-grained
+       locks, the showq command has become likely to observe a
+       file while the queue manager is in the middle of a rename
+       operation, when the file has links to both the old and new
+       name.  File: global/mail_open_ok.c.
+
+       Workaround: don't loop forever when write() fails with a
+       persistent EAGAIN error on a writable file descriptor.
+       File: util/write_buf.c.  
+
+20081002
+
+       Bugfix (introduced Postfix 2.1): the introduction of XFORWARD
+       support resulted in inaccurate logging and (delivery agent)
+       $name expansion. Specifically, Postfix no longer properly
+       distinguished between local submissions and submissions
+       from clients with unknown hostname etc.  attributes.  Files:
+       smtpd/smtpd.c, qmqpd/qmqpd.c, smtp/smtp_proto.c,
+       cleanup/cleanup_envelope.c.
index a9ff30b55c8e0d5a409abc51816a9c47855295a1..d75f4aed5faf0d8443f6b4e5569e7b961b128516 100644 (file)
@@ -32,9 +32,9 @@ In SMTP server EHLO replies, the keyword associated with this extension is
 XFORWARD. The keyword is followed by the names of the attributes that the
 XFORWARD implementation supports.
 
-The client may send the XFORWARD request at any time except in the middle of a
-mail delivery transaction (i.e. between MAIL and RSET or DOT). The command may
-be pipelined when the server supports ESMTP command pipelining.
+The client may send one or more XFORWARD requests at any time except in the
+middle of a mail delivery transaction (i.e. between MAIL and RSET or DOT). The
+command may be pipelined when the server supports ESMTP command pipelining.
 
 The syntax of XFORWARD requests is described below. Upper case and quoted
 strings specify terminals, lowercase strings specify meta terminals, and SP is
@@ -93,12 +93,22 @@ Note 5: Postfix implementations prior to version 2.3 do not xtext encode
 attribute values. Servers that wish to interoperate with these older
 implementations should be prepared to receive unencoded information.
 
-X\bXF\bFO\bOR\bRW\bWA\bAR\bRD\bD S\bSe\ber\brv\bve\ber\br\bre\bes\bsp\bpo\bon\bns\bse\be
+X\bXF\bFO\bOR\bRW\bWA\bAR\bRD\bD S\bSe\ber\brv\bve\ber\bo\bop\bpe\ber\bra\bat\bti\bio\bon\bn
 
-Upon receipt of a correctly formatted XFORWARD command, the server stores the
-specified attribute values, and erases the attributes whose value was specified
-as [UNAVAILABLE]. All XFORWARD attributes are reset to the real client
-information after the MAIL FROM transaction completes (i.e. after RSET or DOT).
+Upon receipt of an initial XFORWARD command, the SMTP server initializes all
+XFORWARD attributes to [UNAVAILABLE]. With each XFORWARD command, the server
+overwrites attributes with the specified attribute values, and erases
+attributes whose value is specified as [UNAVAILABLE]. Attributes that are not
+specified in an XFORWARD command retain their current value.
+
+An ADDR attribute value of [UNAVAILABLE] indicates that the next MAIL FROM
+transaction is a forwarded local submission. In this case the SMTP server
+should ignore other client attributes. This behavior is available with Postfix
+version 2.6.
+
+At the end of the next MAIL FROM transaction (i.e. RSET or DOT), all XFORWARD
+attributes are reset to the real client information, and the SMTP server is
+ready to receive another initial XFORWARD command.
 
 X\bXF\bFO\bOR\bRW\bWA\bAR\bRD\bD S\bSe\ber\brv\bve\ber\br r\bre\bep\bpl\bly\by c\bco\bod\bde\bes\bs
 
index 5cd47296a3b3a1feb2fef925aa5ad128cfdc6afe..a2e153f536a56941801503cd2c4cae115cdeb8a7 100644 (file)
@@ -11,6 +11,22 @@ instead, a new snapshot is released.
 The mail_release_date configuration parameter (format: yyyymmdd)
 specifies the release date of a stable release or snapshot release.
 
+Incompatibility with snapshot 20081002
+======================================
+
+There is a minor change in the way that XFORWARD attributes are
+stored in queue files. These attributes are used to propagate remote
+client information through an SMTP-based content filter. If you
+don't use such filters, then the following incompatibility does not
+affect your system.
+
+If you downgrade from this Postfix version to an older version while
+you still have new local submissions in the mail queue, the older
+Postfix cleanup server may log "spurious null attribute value"
+warnings when it processes queue files from the newer Postfix
+version.  The older cleanup server will ignore the null-valued
+attributes, and no harm will be done.
+
 Incompatibility with snapshot 20080814
 ======================================
 
index e5d993a6f34b6c29d4626d632d58d75964535925..3badd2ce4697d543e11eac5dd7fb74da6e89ad34 100644 (file)
@@ -1,5 +1,5 @@
 Wish list:
-
        Force a panic when the VDA patch reduces the file size limit
        under the message size.  They break the code that marks a
        recipient as "done", when that recipient was added late
index 656e0d8daa907fb7952f1bb4a85ce54a3b89862f..100e8d38bbdf26e8b51dccb3bc52b0e75b224d70 100644 (file)
@@ -55,7 +55,8 @@ of this document.  </p>
 extension is XFORWARD. The keyword is followed by the names of the
 attributes that the XFORWARD implementation supports. </p>
 
-<p> The client may send the XFORWARD request at any time except in
+<p> The client may send one or more XFORWARD requests at any time
+except in
 the middle of a mail delivery transaction (i.e.  between MAIL and
 RSET or DOT).  The command may be pipelined when the server supports
 ESMTP command pipelining.  </p>
@@ -139,13 +140,24 @@ xtext encode attribute values. Servers that wish to interoperate
 with these older implementations should be prepared to receive
 unencoded information. </p>
 
-<h2> XFORWARD Server response </h2>
+<h2> XFORWARD Server operation </h2>
 
-<p> Upon receipt of a correctly formatted XFORWARD command, the
-server stores the specified attribute values, and erases the
-attributes whose value was specified as [UNAVAILABLE]. All XFORWARD
-attributes are reset to the real client information after the MAIL
-FROM transaction completes (i.e. after RSET or DOT). </p>
+<p> Upon receipt of an initial XFORWARD command, the SMTP server
+initializes all XFORWARD attributes to [UNAVAILABLE].  With each
+XFORWARD command, the server overwrites attributes with the specified
+attribute values, and erases attributes whose value is specified
+as [UNAVAILABLE].  Attributes that are not specified in an XFORWARD
+command retain their current value. </p>
+
+<p> An ADDR attribute value of [UNAVAILABLE] indicates that the
+next MAIL FROM transaction is a forwarded local submission.  In
+this case the SMTP server should ignore other client attributes.
+This behavior is available with Postfix version 2.6.  </p>
+
+<p> At the end of the next MAIL FROM transaction (i.e. RSET or DOT),
+all XFORWARD attributes are reset to the real client information,
+and the SMTP server is ready to receive another initial XFORWARD
+command.  </p>
 
 <h2> XFORWARD Server reply codes </h2>
 
index 46dcdac128d4481f982f9a2431b827653cd5401d..da08b80a4fb5a083bc0683f10b777fd23b67a75f 100644 (file)
@@ -55,7 +55,8 @@ of this document.  </p>
 extension is XFORWARD. The keyword is followed by the names of the
 attributes that the XFORWARD implementation supports. </p>
 
-<p> The client may send the XFORWARD request at any time except in
+<p> The client may send one or more XFORWARD requests at any time
+except in
 the middle of a mail delivery transaction (i.e.  between MAIL and
 RSET or DOT).  The command may be pipelined when the server supports
 ESMTP command pipelining.  </p>
@@ -139,13 +140,24 @@ xtext encode attribute values. Servers that wish to interoperate
 with these older implementations should be prepared to receive
 unencoded information. </p>
 
-<h2> XFORWARD Server response </h2>
+<h2> XFORWARD Server operation </h2>
 
-<p> Upon receipt of a correctly formatted XFORWARD command, the
-server stores the specified attribute values, and erases the
-attributes whose value was specified as [UNAVAILABLE]. All XFORWARD
-attributes are reset to the real client information after the MAIL
-FROM transaction completes (i.e. after RSET or DOT). </p>
+<p> Upon receipt of an initial XFORWARD command, the SMTP server
+initializes all XFORWARD attributes to [UNAVAILABLE].  With each
+XFORWARD command, the server overwrites attributes with the specified
+attribute values, and erases attributes whose value is specified
+as [UNAVAILABLE].  Attributes that are not specified in an XFORWARD
+command retain their current value. </p>
+
+<p> An ADDR attribute value of [UNAVAILABLE] indicates that the
+next MAIL FROM transaction is a forwarded local submission.  In
+this case the SMTP server should ignore other client attributes.
+This behavior is available with Postfix version 2.6.  </p>
+
+<p> At the end of the next MAIL FROM transaction (i.e. RSET or DOT),
+all XFORWARD attributes are reset to the real client information,
+and the SMTP server is ready to receive another initial XFORWARD
+command.  </p>
 
 <h2> XFORWARD Server reply codes </h2>
 
index 09de6e9d0ae5b258498f667a702f3837b4b81318..93d484caab592e389f6697378d7fb29f0a7f362e 100644 (file)
@@ -168,9 +168,11 @@ bounce_notify_service.o: ../../include/dsn.h
 bounce_notify_service.o: ../../include/dsn_buf.h
 bounce_notify_service.o: ../../include/dsn_mask.h
 bounce_notify_service.o: ../../include/int_filt.h
+bounce_notify_service.o: ../../include/iostuff.h
 bounce_notify_service.o: ../../include/mail_addr.h
 bounce_notify_service.o: ../../include/mail_error.h
 bounce_notify_service.o: ../../include/mail_params.h
+bounce_notify_service.o: ../../include/mail_proto.h
 bounce_notify_service.o: ../../include/mail_queue.h
 bounce_notify_service.o: ../../include/msg.h
 bounce_notify_service.o: ../../include/msg_stats.h
@@ -232,9 +234,11 @@ bounce_notify_verp.o: ../../include/dsn.h
 bounce_notify_verp.o: ../../include/dsn_buf.h
 bounce_notify_verp.o: ../../include/dsn_mask.h
 bounce_notify_verp.o: ../../include/int_filt.h
+bounce_notify_verp.o: ../../include/iostuff.h
 bounce_notify_verp.o: ../../include/mail_addr.h
 bounce_notify_verp.o: ../../include/mail_error.h
 bounce_notify_verp.o: ../../include/mail_params.h
+bounce_notify_verp.o: ../../include/mail_proto.h
 bounce_notify_verp.o: ../../include/mail_queue.h
 bounce_notify_verp.o: ../../include/msg.h
 bounce_notify_verp.o: ../../include/msg_stats.h
@@ -259,9 +263,11 @@ bounce_one_service.o: ../../include/dsn.h
 bounce_one_service.o: ../../include/dsn_buf.h
 bounce_one_service.o: ../../include/dsn_mask.h
 bounce_one_service.o: ../../include/int_filt.h
+bounce_one_service.o: ../../include/iostuff.h
 bounce_one_service.o: ../../include/mail_addr.h
 bounce_one_service.o: ../../include/mail_error.h
 bounce_one_service.o: ../../include/mail_params.h
+bounce_one_service.o: ../../include/mail_proto.h
 bounce_one_service.o: ../../include/msg.h
 bounce_one_service.o: ../../include/msg_stats.h
 bounce_one_service.o: ../../include/name_mask.h
@@ -315,9 +321,11 @@ bounce_trace_service.o: ../../include/dsn.h
 bounce_trace_service.o: ../../include/dsn_buf.h
 bounce_trace_service.o: ../../include/dsn_mask.h
 bounce_trace_service.o: ../../include/int_filt.h
+bounce_trace_service.o: ../../include/iostuff.h
 bounce_trace_service.o: ../../include/mail_addr.h
 bounce_trace_service.o: ../../include/mail_error.h
 bounce_trace_service.o: ../../include/mail_params.h
+bounce_trace_service.o: ../../include/mail_proto.h
 bounce_trace_service.o: ../../include/mail_queue.h
 bounce_trace_service.o: ../../include/msg.h
 bounce_trace_service.o: ../../include/msg_stats.h
index fa98471aec0908003c7698eab1eb8587125c140b..d2bc00fcfc558fecfb4d02f1edf7ea835b660a5e 100644 (file)
@@ -414,6 +414,7 @@ cleanup_api.o: ../../include/vstring.h
 cleanup_api.o: cleanup.h
 cleanup_api.o: cleanup_api.c
 cleanup_body_edit.o: ../../include/argv.h
+cleanup_body_edit.o: ../../include/attr.h
 cleanup_body_edit.o: ../../include/been_here.h
 cleanup_body_edit.o: ../../include/cleanup_user.h
 cleanup_body_edit.o: ../../include/dict.h
@@ -554,6 +555,7 @@ cleanup_extracted.o: ../../include/vstring.h
 cleanup_extracted.o: cleanup.h
 cleanup_extracted.o: cleanup_extracted.c
 cleanup_final.o: ../../include/argv.h
+cleanup_final.o: ../../include/attr.h
 cleanup_final.o: ../../include/been_here.h
 cleanup_final.o: ../../include/cleanup_user.h
 cleanup_final.o: ../../include/dict.h
@@ -580,6 +582,7 @@ cleanup_final.o: ../../include/vstring.h
 cleanup_final.o: cleanup.h
 cleanup_final.o: cleanup_final.c
 cleanup_init.o: ../../include/argv.h
+cleanup_init.o: ../../include/attr.h
 cleanup_init.o: ../../include/been_here.h
 cleanup_init.o: ../../include/cleanup_user.h
 cleanup_init.o: ../../include/dict.h
@@ -613,6 +616,7 @@ cleanup_init.o: ../../include/vstring.h
 cleanup_init.o: cleanup.h
 cleanup_init.o: cleanup_init.c
 cleanup_map11.o: ../../include/argv.h
+cleanup_map11.o: ../../include/attr.h
 cleanup_map11.o: ../../include/been_here.h
 cleanup_map11.o: ../../include/cleanup_user.h
 cleanup_map11.o: ../../include/dict.h
@@ -641,6 +645,7 @@ cleanup_map11.o: ../../include/vstring.h
 cleanup_map11.o: cleanup.h
 cleanup_map11.o: cleanup_map11.c
 cleanup_map1n.o: ../../include/argv.h
+cleanup_map1n.o: ../../include/attr.h
 cleanup_map1n.o: ../../include/been_here.h
 cleanup_map1n.o: ../../include/cleanup_user.h
 cleanup_map1n.o: ../../include/dict.h
@@ -670,6 +675,7 @@ cleanup_map1n.o: ../../include/vstring.h
 cleanup_map1n.o: cleanup.h
 cleanup_map1n.o: cleanup_map1n.c
 cleanup_masquerade.o: ../../include/argv.h
+cleanup_masquerade.o: ../../include/attr.h
 cleanup_masquerade.o: ../../include/been_here.h
 cleanup_masquerade.o: ../../include/cleanup_user.h
 cleanup_masquerade.o: ../../include/dict.h
@@ -780,6 +786,7 @@ cleanup_milter.o: ../../include/vstring.h
 cleanup_milter.o: cleanup.h
 cleanup_milter.o: cleanup_milter.c
 cleanup_out.o: ../../include/argv.h
+cleanup_out.o: ../../include/attr.h
 cleanup_out.o: ../../include/been_here.h
 cleanup_out.o: ../../include/cleanup_user.h
 cleanup_out.o: ../../include/dict.h
@@ -850,6 +857,7 @@ cleanup_out_recipient.o: ../../include/vstring.h
 cleanup_out_recipient.o: cleanup.h
 cleanup_out_recipient.o: cleanup_out_recipient.c
 cleanup_region.o: ../../include/argv.h
+cleanup_region.o: ../../include/attr.h
 cleanup_region.o: ../../include/been_here.h
 cleanup_region.o: ../../include/cleanup_user.h
 cleanup_region.o: ../../include/dict.h
index b21da3e8572638f1b11ae46bfe63d3e90b7f2da7..2e91df4d0455dacbdb28c1b2d2e437a7897a42c0 100644 (file)
@@ -176,12 +176,14 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type,
            state->errs |= CLEANUP_STAT_BAD;
            return;
        }
+#if 0
        /* Zero-length values are place holders for unavailable values. */
        if (*attr_value == 0) {
            msg_warn("%s: spurious null attribute value for \"%s\" -- ignored",
                     state->queue_id, attr_name);
            return;
        }
+#endif
        if ((junk = rec_attr_map(attr_name)) != 0) {
            mapped_buf = attr_value;
            mapped_type = junk;
@@ -466,7 +468,9 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type,
                return;
            }
        }
-       nvtable_update(state->attr, attr_name, attr_value);
+       /* Zero-length values are place holders for non-existent values. */
+       if (*attr_value)
+           nvtable_update(state->attr, attr_name, attr_value);
        cleanup_out(state, type, buf, len);
        return;
     } else {
index 00a5d5c34a5d6eb336766b64621d5b598b076323..1692de1cf7b7285952c02ff6b8439bbb21d4755a 100644 (file)
@@ -65,6 +65,8 @@ discard.o: ../../include/dsn.h
 discard.o: ../../include/dsn_buf.h
 discard.o: ../../include/dsn_util.h
 discard.o: ../../include/flush_clnt.h
+discard.o: ../../include/iostuff.h
+discard.o: ../../include/mail_proto.h
 discard.o: ../../include/mail_queue.h
 discard.o: ../../include/mail_server.h
 discard.o: ../../include/mail_version.h
index 2c74c00f74f4e201585d6b8fb43823b664c9a997..1d8372e0b14d40918bde330def26831b95b1a8b8 100644 (file)
@@ -53,12 +53,6 @@ typedef struct DELIVER_REQUEST {
     int     dsn_ret;                   /* DSN full/header notification */
 } DELIVER_REQUEST;
 
- /*
-  * Since we can't send null pointers, null strings represent unavailable
-  * attributes instead. They're less likely to explode in our face, too.
-  */
-#define DEL_REQ_ATTR_AVAIL(a)  (*(a))
-
  /*
   * How to deliver, really?
   */
index 8f9ffb25359df67ecb579a074295d41b10d6eb80..31504c58d1d98ac280dd4297379a14ec126d1897 100644 (file)
@@ -59,6 +59,7 @@
 
 #include <sys_defs.h>
 #include <sys/stat.h>
+#include <time.h>
 #include <errno.h>
 
 /* Utility library. */
@@ -102,9 +103,24 @@ int     mail_open_ok(const char *queue_name, const char *queue_id,
     }
     if ((statp->st_mode & S_IRWXU) != MAIL_QUEUE_STAT_READY)
        return (MAIL_OPEN_NO);
+
+    /*
+     * Workaround for spurious "file has 2 links" warnings in showq. As
+     * kernels have evolved from non-interruptible system calls towards
+     * fine-grained locks, the showq command has become likely to observe a
+     * file while the queue manager is in the middle of renaming it, at a
+     * time when the file has links to both the old and new name. We now log
+     * the warning only when the condition appears to be persistent.
+     */
+#define MINUTE_SECONDS 60                      /* XXX should be centralized */
+
     if (statp->st_nlink > 1) {
-       msg_warn("%s: uid %ld: file has %d links", *path,
-                (long) statp->st_uid, (int) statp->st_nlink);
+       if (msg_verbose)
+           msg_info("%s: uid %ld: file has %d links", *path,
+                    (long) statp->st_uid, (int) statp->st_nlink);
+       else if (statp->st_ctime < time((time_t *) 0) - MINUTE_SECONDS)
+           msg_warn("%s: uid %ld: file has %d links", *path,
+                    (long) statp->st_uid, (int) statp->st_nlink);
     }
     return (MAIL_OPEN_YES);
 }
index 4f92c15e514dddd05431cde44c8ff1e06a45f805..82a026ca84a986d0964449a015ae0fb9168bab84 100644 (file)
@@ -190,6 +190,19 @@ extern char *mail_pathname(const char *, const char *);
 #define MAIL_ATTR_ORG_NONE     "unknown"       /* origin unknown */
 #define MAIL_ATTR_ORG_LOCAL    "local" /* local submission */
 
+ /*
+  * Non-existent attribute values are represented as empty strings (e.g. no
+  * remote client, or no HELO hostname). Unknown attribute values are
+  * represented as "unknown" (e.g., unknown remote client hostname). An empty
+  * string is more convenient to send than a null pointer, and is less likely
+  * to blow up.
+  */
+#define MAIL_ATTR_VAL_NONEXIST ""
+#define MAIL_ATTR_VAL_UNKNOWN  "unknown"
+
+#define MAIL_ATTR_IS_EXIST(a)  (*(a))
+#define MAIL_ATTR_IS_KNOWN(a)  (*(a)) && strcmp((a), MAIL_ATTR_VAL_UNKNOWN)
+
  /*
   * XCLIENT/XFORWARD in SMTP.
   */
index 649d7a6645ab23834b1ef5d2cca1f6a1c0fbdd95..27e4c43deccdbc410120c120f9fcd5aaa9c7f040 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20080903"
+#define MAIL_RELEASE_DATE      "20081002"
 #define MAIL_VERSION_NUMBER    "2.6"
 
 #ifdef SNAPSHOT
index 13a2788a1199052c49deb2638d7af47fddcedde9..34cecd2a293736b6021507202d7d55c9fc044d19 100644 (file)
@@ -78,7 +78,9 @@ alias.o: ../../include/dsn_buf.h
 alias.o: ../../include/dsn_mask.h
 alias.o: ../../include/fold_addr.h
 alias.o: ../../include/htable.h
+alias.o: ../../include/iostuff.h
 alias.o: ../../include/mail_params.h
+alias.o: ../../include/mail_proto.h
 alias.o: ../../include/maps.h
 alias.o: ../../include/mbox_conf.h
 alias.o: ../../include/msg.h
@@ -114,9 +116,11 @@ command.o: ../../include/dsn_buf.h
 command.o: ../../include/dsn_util.h
 command.o: ../../include/fold_addr.h
 command.o: ../../include/htable.h
+command.o: ../../include/iostuff.h
 command.o: ../../include/mac_parse.h
 command.o: ../../include/mail_copy.h
 command.o: ../../include/mail_params.h
+command.o: ../../include/mail_proto.h
 command.o: ../../include/maps.h
 command.o: ../../include/mbox_conf.h
 command.o: ../../include/msg.h
@@ -142,6 +146,8 @@ deliver_attr.o: ../../include/dsn.h
 deliver_attr.o: ../../include/dsn_buf.h
 deliver_attr.o: ../../include/fold_addr.h
 deliver_attr.o: ../../include/htable.h
+deliver_attr.o: ../../include/iostuff.h
+deliver_attr.o: ../../include/mail_proto.h
 deliver_attr.o: ../../include/maps.h
 deliver_attr.o: ../../include/mbox_conf.h
 deliver_attr.o: ../../include/msg.h
@@ -174,6 +180,7 @@ dotforward.o: ../../include/mac_expand.h
 dotforward.o: ../../include/mac_parse.h
 dotforward.o: ../../include/mail_conf.h
 dotforward.o: ../../include/mail_params.h
+dotforward.o: ../../include/mail_proto.h
 dotforward.o: ../../include/maps.h
 dotforward.o: ../../include/mbox_conf.h
 dotforward.o: ../../include/msg.h
@@ -207,8 +214,10 @@ file.o: ../../include/dsn_buf.h
 file.o: ../../include/dsn_util.h
 file.o: ../../include/fold_addr.h
 file.o: ../../include/htable.h
+file.o: ../../include/iostuff.h
 file.o: ../../include/mail_copy.h
 file.o: ../../include/mail_params.h
+file.o: ../../include/mail_proto.h
 file.o: ../../include/maps.h
 file.o: ../../include/mbox_conf.h
 file.o: ../../include/mbox_open.h
@@ -279,6 +288,7 @@ include.o: ../../include/fold_addr.h
 include.o: ../../include/htable.h
 include.o: ../../include/iostuff.h
 include.o: ../../include/mail_params.h
+include.o: ../../include/mail_proto.h
 include.o: ../../include/maps.h
 include.o: ../../include/mbox_conf.h
 include.o: ../../include/msg.h
@@ -309,7 +319,9 @@ indirect.o: ../../include/dsn.h
 indirect.o: ../../include/dsn_buf.h
 indirect.o: ../../include/fold_addr.h
 indirect.o: ../../include/htable.h
+indirect.o: ../../include/iostuff.h
 indirect.o: ../../include/mail_params.h
+indirect.o: ../../include/mail_proto.h
 indirect.o: ../../include/maps.h
 indirect.o: ../../include/mbox_conf.h
 indirect.o: ../../include/msg.h
@@ -341,6 +353,7 @@ local.o: ../../include/iostuff.h
 local.o: ../../include/mail_addr.h
 local.o: ../../include/mail_conf.h
 local.o: ../../include/mail_params.h
+local.o: ../../include/mail_proto.h
 local.o: ../../include/mail_server.h
 local.o: ../../include/mail_version.h
 local.o: ../../include/maps.h
@@ -369,9 +382,11 @@ local_expand.o: ../../include/dsn.h
 local_expand.o: ../../include/dsn_buf.h
 local_expand.o: ../../include/fold_addr.h
 local_expand.o: ../../include/htable.h
+local_expand.o: ../../include/iostuff.h
 local_expand.o: ../../include/mac_expand.h
 local_expand.o: ../../include/mac_parse.h
 local_expand.o: ../../include/mail_params.h
+local_expand.o: ../../include/mail_proto.h
 local_expand.o: ../../include/maps.h
 local_expand.o: ../../include/mbox_conf.h
 local_expand.o: ../../include/msg_stats.h
@@ -437,8 +452,10 @@ maildir.o: ../../include/dsn_util.h
 maildir.o: ../../include/fold_addr.h
 maildir.o: ../../include/get_hostname.h
 maildir.o: ../../include/htable.h
+maildir.o: ../../include/iostuff.h
 maildir.o: ../../include/mail_copy.h
 maildir.o: ../../include/mail_params.h
+maildir.o: ../../include/mail_proto.h
 maildir.o: ../../include/make_dirs.h
 maildir.o: ../../include/maps.h
 maildir.o: ../../include/mbox_conf.h
@@ -474,7 +491,9 @@ recipient.o: ../../include/dsn_buf.h
 recipient.o: ../../include/ext_prop.h
 recipient.o: ../../include/fold_addr.h
 recipient.o: ../../include/htable.h
+recipient.o: ../../include/iostuff.h
 recipient.o: ../../include/mail_params.h
+recipient.o: ../../include/mail_proto.h
 recipient.o: ../../include/maps.h
 recipient.o: ../../include/mbox_conf.h
 recipient.o: ../../include/msg.h
@@ -536,7 +555,9 @@ token.o: ../../include/dsn.h
 token.o: ../../include/dsn_buf.h
 token.o: ../../include/fold_addr.h
 token.o: ../../include/htable.h
+token.o: ../../include/iostuff.h
 token.o: ../../include/mail_params.h
+token.o: ../../include/mail_proto.h
 token.o: ../../include/maps.h
 token.o: ../../include/mbox_conf.h
 token.o: ../../include/msg.h
index 8bb27c08abdc6ccb10b21f3df7fb5756926f68dc..c28263a5e55a79d929b6d6ce909bb648adc02b72 100644 (file)
@@ -121,6 +121,7 @@ milter_macros.o: ../../include/argv.h
 milter_macros.o: ../../include/attr.h
 milter_macros.o: ../../include/iostuff.h
 milter_macros.o: ../../include/mail_proto.h
+milter_macros.o: ../../include/msg.h
 milter_macros.o: ../../include/mymalloc.h
 milter_macros.o: ../../include/sys_defs.h
 milter_macros.o: ../../include/vbuf.h
index 979c3caee79e18204f11dc80e7a5e0c7e23d20d1..52caec2618cb9986092e0a9adb1fa54d3f84a5f6 100644 (file)
@@ -97,8 +97,10 @@ qmgr_active.o: ../../include/dsn.h
 qmgr_active.o: ../../include/dsn_buf.h
 qmgr_active.o: ../../include/dsn_mask.h
 qmgr_active.o: ../../include/events.h
+qmgr_active.o: ../../include/iostuff.h
 qmgr_active.o: ../../include/mail_open_ok.h
 qmgr_active.o: ../../include/mail_params.h
+qmgr_active.o: ../../include/mail_proto.h
 qmgr_active.o: ../../include/mail_queue.h
 qmgr_active.o: ../../include/msg.h
 qmgr_active.o: ../../include/msg_stats.h
@@ -120,6 +122,8 @@ qmgr_bounce.o: ../../include/deliver_completed.h
 qmgr_bounce.o: ../../include/deliver_request.h
 qmgr_bounce.o: ../../include/dsn.h
 qmgr_bounce.o: ../../include/dsn_buf.h
+qmgr_bounce.o: ../../include/iostuff.h
+qmgr_bounce.o: ../../include/mail_proto.h
 qmgr_bounce.o: ../../include/msg_stats.h
 qmgr_bounce.o: ../../include/recipient_list.h
 qmgr_bounce.o: ../../include/scan_dir.h
@@ -186,7 +190,9 @@ qmgr_entry.o: ../../include/attr.h
 qmgr_entry.o: ../../include/deliver_request.h
 qmgr_entry.o: ../../include/dsn.h
 qmgr_entry.o: ../../include/events.h
+qmgr_entry.o: ../../include/iostuff.h
 qmgr_entry.o: ../../include/mail_params.h
+qmgr_entry.o: ../../include/mail_proto.h
 qmgr_entry.o: ../../include/msg.h
 qmgr_entry.o: ../../include/msg_stats.h
 qmgr_entry.o: ../../include/mymalloc.h
index 47c75d7eb190559e316aa757949a71e7bc8e5795..0a339aad3f2abced8c714cf52545aae29a1fbcf9 100644 (file)
@@ -26,7 +26,8 @@
 /*     qmgr_deliver() executes when a delivery process announces its
 /*     availability for the named transport. It arranges for delivery
 /*     of a suitable queue entry.  The \fIfp\fR argument specifies a
-/*     stream that is connected to the delivery process. Upon completion
+/*     stream that is connected to the delivery process, or a null
+/*     pointer if the transport accepts no connection. Upon completion
 /*     of delivery (successful or not), the stream is closed, so that the
 /*     delivery process is released.
 /* DIAGNOSTICS
index 4334d86841873f5a6e458970b2c4fb850120f35a..c4e01201383e3b85168f870ba784b8e5c11293ad 100644 (file)
@@ -632,6 +632,9 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
            } else if (strcmp(name, MAIL_ATTR_ACT_HELO_NAME) == 0) {
                if (have_log_client_attr == 0 && message->client_helo == 0)
                    message->client_helo = mystrdup(value);
+           } else if (strcmp(name, MAIL_ATTR_ACT_CLIENT_PORT) == 0) {
+               if (have_log_client_attr == 0 && message->client_port == 0)
+                   message->client_port = mystrdup(value);
            }
            /* Original client attributes. */
            else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_NAME) == 0) {
index aac9dc35c611450e8fbb516c4c6cf976ba84e60f..8006873eca6d5c753dd58c48d3755ffcaf54c90e 100644 (file)
@@ -337,7 +337,8 @@ void    qmgr_transport_alloc(QMGR_TRANSPORT *transport, QMGR_TRANSPORT_ALLOC_NOT
     transport->pending += 1;
     if ((alloc->stream = mail_connect(MAIL_CLASS_PRIVATE, transport->name,
                                      NON_BLOCKING)) == 0) {
-       msg_warn("connect to transport %s: %m", transport->name);
+       msg_warn("connect to transport %s/%s: %m",
+                MAIL_CLASS_PRIVATE, transport->name);
        event_request_timer(qmgr_transport_event, (char *) alloc, 0);
        return;
     }
index 6a10d5ff62fc0a1c786cd96f206af2d160279e77..2d2cfc4a88b8ace8fd8c264d9067c1b58d41a541 100644 (file)
@@ -78,6 +78,7 @@ pipe.o: ../../include/mail_addr.h
 pipe.o: ../../include/mail_conf.h
 pipe.o: ../../include/mail_copy.h
 pipe.o: ../../include/mail_params.h
+pipe.o: ../../include/mail_proto.h
 pipe.o: ../../include/mail_server.h
 pipe.o: ../../include/mail_version.h
 pipe.o: ../../include/msg.h
index c1a7f20519e5f39f48c90e4174d032ef692cff82..352668bff4d933390b3ab1e6baf2bbedac36de54 100644 (file)
@@ -99,8 +99,10 @@ qmgr_active.o: ../../include/dsn.h
 qmgr_active.o: ../../include/dsn_buf.h
 qmgr_active.o: ../../include/dsn_mask.h
 qmgr_active.o: ../../include/events.h
+qmgr_active.o: ../../include/iostuff.h
 qmgr_active.o: ../../include/mail_open_ok.h
 qmgr_active.o: ../../include/mail_params.h
+qmgr_active.o: ../../include/mail_proto.h
 qmgr_active.o: ../../include/mail_queue.h
 qmgr_active.o: ../../include/msg.h
 qmgr_active.o: ../../include/msg_stats.h
@@ -122,6 +124,8 @@ qmgr_bounce.o: ../../include/deliver_completed.h
 qmgr_bounce.o: ../../include/deliver_request.h
 qmgr_bounce.o: ../../include/dsn.h
 qmgr_bounce.o: ../../include/dsn_buf.h
+qmgr_bounce.o: ../../include/iostuff.h
+qmgr_bounce.o: ../../include/mail_proto.h
 qmgr_bounce.o: ../../include/msg_stats.h
 qmgr_bounce.o: ../../include/recipient_list.h
 qmgr_bounce.o: ../../include/scan_dir.h
@@ -188,7 +192,9 @@ qmgr_entry.o: ../../include/attr.h
 qmgr_entry.o: ../../include/deliver_request.h
 qmgr_entry.o: ../../include/dsn.h
 qmgr_entry.o: ../../include/events.h
+qmgr_entry.o: ../../include/iostuff.h
 qmgr_entry.o: ../../include/mail_params.h
+qmgr_entry.o: ../../include/mail_proto.h
 qmgr_entry.o: ../../include/msg.h
 qmgr_entry.o: ../../include/msg_stats.h
 qmgr_entry.o: ../../include/mymalloc.h
index 668c92449603f3f94d6de4091bc049c78db4352e..811e1233cb77d8e9a10b92abdad77acb5b2b92f1 100644 (file)
@@ -26,7 +26,8 @@
 /*     qmgr_deliver() executes when a delivery process announces its
 /*     availability for the named transport. It arranges for delivery
 /*     of a suitable queue entry.  The \fIfp\fR argument specifies a
-/*     stream that is connected to the delivery process. Upon completion
+/*     stream that is connected to a delivery process, or a null
+/*     pointer if the transport accepts no connection. Upon completion
 /*     of delivery (successful or not), the stream is closed, so that the
 /*     delivery process is released.
 /* DIAGNOSTICS
index f683fe0aac611713f0d31433bba07650ac48b995..5fd73e924918bdfda9349e01cdd9568ff3b4d887 100644 (file)
@@ -673,6 +673,9 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
            } else if (strcmp(name, MAIL_ATTR_ACT_HELO_NAME) == 0) {
                if (have_log_client_attr == 0 && message->client_helo == 0)
                    message->client_helo = mystrdup(value);
+           } else if (strcmp(name, MAIL_ATTR_ACT_CLIENT_PORT) == 0) {
+               if (have_log_client_attr == 0 && message->client_port == 0)
+                   message->client_port = mystrdup(value);
            }
            /* Original client attributes. */
            else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_NAME) == 0) {
index 1265c6f0ccf162d345286405d5038a01d3c3df5b..29a1f53e1ce9f12b093ea042c92494cb382060d0 100644 (file)
@@ -342,7 +342,8 @@ void    qmgr_transport_alloc(QMGR_TRANSPORT *transport, QMGR_TRANSPORT_ALLOC_NOT
     transport->pending += 1;
     if ((alloc->stream = mail_connect(MAIL_CLASS_PRIVATE, transport->name,
                                      NON_BLOCKING)) == 0) {
-       msg_warn("connect to transport %s: %m", transport->name);
+       msg_warn("connect to transport %s/%s: %m",
+                MAIL_CLASS_PRIVATE, transport->name);
        event_request_timer(qmgr_transport_event, (char *) alloc, 0);
        return;
     }
@@ -390,7 +391,7 @@ QMGR_TRANSPORT *qmgr_transport_create(const char *name)
        get_mail_conf_int2(name, _INIT_DEST_CON,
                           var_init_dest_concurrency, 1, 0);
     transport->rate_delay = get_mail_conf_time2(name, _DEST_RATE_DELAY,
-                                               var_dest_rate_delay, 
+                                               var_dest_rate_delay,
                                                's', 0, 0);
 
     if (transport->rate_delay > 0)
index a6b5e66f47d3c3a4a27f798ff0e8989412c85549..0ee036cd0eaebbb90305670cb9203e615b2d0886 100644 (file)
@@ -317,24 +317,6 @@ static void qmqpd_copy_sender(QMQPD_STATE *state)
 static void qmqpd_write_attributes(QMQPD_STATE *state)
 {
 
-    /*
-     * Logging attributes, also used for XFORWARD.
-     */
-    if (IS_AVAIL_CLIENT_NAME(state->name))
-       rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
-                   MAIL_ATTR_LOG_CLIENT_NAME, state->name);
-    if (IS_AVAIL_CLIENT_ADDR(state->addr))
-       rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
-                   MAIL_ATTR_LOG_CLIENT_ADDR, state->rfc_addr);
-    if (IS_AVAIL_CLIENT_PORT(state->port))
-       rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
-                   MAIL_ATTR_LOG_CLIENT_PORT, state->port);
-    if (IS_AVAIL_CLIENT_NAMADDR(state->namaddr))
-       rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
-                   MAIL_ATTR_LOG_ORIGIN, state->namaddr);
-    rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
-               MAIL_ATTR_LOG_PROTO_NAME, state->protocol);
-
     /*
      * Provenance attributes for Milter policy etc.
      */
index 86e98efaa6e1d267a0d466f7f7e90b54362d2e52..aad185b777ffae3a6ce5e4172537c1ce39989969 100644 (file)
@@ -64,13 +64,6 @@ typedef struct {
 #define CLIENT_PORT_UNKNOWN    CLIENT_ATTR_UNKNOWN
 #define CLIENT_NAMADDR_UNKNOWN CLIENT_ATTR_UNKNOWN
 
-#define IS_AVAIL_CLIENT_ATTR(v)        ((v) && strcmp((v), CLIENT_ATTR_UNKNOWN))
-
-#define IS_AVAIL_CLIENT_NAME(v)        IS_AVAIL_CLIENT_ATTR(v)
-#define IS_AVAIL_CLIENT_ADDR(v)        IS_AVAIL_CLIENT_ATTR(v)
-#define IS_AVAIL_CLIENT_PORT(v)        IS_AVAIL_CLIENT_ATTR(v)
-#define IS_AVAIL_CLIENT_NAMADDR(v) IS_AVAIL_CLIENT_ATTR(v)
-
  /*
   * QMQP protocol status codes.
   */
index f5ae8f07f976542a6234380401ebcbfc61f90ad6..c4629dd1a21f2134d4d8c59c483e331263bfb43d 100644 (file)
@@ -100,8 +100,10 @@ smtp.o: ../../include/flush_clnt.h
 smtp.o: ../../include/header_body_checks.h
 smtp.o: ../../include/header_opts.h
 smtp.o: ../../include/htable.h
+smtp.o: ../../include/iostuff.h
 smtp.o: ../../include/mail_conf.h
 smtp.o: ../../include/mail_params.h
+smtp.o: ../../include/mail_proto.h
 smtp.o: ../../include/mail_server.h
 smtp.o: ../../include/mail_version.h
 smtp.o: ../../include/maps.h
@@ -141,7 +143,9 @@ smtp_addr.o: ../../include/header_opts.h
 smtp_addr.o: ../../include/htable.h
 smtp_addr.o: ../../include/inet_addr_list.h
 smtp_addr.o: ../../include/inet_proto.h
+smtp_addr.o: ../../include/iostuff.h
 smtp_addr.o: ../../include/mail_params.h
+smtp_addr.o: ../../include/mail_proto.h
 smtp_addr.o: ../../include/maps.h
 smtp_addr.o: ../../include/match_list.h
 smtp_addr.o: ../../include/match_ops.h
@@ -151,6 +155,7 @@ smtp_addr.o: ../../include/msg_stats.h
 smtp_addr.o: ../../include/myaddrinfo.h
 smtp_addr.o: ../../include/mymalloc.h
 smtp_addr.o: ../../include/name_code.h
+smtp_addr.o: ../../include/name_mask.h
 smtp_addr.o: ../../include/own_inet_addr.h
 smtp_addr.o: ../../include/recipient_list.h
 smtp_addr.o: ../../include/resolve_clnt.h
@@ -179,10 +184,12 @@ smtp_chat.o: ../../include/header_body_checks.h
 smtp_chat.o: ../../include/header_opts.h
 smtp_chat.o: ../../include/htable.h
 smtp_chat.o: ../../include/int_filt.h
+smtp_chat.o: ../../include/iostuff.h
 smtp_chat.o: ../../include/line_wrap.h
 smtp_chat.o: ../../include/mail_addr.h
 smtp_chat.o: ../../include/mail_error.h
 smtp_chat.o: ../../include/mail_params.h
+smtp_chat.o: ../../include/mail_proto.h
 smtp_chat.o: ../../include/maps.h
 smtp_chat.o: ../../include/match_list.h
 smtp_chat.o: ../../include/match_ops.h
@@ -263,7 +270,9 @@ smtp_map11.o: ../../include/dsn_buf.h
 smtp_map11.o: ../../include/header_body_checks.h
 smtp_map11.o: ../../include/header_opts.h
 smtp_map11.o: ../../include/htable.h
+smtp_map11.o: ../../include/iostuff.h
 smtp_map11.o: ../../include/mail_addr_map.h
+smtp_map11.o: ../../include/mail_proto.h
 smtp_map11.o: ../../include/maps.h
 smtp_map11.o: ../../include/match_list.h
 smtp_map11.o: ../../include/match_ops.h
@@ -271,6 +280,7 @@ smtp_map11.o: ../../include/mime_state.h
 smtp_map11.o: ../../include/msg.h
 smtp_map11.o: ../../include/msg_stats.h
 smtp_map11.o: ../../include/name_code.h
+smtp_map11.o: ../../include/name_mask.h
 smtp_map11.o: ../../include/quote_822_local.h
 smtp_map11.o: ../../include/quote_flags.h
 smtp_map11.o: ../../include/recipient_list.h
@@ -353,6 +363,8 @@ smtp_rcpt.o: ../../include/dsn_mask.h
 smtp_rcpt.o: ../../include/header_body_checks.h
 smtp_rcpt.o: ../../include/header_opts.h
 smtp_rcpt.o: ../../include/htable.h
+smtp_rcpt.o: ../../include/iostuff.h
+smtp_rcpt.o: ../../include/mail_proto.h
 smtp_rcpt.o: ../../include/maps.h
 smtp_rcpt.o: ../../include/match_list.h
 smtp_rcpt.o: ../../include/match_ops.h
@@ -361,6 +373,7 @@ smtp_rcpt.o: ../../include/msg.h
 smtp_rcpt.o: ../../include/msg_stats.h
 smtp_rcpt.o: ../../include/mymalloc.h
 smtp_rcpt.o: ../../include/name_code.h
+smtp_rcpt.o: ../../include/name_mask.h
 smtp_rcpt.o: ../../include/recipient_list.h
 smtp_rcpt.o: ../../include/resolve_clnt.h
 smtp_rcpt.o: ../../include/scache.h
@@ -384,7 +397,9 @@ smtp_reuse.o: ../../include/dsn_buf.h
 smtp_reuse.o: ../../include/header_body_checks.h
 smtp_reuse.o: ../../include/header_opts.h
 smtp_reuse.o: ../../include/htable.h
+smtp_reuse.o: ../../include/iostuff.h
 smtp_reuse.o: ../../include/mail_params.h
+smtp_reuse.o: ../../include/mail_proto.h
 smtp_reuse.o: ../../include/maps.h
 smtp_reuse.o: ../../include/match_list.h
 smtp_reuse.o: ../../include/match_ops.h
@@ -393,6 +408,7 @@ smtp_reuse.o: ../../include/msg.h
 smtp_reuse.o: ../../include/msg_stats.h
 smtp_reuse.o: ../../include/mymalloc.h
 smtp_reuse.o: ../../include/name_code.h
+smtp_reuse.o: ../../include/name_mask.h
 smtp_reuse.o: ../../include/recipient_list.h
 smtp_reuse.o: ../../include/resolve_clnt.h
 smtp_reuse.o: ../../include/scache.h
@@ -419,6 +435,8 @@ smtp_sasl_auth_cache.o: ../../include/dsn_util.h
 smtp_sasl_auth_cache.o: ../../include/header_body_checks.h
 smtp_sasl_auth_cache.o: ../../include/header_opts.h
 smtp_sasl_auth_cache.o: ../../include/htable.h
+smtp_sasl_auth_cache.o: ../../include/iostuff.h
+smtp_sasl_auth_cache.o: ../../include/mail_proto.h
 smtp_sasl_auth_cache.o: ../../include/maps.h
 smtp_sasl_auth_cache.o: ../../include/match_list.h
 smtp_sasl_auth_cache.o: ../../include/match_ops.h
@@ -427,6 +445,7 @@ smtp_sasl_auth_cache.o: ../../include/msg.h
 smtp_sasl_auth_cache.o: ../../include/msg_stats.h
 smtp_sasl_auth_cache.o: ../../include/mymalloc.h
 smtp_sasl_auth_cache.o: ../../include/name_code.h
+smtp_sasl_auth_cache.o: ../../include/name_mask.h
 smtp_sasl_auth_cache.o: ../../include/recipient_list.h
 smtp_sasl_auth_cache.o: ../../include/resolve_clnt.h
 smtp_sasl_auth_cache.o: ../../include/scache.h
@@ -450,8 +469,10 @@ smtp_sasl_glue.o: ../../include/dsn_buf.h
 smtp_sasl_glue.o: ../../include/header_body_checks.h
 smtp_sasl_glue.o: ../../include/header_opts.h
 smtp_sasl_glue.o: ../../include/htable.h
+smtp_sasl_glue.o: ../../include/iostuff.h
 smtp_sasl_glue.o: ../../include/mail_addr_find.h
 smtp_sasl_glue.o: ../../include/mail_params.h
+smtp_sasl_glue.o: ../../include/mail_proto.h
 smtp_sasl_glue.o: ../../include/maps.h
 smtp_sasl_glue.o: ../../include/match_list.h
 smtp_sasl_glue.o: ../../include/match_ops.h
@@ -460,6 +481,7 @@ smtp_sasl_glue.o: ../../include/msg.h
 smtp_sasl_glue.o: ../../include/msg_stats.h
 smtp_sasl_glue.o: ../../include/mymalloc.h
 smtp_sasl_glue.o: ../../include/name_code.h
+smtp_sasl_glue.o: ../../include/name_mask.h
 smtp_sasl_glue.o: ../../include/recipient_list.h
 smtp_sasl_glue.o: ../../include/resolve_clnt.h
 smtp_sasl_glue.o: ../../include/scache.h
@@ -486,7 +508,9 @@ smtp_sasl_proto.o: ../../include/dsn_buf.h
 smtp_sasl_proto.o: ../../include/header_body_checks.h
 smtp_sasl_proto.o: ../../include/header_opts.h
 smtp_sasl_proto.o: ../../include/htable.h
+smtp_sasl_proto.o: ../../include/iostuff.h
 smtp_sasl_proto.o: ../../include/mail_params.h
+smtp_sasl_proto.o: ../../include/mail_proto.h
 smtp_sasl_proto.o: ../../include/maps.h
 smtp_sasl_proto.o: ../../include/match_list.h
 smtp_sasl_proto.o: ../../include/match_ops.h
@@ -495,6 +519,7 @@ smtp_sasl_proto.o: ../../include/msg.h
 smtp_sasl_proto.o: ../../include/msg_stats.h
 smtp_sasl_proto.o: ../../include/mymalloc.h
 smtp_sasl_proto.o: ../../include/name_code.h
+smtp_sasl_proto.o: ../../include/name_mask.h
 smtp_sasl_proto.o: ../../include/recipient_list.h
 smtp_sasl_proto.o: ../../include/resolve_clnt.h
 smtp_sasl_proto.o: ../../include/scache.h
@@ -519,7 +544,9 @@ smtp_session.o: ../../include/dsn_buf.h
 smtp_session.o: ../../include/header_body_checks.h
 smtp_session.o: ../../include/header_opts.h
 smtp_session.o: ../../include/htable.h
+smtp_session.o: ../../include/iostuff.h
 smtp_session.o: ../../include/mail_params.h
+smtp_session.o: ../../include/mail_proto.h
 smtp_session.o: ../../include/maps.h
 smtp_session.o: ../../include/match_list.h
 smtp_session.o: ../../include/match_ops.h
@@ -528,6 +555,7 @@ smtp_session.o: ../../include/msg.h
 smtp_session.o: ../../include/msg_stats.h
 smtp_session.o: ../../include/mymalloc.h
 smtp_session.o: ../../include/name_code.h
+smtp_session.o: ../../include/name_mask.h
 smtp_session.o: ../../include/recipient_list.h
 smtp_session.o: ../../include/resolve_clnt.h
 smtp_session.o: ../../include/scache.h
@@ -552,7 +580,9 @@ smtp_state.o: ../../include/dsn_buf.h
 smtp_state.o: ../../include/header_body_checks.h
 smtp_state.o: ../../include/header_opts.h
 smtp_state.o: ../../include/htable.h
+smtp_state.o: ../../include/iostuff.h
 smtp_state.o: ../../include/mail_params.h
+smtp_state.o: ../../include/mail_proto.h
 smtp_state.o: ../../include/maps.h
 smtp_state.o: ../../include/match_list.h
 smtp_state.o: ../../include/match_ops.h
@@ -561,6 +591,7 @@ smtp_state.o: ../../include/msg.h
 smtp_state.o: ../../include/msg_stats.h
 smtp_state.o: ../../include/mymalloc.h
 smtp_state.o: ../../include/name_code.h
+smtp_state.o: ../../include/name_mask.h
 smtp_state.o: ../../include/recipient_list.h
 smtp_state.o: ../../include/resolve_clnt.h
 smtp_state.o: ../../include/scache.h
@@ -586,7 +617,9 @@ smtp_trouble.o: ../../include/dsn_buf.h
 smtp_trouble.o: ../../include/header_body_checks.h
 smtp_trouble.o: ../../include/header_opts.h
 smtp_trouble.o: ../../include/htable.h
+smtp_trouble.o: ../../include/iostuff.h
 smtp_trouble.o: ../../include/mail_error.h
+smtp_trouble.o: ../../include/mail_proto.h
 smtp_trouble.o: ../../include/maps.h
 smtp_trouble.o: ../../include/match_list.h
 smtp_trouble.o: ../../include/match_ops.h
@@ -619,6 +652,8 @@ smtp_unalias.o: ../../include/dsn_buf.h
 smtp_unalias.o: ../../include/header_body_checks.h
 smtp_unalias.o: ../../include/header_opts.h
 smtp_unalias.o: ../../include/htable.h
+smtp_unalias.o: ../../include/iostuff.h
+smtp_unalias.o: ../../include/mail_proto.h
 smtp_unalias.o: ../../include/maps.h
 smtp_unalias.o: ../../include/match_list.h
 smtp_unalias.o: ../../include/match_ops.h
@@ -627,6 +662,7 @@ smtp_unalias.o: ../../include/msg.h
 smtp_unalias.o: ../../include/msg_stats.h
 smtp_unalias.o: ../../include/myaddrinfo.h
 smtp_unalias.o: ../../include/name_code.h
+smtp_unalias.o: ../../include/name_mask.h
 smtp_unalias.o: ../../include/recipient_list.h
 smtp_unalias.o: ../../include/resolve_clnt.h
 smtp_unalias.o: ../../include/scache.h
index ed40eff5b25863dec88f8217889ab0c8dc26c8a1..e00ef64541a573769a1846350b0c6aa9c1f7d876 100644 (file)
@@ -1224,19 +1224,19 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state,
            if (session->features & SMTP_FEATURE_XFORWARD_NAME) {
                vstring_strcat(next_command, " " XFORWARD_NAME "=");
                xtext_quote_append(next_command,
-                                  DEL_REQ_ATTR_AVAIL(request->client_name) ?
+                                  MAIL_ATTR_IS_KNOWN(request->client_name) ?
                           request->client_name : XFORWARD_UNAVAILABLE, "");
            }
            if (session->features & SMTP_FEATURE_XFORWARD_ADDR) {
                vstring_strcat(next_command, " " XFORWARD_ADDR "=");
                xtext_quote_append(next_command,
-                                  DEL_REQ_ATTR_AVAIL(request->client_addr) ?
+                                  MAIL_ATTR_IS_KNOWN(request->client_addr) ?
                           request->client_addr : XFORWARD_UNAVAILABLE, "");
            }
            if (session->features & SMTP_FEATURE_XFORWARD_PORT) {
                vstring_strcat(next_command, " " XFORWARD_PORT "=");
                xtext_quote_append(next_command,
-                                  DEL_REQ_ATTR_AVAIL(request->client_port) ?
+                                  MAIL_ATTR_IS_KNOWN(request->client_port) ?
                           request->client_port : XFORWARD_UNAVAILABLE, "");
            }
            if (session->send_proto_helo)
@@ -1250,19 +1250,19 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state,
            if (session->features & SMTP_FEATURE_XFORWARD_PROTO) {
                vstring_strcat(next_command, " " XFORWARD_PROTO "=");
                xtext_quote_append(next_command,
-                                DEL_REQ_ATTR_AVAIL(request->client_proto) ?
+                                MAIL_ATTR_IS_KNOWN(request->client_proto) ?
                          request->client_proto : XFORWARD_UNAVAILABLE, "");
            }
            if (session->features & SMTP_FEATURE_XFORWARD_HELO) {
                vstring_strcat(next_command, " " XFORWARD_HELO "=");
                xtext_quote_append(next_command,
-                                  DEL_REQ_ATTR_AVAIL(request->client_helo) ?
+                                  MAIL_ATTR_IS_EXIST(request->client_helo) ?
                           request->client_helo : XFORWARD_UNAVAILABLE, "");
            }
            if (session->features & SMTP_FEATURE_XFORWARD_DOMAIN) {
                vstring_strcat(next_command, " " XFORWARD_DOMAIN "=");
                xtext_quote_append(next_command,
-                        DEL_REQ_ATTR_AVAIL(request->rewrite_context) == 0 ?
+                        MAIL_ATTR_IS_EXIST(request->rewrite_context) == 0 ?
                                   XFORWARD_UNAVAILABLE :
                     strcmp(request->rewrite_context, MAIL_ATTR_RWR_LOCAL) ?
                              XFORWARD_DOM_REMOTE : XFORWARD_DOM_LOCAL, "");
@@ -1931,21 +1931,17 @@ int     smtp_xfer(SMTP_STATE *state)
     }
 
     /*
-     * Use the XFORWARD command to forward client attributes only when a
-     * minimal amount of information is available.
+     * Use the XFORWARD command to send local/remote submission information.
      */
     send_name_addr =
        var_smtp_send_xforward
-       && (((session->features & SMTP_FEATURE_XFORWARD_NAME)
-            && DEL_REQ_ATTR_AVAIL(request->client_name))
-           || ((session->features & SMTP_FEATURE_XFORWARD_ADDR)
-               && DEL_REQ_ATTR_AVAIL(request->client_addr)));
+       && (session->features & (SMTP_FEATURE_XFORWARD_NAME
+                                | SMTP_FEATURE_XFORWARD_ADDR));
     session->send_proto_helo =
        var_smtp_send_xforward
-       && (((session->features & SMTP_FEATURE_XFORWARD_PROTO)
-            && DEL_REQ_ATTR_AVAIL(request->client_proto))
-           || ((session->features & SMTP_FEATURE_XFORWARD_HELO)
-               && DEL_REQ_ATTR_AVAIL(request->client_helo)));
+       && (session->features & (SMTP_FEATURE_XFORWARD_PROTO
+                                | SMTP_FEATURE_XFORWARD_HELO
+                                | SMTP_FEATURE_XFORWARD_DOMAIN));
     if (send_name_addr)
        recv_state = send_state = SMTP_STATE_XFORWARD_NAME_ADDR;
     else if (session->send_proto_helo)
index 4080bcb8e4ea953a6e44d88fae46ca0c5d55916f..de017cf8eedd838b5e2a3fdae659a5967432dcef 100644 (file)
@@ -1754,26 +1754,37 @@ static int mail_open_stream(SMTPD_STATE *state)
        if (SMTPD_STAND_ALONE(state) == 0) {
 
            /*
-            * Attributes for logging, also used for XFORWARD.
+            * Forwarded client attributes.
+            * 
+            * In the case of a forwarded remote submission, store original
+            * client attributes in our own internal representation: either
+            * actual values or "unknown"; don't bother with storing
+            * non-existent HELO attributes.
+            * 
+            * In the case of a forwarded local submission, specify explicitly
+            * that the original client attributes are non-existent.
             */
-           if (IS_AVAIL_CLIENT_NAME(FORWARD_NAME(state)))
-               rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
+           if (state->xforward.flags & SMTPD_STATE_XFORWARD_CLIENT_MASK) {
+               if (MAIL_ATTR_IS_KNOWN(FORWARD_ADDR(state))) {
+                   rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
                            MAIL_ATTR_LOG_CLIENT_NAME, FORWARD_NAME(state));
-           if (IS_AVAIL_CLIENT_ADDR(FORWARD_ADDR(state)))
-               rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
+                   rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
                            MAIL_ATTR_LOG_CLIENT_ADDR, FORWARD_ADDR(state));
-           if (IS_AVAIL_CLIENT_PORT(FORWARD_PORT(state)))
-               rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
+                   rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
                            MAIL_ATTR_LOG_CLIENT_PORT, FORWARD_PORT(state));
-           if (IS_AVAIL_CLIENT_NAMADDR(FORWARD_NAMADDR(state)))
-               rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
-                           MAIL_ATTR_LOG_ORIGIN, FORWARD_NAMADDR(state));
-           if (IS_AVAIL_CLIENT_HELO(FORWARD_HELO(state)))
-               rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
-                           MAIL_ATTR_LOG_HELO_NAME, FORWARD_HELO(state));
-           if (IS_AVAIL_CLIENT_PROTO(FORWARD_PROTO(state)))
-               rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
+                   rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
+                             MAIL_ATTR_LOG_ORIGIN, FORWARD_NAMADDR(state));
+                   if (FORWARD_HELO(state))
+                       rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
+                             MAIL_ATTR_LOG_HELO_NAME, FORWARD_HELO(state));
+                   rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
                            MAIL_ATTR_LOG_PROTO_NAME, FORWARD_PROTO(state));
+               } else {
+                   /* Local submission. */
+                   rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
+                        MAIL_ATTR_LOG_CLIENT_ADDR, MAIL_ATTR_VAL_NONEXIST);
+               }
+           }
 
            /*
             * Attributes with actual client information. These are used by
index bc3aa25c69afb406aae7f7fb26e0affe2f80c180..f00d0785242f82a6d4597a0a7bc657a027fc7640 100644 (file)
@@ -292,13 +292,14 @@ extern void smtpd_peer_reset(SMTPD_STATE *state);
   * 
   * Note 1: inside the SMTP server, forwarded attributes must have the exact
   * same representation as normal attributes: unknown string values are
-  * "unknown", except for HELO which defaults to null. This is better than
-  * having to change every piece of code that accesses a possibly forwarded
-  * attribute.
+  * "unknown", and non-existent HELO is null.
   * 
-  * Note 2: outside the SMTP server, the representation of unknown/known
-  * attribute values is different in queue files, in queue manager delivery
-  * requests, and in over-the-network XFORWARD commands.
+  * Note 2: the SMTP server representation of unknown/known attribute values is
+  * also used in queue files and in delivery requests, while non-existent
+  * information is represented in those contexts as empty strings. In queue
+  * files and delivery requests, forwarded local submissions are represented
+  * by forwarded client attributes with empty string values (actually one
+  * attribute is sufficient).
   * 
   * Note 3: if forwarding client information, don't mix information from the
   * current SMTP session with forwarded information from an up-stream
index 977640946bbc024ec184e1b37afbf77b93df94cd..4ae89f96980e1e0387820e5d44c38ab977bf70a4 100644 (file)
@@ -9,6 +9,9 @@
 /*     void    smtpd_xforward_init(state)
 /*     SMTPD_STATE *state;
 /*
+/*     void    smtpd_xforward_preset(state)
+/*     SMTPD_STATE *state;
+/*
 /*     void    smtpd_xforward_reset(state)
 /*     SMTPD_STATE *state;
 /* DESCRIPTION
index 11dff3e49df8f55bf869c359b75e4122a4e1f0b2..1b28c324f9ad69c23a1d5589561a7fbac38fe32f 100644 (file)
@@ -1356,6 +1356,7 @@ safe_getenv.o: sys_defs.h
 safe_open.o: msg.h
 safe_open.o: safe_open.c
 safe_open.o: safe_open.h
+safe_open.o: stringops.h
 safe_open.o: sys_defs.h
 safe_open.o: vbuf.h
 safe_open.o: vstream.h
index 7674095da02c533e0f7302d08924ebf3b59e7685..968a468acf5398993aa6d69dcde83f7e053e5399 100644 (file)
@@ -46,6 +46,7 @@
 #include <sys_defs.h>
 #include <unistd.h>
 #include <errno.h>
+#include <time.h>
 
 /* Utility library. */
 
@@ -58,21 +59,31 @@ ssize_t write_buf(int fd, const char *buf, ssize_t len, int timeout)
 {
     const char *start = buf;
     ssize_t count;
+    time_t  expire;
+    int     time_left = timeout;
+
+    if (time_left > 0)
+       expire = time((time_t *) 0) + time_left;
 
     while (len > 0) {
-       if (timeout > 0 && write_wait(fd, timeout) < 0)
+       if (time_left > 0 && write_wait(fd, time_left) < 0)
            return (-1);
        if ((count = write(fd, buf, len)) < 0) {
-           if (errno == EAGAIN && timeout > 0)
-               continue;
-           if (errno == EINTR)
-               continue;
-           return (-1);
+           if ((errno == EAGAIN && time_left > 0) || errno == EINTR)
+                /* void */ ;
+           else
+               return (-1);
+       } else {
+           buf += count;
+           len -= count;
+       }
+       if (len > 0 && time_left > 0) {
+           time_left = expire - time((time_t *) 0);
+           if (time_left <= 0) {
+               errno = ETIMEDOUT;
+               return (-1);
+           }
        }
-       if (count == 0)
-           msg_fatal("write returned 0");
-       buf += count;
-       len -= count;
     }
     return (buf - start);
 }
index 9aed39f412a8061188c3edc1cc4b0cdea2dcdebd..bb443b23b6c80aea8d495c3239b8ad1eb098c39b 100644 (file)
@@ -64,6 +64,8 @@ deliver_attr.o: ../../include/deliver_request.h
 deliver_attr.o: ../../include/dict.h
 deliver_attr.o: ../../include/dsn.h
 deliver_attr.o: ../../include/dsn_buf.h
+deliver_attr.o: ../../include/iostuff.h
+deliver_attr.o: ../../include/mail_proto.h
 deliver_attr.o: ../../include/maps.h
 deliver_attr.o: ../../include/mbox_conf.h
 deliver_attr.o: ../../include/msg.h
@@ -84,9 +86,11 @@ mailbox.o: ../../include/dict.h
 mailbox.o: ../../include/dsn.h
 mailbox.o: ../../include/dsn_buf.h
 mailbox.o: ../../include/dsn_util.h
+mailbox.o: ../../include/iostuff.h
 mailbox.o: ../../include/mail_addr_find.h
 mailbox.o: ../../include/mail_copy.h
 mailbox.o: ../../include/mail_params.h
+mailbox.o: ../../include/mail_proto.h
 mailbox.o: ../../include/maps.h
 mailbox.o: ../../include/mbox_conf.h
 mailbox.o: ../../include/mbox_open.h
@@ -114,8 +118,10 @@ maildir.o: ../../include/dsn.h
 maildir.o: ../../include/dsn_buf.h
 maildir.o: ../../include/dsn_util.h
 maildir.o: ../../include/get_hostname.h
+maildir.o: ../../include/iostuff.h
 maildir.o: ../../include/mail_copy.h
 maildir.o: ../../include/mail_params.h
+maildir.o: ../../include/mail_proto.h
 maildir.o: ../../include/make_dirs.h
 maildir.o: ../../include/maps.h
 maildir.o: ../../include/mbox_conf.h
@@ -142,6 +148,8 @@ recipient.o: ../../include/deliver_request.h
 recipient.o: ../../include/dict.h
 recipient.o: ../../include/dsn.h
 recipient.o: ../../include/dsn_buf.h
+recipient.o: ../../include/iostuff.h
+recipient.o: ../../include/mail_proto.h
 recipient.o: ../../include/maps.h
 recipient.o: ../../include/mbox_conf.h
 recipient.o: ../../include/msg.h
@@ -162,6 +170,8 @@ unknown.o: ../../include/deliver_request.h
 unknown.o: ../../include/dict.h
 unknown.o: ../../include/dsn.h
 unknown.o: ../../include/dsn_buf.h
+unknown.o: ../../include/iostuff.h
+unknown.o: ../../include/mail_proto.h
 unknown.o: ../../include/maps.h
 unknown.o: ../../include/mbox_conf.h
 unknown.o: ../../include/msg.h
@@ -185,6 +195,7 @@ virtual.o: ../../include/iostuff.h
 virtual.o: ../../include/mail_addr_find.h
 virtual.o: ../../include/mail_conf.h
 virtual.o: ../../include/mail_params.h
+virtual.o: ../../include/mail_proto.h
 virtual.o: ../../include/mail_queue.h
 virtual.o: ../../include/mail_server.h
 virtual.o: ../../include/mail_version.h