hi, folks

this is a simple patch to make postfix 2.5.6 send queueid by xforward
command to next-hop, hope this can be ...

BTW: server side queueid parse does not  done in this patch.

good luck.

saguto yin

--------cut------------------------------
diff -ruN postfix-2.5.6/src/global/mail_proto.h
xfer-queueid-postfix-2.5.6/src/global/mail_proto.h
--- postfix-2.5.6/src/global/mail_proto.h 2007-12-13 04:28:28.000000000
+0800
+++ xfer-queueid-postfix-2.5.6/src/global/mail_proto.h 2009-03-11
14:18:21.000000000 +0800
@@ -217,6 +217,7 @@
 #define XFORWARD_DOMAIN  "SOURCE"/* origin type */
 #define XFORWARD_DOM_LOCAL "LOCAL" /* local origin */
 #define XFORWARD_DOM_REMOTE "REMOTE"/* remote origin */
+#define XFORWARD_QUEUEID "QUEUEID"/* queueid origin */

 #define XFORWARD_UNAVAILABLE "[UNAVAILABLE]" /* attribute unavailable */

diff -ruN postfix-2.5.6/src/smtp/smtp.h
xfer-queueid-postfix-2.5.6/src/smtp/smtp.h
--- postfix-2.5.6/src/smtp/smtp.h 2008-01-09 22:04:37.000000000 +0800
+++ xfer-queueid-postfix-2.5.6/src/smtp/smtp.h 2009-03-11 14:18:35.000000000
+0800
@@ -119,6 +119,7 @@
 #define SMTP_FEATURE_PIX_NO_ESMTP (1<<16) /* PIX smtp fixup mode */
 #define SMTP_FEATURE_PIX_DELAY_DOTCRLF (1<<17) /* PIX smtp fixup mode */
 #define SMTP_FEATURE_XFORWARD_PORT (1<<18)
+#define SMTP_FEATURE_XFORWARD_QUEUEID (1<<19)

  /*
   * Features that passivate under the endpoint.
diff -ruN postfix-2.5.6/src/smtp/smtp_proto.c
xfer-queueid-postfix-2.5.6/src/smtp/smtp_proto.c
--- postfix-2.5.6/src/smtp/smtp_proto.c 2008-01-09 22:04:37.000000000 +0800
+++ xfer-queueid-postfix-2.5.6/src/smtp/smtp_proto.c 2009-03-11
14:18:36.000000000 +0800
@@ -271,6 +271,7 @@
  XFORWARD_PROTO, SMTP_FEATURE_XFORWARD_PROTO,
  XFORWARD_HELO, SMTP_FEATURE_XFORWARD_HELO,
  XFORWARD_DOMAIN, SMTP_FEATURE_XFORWARD_DOMAIN,
+ XFORWARD_QUEUEID, SMTP_FEATURE_XFORWARD_QUEUEID,
  0, 0,
     };
     SOCKOPT_SIZE optlen;
@@ -1239,6 +1240,12 @@
        DEL_REQ_ATTR_AVAIL(request->client_port) ?
       request->client_port : XFORWARD_UNAVAILABLE, "");
      }
+     if (session->features & SMTP_FEATURE_XFORWARD_QUEUEID) {
+  vstring_strcat(next_command, " " XFORWARD_QUEUEID "=");
+  xtext_quote_append(next_command,
+       DEL_REQ_ATTR_AVAIL(request->queue_id) ?
+      request->queue_id : XFORWARD_UNAVAILABLE, "");
+     }
      if (session->send_proto_helo)
   next_state = SMTP_STATE_XFORWARD_PROTO_HELO;
      else

Reply via email to