]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.3-20050623
authorWietse Venema <wietse@porcupine.org>
Thu, 23 Jun 2005 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:31:16 +0000 (06:31 +0000)
18 files changed:
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/src/bounce/Makefile.in
postfix/src/global/Makefile.in
postfix/src/global/deliver_pass.c
postfix/src/global/dsb_scan.c
postfix/src/global/dsb_scan.h
postfix/src/global/dsn_print.c
postfix/src/global/dsn_print.h
postfix/src/global/mail_version.h
postfix/src/global/rcpt_buf.c
postfix/src/global/rcpt_buf.h
postfix/src/global/rcpt_print.c
postfix/src/global/rcpt_print.h
postfix/src/tls/tls_session.c
postfix/src/util/attr.h
postfix/src/util/attr_print0.c
postfix/src/util/attr_scan0.c

index 3e2285b5960d3e8e380262a94b84e7d704800137..fc09adcf066539180142ff86747ba99ad7bc7d4d 100644 (file)
@@ -10923,6 +10923,14 @@ Apologies for any names omitted.
        smtp_mx_session_limit = 2).  Files: smtp/smtp_connect.c,
        smtp/smtp_proto.c.
 
+20050623
+
+       Cleanup: generalized the delegated attribute scan/print
+       interfaces, and updated the deliver_pass module with delegated
+       attribute scan/print support. Files: util/attr_scan0.c,
+       util/attr_print0.c, global/dsb_scan.c, global/dsn_print.c,
+       global/rcpt_buf,c global/rcpt_print.c, global/deliver_pass.c.
+
 Open problems:
 
        Laptop friendliness: make the qmgr remember when the next
index 90dfe6ff38bfe6eb2b1a7075c30d2330c618d9f5..a1ac3b2e7ac54beb1f9809319bdcb7adc8e5b4ea 100644 (file)
@@ -17,6 +17,19 @@ Incompatibility with Postfix 2.1 and earlier
 If you upgrade from Postfix 2.1 or earlier, read RELEASE_NOTES-2.2
 before proceeding.
 
+Incompatibility with snapshot 20050622
+======================================
+
+The Postfix SMTP client by default limits the number of MX server
+addresses to smtp_mx_address_limit=5. Previously this limit was
+disabled by default. The new limit prevents Postfix from spending
+lots of time trying to connect to lots of bogus MX servers.
+
+The Postfix SMTP error handling of [45]XX server greetings was
+cleaned up. The server reply is now properly reported. As a side
+effect, the failed session now counts towards the limit on the total
+number of sessions per domain name (default: smtp_mx_session_limit=2).
+
 Incompatibility with snapshot 20050615
 ======================================
 
index 47b1ebb6cfe6d6ff1ea4a0dcb874bbe2d528c10d..66a6a9fa3c939f19be4e16a51d9f87ad5d6f5be7 100644 (file)
@@ -106,6 +106,7 @@ bounce_append_service.o: ../../include/vstream.h
 bounce_append_service.o: ../../include/vstring.h
 bounce_append_service.o: bounce_append_service.c
 bounce_append_service.o: bounce_service.h
+bounce_cleanup.o: ../../include/attr.h
 bounce_cleanup.o: ../../include/bounce_log.h
 bounce_cleanup.o: ../../include/dsn.h
 bounce_cleanup.o: ../../include/dsn_buf.h
@@ -120,6 +121,7 @@ bounce_cleanup.o: ../../include/vstream.h
 bounce_cleanup.o: ../../include/vstring.h
 bounce_cleanup.o: bounce_cleanup.c
 bounce_cleanup.o: bounce_service.h
+bounce_notify_service.o: ../../include/attr.h
 bounce_notify_service.o: ../../include/bounce.h
 bounce_notify_service.o: ../../include/bounce_log.h
 bounce_notify_service.o: ../../include/cleanup_user.h
@@ -178,6 +180,7 @@ bounce_notify_util.o: ../../include/vstream.h
 bounce_notify_util.o: ../../include/vstring.h
 bounce_notify_util.o: bounce_notify_util.c
 bounce_notify_util.o: bounce_service.h
+bounce_notify_verp.o: ../../include/attr.h
 bounce_notify_verp.o: ../../include/bounce.h
 bounce_notify_verp.o: ../../include/bounce_log.h
 bounce_notify_verp.o: ../../include/cleanup_user.h
@@ -201,6 +204,7 @@ bounce_notify_verp.o: ../../include/vstream.h
 bounce_notify_verp.o: ../../include/vstring.h
 bounce_notify_verp.o: bounce_notify_verp.c
 bounce_notify_verp.o: bounce_service.h
+bounce_one_service.o: ../../include/attr.h
 bounce_one_service.o: ../../include/bounce.h
 bounce_one_service.o: ../../include/bounce_log.h
 bounce_one_service.o: ../../include/cleanup_user.h
@@ -222,6 +226,7 @@ bounce_one_service.o: ../../include/vstream.h
 bounce_one_service.o: ../../include/vstring.h
 bounce_one_service.o: bounce_one_service.c
 bounce_one_service.o: bounce_service.h
+bounce_trace_service.o: ../../include/attr.h
 bounce_trace_service.o: ../../include/bounce_log.h
 bounce_trace_service.o: ../../include/cleanup_user.h
 bounce_trace_service.o: ../../include/deliver_request.h
@@ -243,6 +248,7 @@ bounce_trace_service.o: ../../include/vstream.h
 bounce_trace_service.o: ../../include/vstring.h
 bounce_trace_service.o: bounce_service.h
 bounce_trace_service.o: bounce_trace_service.c
+bounce_warn_service.o: ../../include/attr.h
 bounce_warn_service.o: ../../include/bounce_log.h
 bounce_warn_service.o: ../../include/cleanup_user.h
 bounce_warn_service.o: ../../include/dsn.h
index 787e682ffeed1256cb8b5826ed69b671d1636a63..cdb30dae0d1ef5c09adf16dd8caeff2cb1be07cb 100644 (file)
@@ -625,6 +625,7 @@ deliver_pass.o: ../../include/vstring.h
 deliver_pass.o: deliver_pass.c
 deliver_pass.o: deliver_pass.h
 deliver_pass.o: deliver_request.h
+deliver_pass.o: dsb_scan.h
 deliver_pass.o: dsn.h
 deliver_pass.o: dsn_buf.h
 deliver_pass.o: mail_params.h
index 255e5731492b2d77e2e7c3ba3a2a1a13e5aef8b8..1922db7141f54a446dbed2031d864ad81039bd54 100644 (file)
@@ -67,6 +67,7 @@
 
 #include <mail_params.h>
 #include <deliver_pass.h>
+#include <dsb_scan.h>
 
 /* deliver_pass_initial_reply - retrieve initial delivery process response */
 
@@ -130,24 +131,14 @@ static int deliver_pass_send_request(VSTREAM *stream, DELIVER_REQUEST *request,
 
 /* deliver_pass_final_reply - retrieve final delivery status response */
 
-static int deliver_pass_final_reply(VSTREAM *stream, VSTRING *dsn_status,
-                                           VSTRING *reason,
-                                           VSTRING *dsn_dtype,
-                                           VSTRING *dsn_dtext,
-                                           VSTRING *dsn_mtype,
-                                           VSTRING *dsn_mname)
+static int deliver_pass_final_reply(VSTREAM *stream, DSN_BUF *dsb)
 {
     int     stat;
 
     if (attr_scan(stream, ATTR_FLAG_STRICT,
-                 ATTR_TYPE_STR, MAIL_ATTR_DSN_STATUS, dsn_status,
-                 ATTR_TYPE_STR, MAIL_ATTR_WHY, reason,
-                 ATTR_TYPE_STR, MAIL_ATTR_DSN_DTYPE, dsn_dtype,
-                 ATTR_TYPE_STR, MAIL_ATTR_DSN_DTEXT, dsn_dtext,
-                 ATTR_TYPE_STR, MAIL_ATTR_DSN_MTYPE, dsn_mtype,
-                 ATTR_TYPE_STR, MAIL_ATTR_DSN_MNAME, dsn_mname,
+                 ATTR_TYPE_FUNC, dsb_scan, (void *) dsb,
                  ATTR_TYPE_NUM, MAIL_ATTR_STATUS, &stat,
-                 ATTR_TYPE_END) != 7) {
+                 ATTR_TYPE_END) != 2) {
        msg_warn("%s: malformed response", VSTREAM_PATH(stream));
        stat = -1;
     }
@@ -161,7 +152,7 @@ int     deliver_pass(const char *class, const char *service,
                             RECIPIENT *rcpt)
 {
     VSTREAM *stream;
-    VSTRING *junk;
+    DSN_BUF *dsb;
     int     status;
     char   *saved_service;
     char   *transport;
@@ -181,7 +172,7 @@ int     deliver_pass(const char *class, const char *service,
      * Initialize.
      */
     stream = mail_connect_wait(class, transport);
-    junk = vstring_alloc(1);
+    dsb = dsb_create();
 
     /*
      * Get the delivery process initial response. Send the queue file info
@@ -196,14 +187,13 @@ int     deliver_pass(const char *class, const char *service,
     if ((status = deliver_pass_initial_reply(stream)) == 0
        && (status = deliver_pass_send_request(stream, request, nexthop,
                                               rcpt)) == 0)
-       status = deliver_pass_final_reply(stream, junk, junk, junk,
-                                         junk, junk, junk);
+       status = deliver_pass_final_reply(stream, dsb);
 
     /*
      * Clean up.
      */
     vstream_fclose(stream);
-    vstring_free(junk);
+    dsb_free(dsb);
     myfree(saved_service);
 
     return (status);
index 9ddb568b69f6cb088bd115d91bb4fd0dcf4ab574..0693d58877c788ab83c5119dddc08c7f967a8115 100644 (file)
@@ -6,13 +6,14 @@
 /* SYNOPSIS
 /*     #include <dsb_scan.h>
 /*
-/*     int     dsb_scan(stream, flags, ptr)
+/*     int     dsb_scan(scan_fn, stream, flags, ptr)
+/*     ATTR_SCAN_MASTER_FN scan_fn;
 /*     VSTREAM *stream;
 /*     int     flags;
 /*     void    *ptr;
 /* DESCRIPTION
 /*     dsb_scan() reads a DSN_BUF from the named stream using the
-/*     default attribute scan routines. This function is meant
+/*     specified attribute scan routine. dsb_scan() is meant
 /*     to be passed as a call-back to attr_scan(), thusly:
 /*
 /*     ... ATTR_SCAN_FUNC, dsb_scan, (void *) &dsbuf, ...
@@ -44,7 +45,8 @@
 
 /* dsb_scan - read DSN_BUF from stream */
 
-int     dsb_scan(VSTREAM *fp, int flags, void *ptr)
+int     dsb_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
+                        int flags, void *ptr)
 {
     DSN_BUF *dsb = (DSN_BUF *) ptr;
     int     ret;
@@ -53,14 +55,14 @@ int     dsb_scan(VSTREAM *fp, int flags, void *ptr)
      * The attribute order is determined by backwards compatibility. It can
      * be sanitized after all the ad-hoc DSN read/write code is replaced.
      */
-    ret = attr_scan(fp, flags | ATTR_FLAG_MORE,
-                   ATTR_TYPE_STR, MAIL_ATTR_DSN_STATUS, dsb->status,
-                   ATTR_TYPE_STR, MAIL_ATTR_DSN_DTYPE, dsb->dtype,
-                   ATTR_TYPE_STR, MAIL_ATTR_DSN_DTEXT, dsb->dtext,
-                   ATTR_TYPE_STR, MAIL_ATTR_DSN_MTYPE, dsb->mtype,
-                   ATTR_TYPE_STR, MAIL_ATTR_DSN_MNAME, dsb->mname,
-                   ATTR_TYPE_STR, MAIL_ATTR_DSN_ACTION, dsb->action,
-                   ATTR_TYPE_STR, MAIL_ATTR_WHY, dsb->reason,
-                   ATTR_TYPE_END);
+    ret = scan_fn(fp, flags | ATTR_FLAG_MORE,
+                 ATTR_TYPE_STR, MAIL_ATTR_DSN_STATUS, dsb->status,
+                 ATTR_TYPE_STR, MAIL_ATTR_DSN_DTYPE, dsb->dtype,
+                 ATTR_TYPE_STR, MAIL_ATTR_DSN_DTEXT, dsb->dtext,
+                 ATTR_TYPE_STR, MAIL_ATTR_DSN_MTYPE, dsb->mtype,
+                 ATTR_TYPE_STR, MAIL_ATTR_DSN_MNAME, dsb->mname,
+                 ATTR_TYPE_STR, MAIL_ATTR_DSN_ACTION, dsb->action,
+                 ATTR_TYPE_STR, MAIL_ATTR_WHY, dsb->reason,
+                 ATTR_TYPE_END);
     return (ret == 7 ? 1 : -1);
 }
index 4859b7661b444969cd199f70432092945d9be86c..397f86bc34ac5b35be20e62604e007d14c237353 100644 (file)
@@ -15,6 +15,7 @@
   * Utility library.
   */
 #include <vstream.h>
+#include <attr.h>
 
  /*
   * Global library.
@@ -24,7 +25,7 @@
  /*
   * External interface.
   */
-extern int dsb_scan(VSTREAM *, int, void *);
+extern int dsb_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
 
 /* LICENSE
 /* .ad
index 15c31ea720ddc1cb99e07415299105927f488a4e..ea1dc4924ce37d8e9363e75590ad43b9148e025b 100644 (file)
@@ -6,13 +6,14 @@
 /* SYNOPSIS
 /*     #include <dsn_print.h>
 /*
-/*     int     dsn_print(stream, flags, ptr)
+/*     int     dsn_print(print_fn, stream, flags, ptr)
+/*     ATTR_PRINT_MASTER_FN print_fn;
 /*     VSTREAM *stream;
 /*     int     flags;
 /*     void    *ptr;
 /* DESCRIPTION
 /*     dsn_print() writes a DSN structure to the named stream using
-/*     the default attribute print routines. This function is meant
+/*     the specified attribute print routine. dsn_print() is meant
 /*     to be passed as a call-back to attr_print(), thusly:
 /*
 /*     ... ATTR_PRINT_FUNC, dsn_print, (void *) dsn, ...
@@ -44,7 +45,8 @@
 
 /* dsn_print - write DSN to stream */
 
-int     dsn_print(VSTREAM *fp, int flags, void *ptr)
+int     dsn_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
+                         int flags, void *ptr)
 {
     DSN    *dsn = (DSN *) ptr;
     int     ret;
@@ -55,14 +57,14 @@ int     dsn_print(VSTREAM *fp, int flags, void *ptr)
      * The attribute order is determined by backwards compatibility. It can
      * be sanitized after all the ad-hoc DSN read/write code is replaced.
      */
-    ret = attr_print(fp, flags | ATTR_FLAG_MORE,
-                    ATTR_TYPE_STR, MAIL_ATTR_DSN_STATUS, dsn->status,
-                    ATTR_TYPE_STR, MAIL_ATTR_DSN_DTYPE, S(dsn->dtype),
-                    ATTR_TYPE_STR, MAIL_ATTR_DSN_DTEXT, S(dsn->dtext),
-                    ATTR_TYPE_STR, MAIL_ATTR_DSN_MTYPE, S(dsn->mtype),
-                    ATTR_TYPE_STR, MAIL_ATTR_DSN_MNAME, S(dsn->mname),
-                    ATTR_TYPE_STR, MAIL_ATTR_DSN_ACTION, S(dsn->action),
-                    ATTR_TYPE_STR, MAIL_ATTR_WHY, dsn->reason,
-                    ATTR_TYPE_END);
+    ret = print_fn(fp, flags | ATTR_FLAG_MORE,
+                  ATTR_TYPE_STR, MAIL_ATTR_DSN_STATUS, dsn->status,
+                  ATTR_TYPE_STR, MAIL_ATTR_DSN_DTYPE, S(dsn->dtype),
+                  ATTR_TYPE_STR, MAIL_ATTR_DSN_DTEXT, S(dsn->dtext),
+                  ATTR_TYPE_STR, MAIL_ATTR_DSN_MTYPE, S(dsn->mtype),
+                  ATTR_TYPE_STR, MAIL_ATTR_DSN_MNAME, S(dsn->mname),
+                  ATTR_TYPE_STR, MAIL_ATTR_DSN_ACTION, S(dsn->action),
+                  ATTR_TYPE_STR, MAIL_ATTR_WHY, dsn->reason,
+                  ATTR_TYPE_END);
     return (ret);
 }
index a78d3f13f8c15b2e51d87acd7a9729f376292b65..4b2c9fa84d454ec8f643ae8aa3836a87a3b4e53b 100644 (file)
@@ -15,6 +15,7 @@
   * Utility library.
   */
 #include <vstream.h>
+#include <attr.h>
 
  /*
   * Global library.
@@ -24,7 +25,7 @@
  /*
   * External interface.
   */
-extern int dsn_print(VSTREAM *, int, void *);
+extern int dsn_print(ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
 
 /* LICENSE
 /* .ad
index 43c5fdafd996f2df5cbe3791660feeac536dab9b..0993eae726b01e865ed1aad7c68f8303648d3cc0 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      "20050622"
+#define MAIL_RELEASE_DATE      "20050623"
 #define MAIL_VERSION_NUMBER    "2.3"
 
 #define VAR_MAIL_VERSION       "mail_version"
index 19bdf87212eb621fa0f0361356989b6ec81ab52b..2417a5cb1f62108f166d3b53ee22c8565d7b3ff5 100644 (file)
 /*     void    rcpb_free(rcpt)
 /*     RCPT_BUF *rcpt;
 /*
-/*     int     rcpb_scan(stream, flags, ptr)
+/*     int     rcpb_scan(scan_fn, stream, flags, ptr)
+/*     ATTR_SCAN_MASTER_FN scan_fn;
 /*     VSTREAM *stream;
 /*     int     flags;
 /*     void    *ptr;
 /* DESCRIPTION
 /*     rcpb_scan() reads a recipient buffer from the named stream
-/*     using the default attribute scan routines. This function
+/*     using the specified attribute scan routine. rcpb_scan()
 /*     is meant to be passed as a call-back to attr_scan(), thusly:
 /*
 /*     ... ATTR_SCAN_FUNC, rcpb_scan, (void *) rcpt_buf, ...
@@ -91,22 +92,22 @@ void    rcpb_free(RCPT_BUF *rcpt)
 
 /* rcpb_scan - receive recipient buffer */
 
-int     rcpb_scan(VSTREAM *fp, int flags, void *ptr)
+int     rcpb_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
+                         int flags, void *ptr)
 {
     RCPT_BUF *rcpt = (RCPT_BUF *) ptr;
     int     ret;
 
     /*
-     * As with DSN, the order of attributes is determined by historical
-     * compatibility and can be fixed after all the ad-hoc read/write code is
-     * replaced.
+     * The order of attributes is determined by historical compatibility and
+     * can be fixed after all the ad-hoc read/write code is replaced.
      */
-    ret = attr_scan(fp, flags | ATTR_FLAG_MORE,
-                   ATTR_TYPE_STR, MAIL_ATTR_ORCPT, rcpt->orig_addr,
-                   ATTR_TYPE_STR, MAIL_ATTR_RECIP, rcpt->address,
-                   ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, &rcpt->offset,
-                   ATTR_TYPE_STR, MAIL_ATTR_DSN_ORCPT, rcpt->dsn_orcpt,
-                   ATTR_TYPE_NUM, MAIL_ATTR_DSN_NOTIFY, &rcpt->dsn_notify,
-                   ATTR_TYPE_END);
+    ret = scan_fn(fp, flags | ATTR_FLAG_MORE,
+                 ATTR_TYPE_STR, MAIL_ATTR_ORCPT, rcpt->orig_addr,
+                 ATTR_TYPE_STR, MAIL_ATTR_RECIP, rcpt->address,
+                 ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, &rcpt->offset,
+                 ATTR_TYPE_STR, MAIL_ATTR_DSN_ORCPT, rcpt->dsn_orcpt,
+                 ATTR_TYPE_NUM, MAIL_ATTR_DSN_NOTIFY, &rcpt->dsn_notify,
+                 ATTR_TYPE_END);
     return (ret == 5 ? 1 : -1);
 }
index b5da802a39f7d464b62230f6b5f4b477ed8937de..0dbee35c8b467dfb0bf19c5eb3af8ba16e22d166 100644 (file)
@@ -16,6 +16,7 @@
   */
 #include <vstream.h>
 #include <vstring.h>
+#include <attr.h>
 
  /*
   * External interface.
@@ -30,7 +31,7 @@ typedef struct {
 
 extern RCPT_BUF *rcpb_create(void);
 extern void rcpb_free(RCPT_BUF *);
-extern int rcpb_scan(VSTREAM *, int, void *);
+extern int rcpb_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
 
 #define RECIPIENT_FROM_RCPT_BUF(rcpt, buf) \
     ((rcpt)->address = vstring_str((buf)->address), \
index cb56940ec77a93aac98b09ef86d0e9bcea574383..b923e6f04019f2820df7963663e60274ad1a9c77 100644 (file)
@@ -6,16 +6,16 @@
 /* SYNOPSIS
 /*     #include <rcpt_print.h>
 /*
-/*     int     rcpt_print(stream, flags, ptr)
+/*     int     rcpt_print(print_fn, stream, flags, ptr)
+/*     ATTR_PRINT_MASTER_FN print_fn;
 /*     VSTREAM *stream;
 /*     int     flags;
 /*     void    *ptr;
 /* DESCRIPTION
 /*     rcpt_print() writes the contents of a RECIPIENT structure
-/*     to the named stream using the default attribute print
-/*     routines. This function is meant to be passed as a call-back
-/*     to attr_print(),
-/*     thusly:
+/*     to the named stream using the specified attribute print
+/*     routine. rcpt_print() is meant to be passed as a call-back
+/*     to attr_print(), thusly:
 /*
 /*     ... ATTR_PRINT_FUNC, rcpt_print, (void *) recipient, ...
 /* DIAGNOSTICS
@@ -44,7 +44,8 @@
 
 /* rcpt_print - write recipient to stream */
 
-int     rcpt_print(VSTREAM *fp, int flags, void *ptr)
+int     rcpt_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
+                          int flags, void *ptr)
 {
     RECIPIENT *rcpt = (RECIPIENT *) ptr;
     int     ret;
@@ -52,16 +53,17 @@ int     rcpt_print(VSTREAM *fp, int flags, void *ptr)
 #define S(s) ((s) ? (s) : "")
 
     /*
-     * The attribute order is determined by backwards compatibility. It can 
-     * be sanitized after all the ad-hoc recipient read/write code is replaced.
+     * The attribute order is determined by backwards compatibility. It can
+     * be sanitized after all the ad-hoc recipient read/write code is
+     * replaced.
      */
     ret =
-       attr_print(fp, flags | ATTR_FLAG_MORE,
-                  ATTR_TYPE_STR, MAIL_ATTR_ORCPT, S(rcpt->orig_addr),
-                  ATTR_TYPE_STR, MAIL_ATTR_RECIP, rcpt->address,
-                  ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, rcpt->offset,
-                  ATTR_TYPE_STR, MAIL_ATTR_DSN_ORCPT, S(rcpt->dsn_orcpt),
-                  ATTR_TYPE_NUM, MAIL_ATTR_DSN_NOTIFY, rcpt->dsn_notify,
-                  ATTR_TYPE_END);
+       print_fn(fp, flags | ATTR_FLAG_MORE,
+                ATTR_TYPE_STR, MAIL_ATTR_ORCPT, S(rcpt->orig_addr),
+                ATTR_TYPE_STR, MAIL_ATTR_RECIP, rcpt->address,
+                ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, rcpt->offset,
+                ATTR_TYPE_STR, MAIL_ATTR_DSN_ORCPT, S(rcpt->dsn_orcpt),
+                ATTR_TYPE_NUM, MAIL_ATTR_DSN_NOTIFY, rcpt->dsn_notify,
+                ATTR_TYPE_END);
     return (ret);
 }
index fd678944443cb958ee51e9bfe717ec7c34cca1d0..ef46ad1a95f113ba303f23a7fc4ed48c1b300e67 100644 (file)
@@ -15,6 +15,7 @@
   * Utility library.
   */
 #include <vstream.h>
+#include <attr.h>
 
  /*
   * Global library.
@@ -24,7 +25,7 @@
  /*
   * External interface.
   */
-extern int rcpt_print(VSTREAM *, int, void *);
+extern int rcpt_print(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
 
 /* LICENSE
 /* .ad
index 4c809232f9eb49bd5f5b100119bb85decd4aeba2..21d939ee09ea1b3fa15542ad7ed0303e2140341c 100644 (file)
@@ -147,13 +147,18 @@ VSTRING *tls_session_passivate(SSL_SESSION *session)
 
 SSL_SESSION *tls_session_activate(const char *session_data, int session_data_len)
 {
+#if (OPENSSL_VERSION_NUMBER < 0x0090707fL)
+#define BOGUS_CONST
+#else
+#define BOGUS_CONST const
+#endif
     SSL_SESSION *session;
-    const unsigned char *ptr;
+    BOGUS_CONST unsigned char *ptr;
 
     /*
      * Activate the SSL_SESSION object.
      */
-    ptr = (const unsigned char *) session_data;
+    ptr = (BOGUS_CONST unsigned char *) session_data;
     session = d2i_SSL_SESSION((SSL_SESSION **) 0, &ptr, session_data_len);
     if (!session)
        tls_print_errors();
index 65e703af9cef5e4b694cff9630f202726d8a9d19..47f7576353a0719a176c1a02f19508dbcead439c 100644 (file)
 #define ATTR_FLAG_ALL          (07)
 
  /*
-Delegation for better data abstraction. */
-typedef int (*ATTR_SCAN_FN)(VSTREAM *, int, void *);
-typedef int (*ATTR_PRINT_FN)(VSTREAM *, int, void *);
+  * Delegation for better data abstraction.
+  */
+typedef int (*ATTR_SCAN_MASTER_FN) (VSTREAM *, int, ...);
+typedef int (*ATTR_SCAN_SLAVE_FN) (ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
+typedef int (*ATTR_PRINT_MASTER_FN) (VSTREAM *, int,...);
+typedef int (*ATTR_PRINT_SLAVE_FN) (ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
 
  /*
   * Default to null-terminated, as opposed to base64-encoded.
index 1c2b4de5786d737bb9f4e63cecbc27585fff4212..4d9c4e97e69037560ffe48c3cc62641a29f2ac42 100644 (file)
@@ -54,7 +54,7 @@
 /* .IP "ATTR_TYPE_DATA (char *, int, char *)"
 /*     This argument is followed by an attribute name, an attribute value
 /*     length, and an attribute value pointer.
-/* .IP "ATTR_TYPE_FUNC (ATTR_PRINT_FN, void *)"
+/* .IP "ATTR_TYPE_FUNC (ATTR_PRINT_SLAVE_FN, void *)"
 /*     This argument is followed by a function pointer and generic data
 /*     pointer.
 /* .IP "ATTR_TYPE_HASH (HTABLE *)"
@@ -114,7 +114,7 @@ int     attr_vprint0(VSTREAM *fp, int flags, va_list ap)
     HTABLE_INFO **ht;
     int     len_val;
     static VSTRING *base64_buf;
-    ATTR_PRINT_FN print_fn;
+    ATTR_PRINT_SLAVE_FN print_fn;
     void   *print_arg;
 
     /*
@@ -168,9 +168,9 @@ int     attr_vprint0(VSTREAM *fp, int flags, va_list ap)
                msg_info("send attr %s = [data %d bytes]", attr_name, len_val);
            break;
        case ATTR_TYPE_FUNC:
-           print_fn = va_arg(ap, ATTR_PRINT_FN);
+           print_fn = va_arg(ap, ATTR_PRINT_SLAVE_FN);
            print_arg = va_arg(ap, void *);
-           print_fn(fp, flags | ATTR_FLAG_MORE, print_arg);
+           print_fn(attr_print0, fp, flags | ATTR_FLAG_MORE, print_arg);
            break;
        case ATTR_TYPE_HASH:
            ht_info_list = htable_list(va_arg(ap, HTABLE *));
index 66a88941980382fdddb2e2c9c6bc91d06770260b..bf00c64c9a8b696de951362030a74a3cd83c9654 100644 (file)
@@ -93,7 +93,7 @@
 /*     This argument is followed by an attribute name and a VSTRING pointer.
 /* .IP "ATTR_TYPE_DATA (char *, VSTRING *)"
 /*     This argument is followed by an attribute name and a VSTRING pointer.
-/* .IP "ATTR_TYPE_FUNC (ATTR_SCAN_FN, void *)"
+/* .IP "ATTR_TYPE_FUNC (ATTR_SCAN_SLAVE_FN, void *)"
 /*     This argument is followed by a function pointer and a generic data
 /*     pointer.
 /* .IP "ATTR_TYPE_HASH (HTABLE *)"
@@ -256,7 +256,7 @@ int     attr_vscan0(VSTREAM *fp, int flags, va_list ap)
     HTABLE *hash_table;
     int     ch;
     int     conversions;
-    ATTR_SCAN_FN scan_fn;
+    ATTR_SCAN_SLAVE_FN scan_fn;
     void   *scan_arg;
 
     /*
@@ -378,9 +378,9 @@ int     attr_vscan0(VSTREAM *fp, int flags, va_list ap)
                return (-1);
            break;
        case ATTR_TYPE_FUNC:
-           scan_fn = va_arg(ap, ATTR_SCAN_FN);
+           scan_fn = va_arg(ap, ATTR_SCAN_SLAVE_FN);
            scan_arg = va_arg(ap, void *);
-           if (scan_fn(fp, flags | ATTR_FLAG_MORE, scan_arg) < 0)
+           if (scan_fn(attr_scan0, fp, flags | ATTR_FLAG_MORE, scan_arg) < 0)
                return (-1);
            break;
        case ATTR_TYPE_HASH: