Hi,

Postfix 2.7.0 supports milter protocol 2, 3, 4 and
6. Postfix with milter_protocol=6 accepts a connection from
a milter that uses milter protocol 2. But its milter session
is broken because Postfix sends SMFIC_DATA event to the
milter. In milter protocol 2, SMFIC_DATA isn't supported. So
the connected milter can't reply SMFIC_DATA request. Postfix
logs the following warning message on the case:

  Mar 20 10:25:09 mail postfix/smtpd[70678]: warning: milter 
inet:localhost:20025: can't read SMFIC_DATA reply packet header: Unknown error: 0

Here is a work flow on the case:

  SMTP                        Postfix            milter
                            (protocol 6)       (protocol 2)
  telnet localhost smtp -->
                             negotiate    -->
                            (protocol 6)
                                          <--  negotiate reply
                                                (protocol 2)
                            accept
                            connect       -->
                                          <--  connect reply
                        <-- 220
  EHLO                  -->
                            helo          -->
                                          <--  helo reply
                        <-- 250
  MAIL FROM             -->
                            mail          -->
                                          <--  mail reply
                        <-- 250
  RCPT TO               -->
                            rcpt          -->
                                          <--  rcpt reply
                        <-- 250
  DATA                  -->
                            data          -->
                                               UNKNOWN REQUEST
                                               close connection
                            can't read
                            SMFIC_DATA reply
                            packet header:
                            Unknown error: 0

I'll attach a patch to fix it. Postfix doesn't send
any SMFIC_DATA to protocol 2 milter with the patch.


Thanks,
--
kou
--- postfix-2.7.0.orig/src/milter/milter8.c	2009-09-19 05:38:11.000000000 +0900
+++ postfix-2.7.0/src/milter/milter8.c	2010-03-20 10:12:32.000000000 +0900
@@ -1774,6 +1774,17 @@
     }
     if (milter->ev_mask & SMFIP_RCPT_REJ)
 	milter->m.flags |= MILTER_FLAG_WANT_RCPT_REJ;
+    {
+        int mask;
+        char version_string[2];
+
+        version_string[0] = milter->version + '0';
+        version_string[1] = '\0';
+        mask = name_code(milter8_event_masks, NAME_CODE_FLAG_NONE,
+                         version_string);
+        if (mask != -1)
+            milter->np_mask |= (SMFIP_NOSEND_MASK & ~mask);
+    }
 
     /*
      * Initial negotiations completed.

Reply via email to