dccifd - smtp sequence problem?

Vernon Schryver vjs@calcite.rhyolite.com
Mon Aug 15 18:06:42 UTC 2005


> From: =?ISO-8859-2?Q?Martin_P=E1la?= <Martin.Pala@oskar.cz>

> i'm trying to set postfix with dccifd before-queue content filter as described in dccifd manual page, however i have some strange problems - dccifd refuses the message right after DATA command as 'bad dccifd command sequence':

> MAIL FROM:<test@test.cz> SIZE=384
> 250 Ok
> RCPT TO:<foo@bar.cz>
> 250 Ok
> DATA
> 503 Bad dccifd command sequence

I see the problem.  Dccifd expects SMTP commands to comply with section
4.1.2 of RFC 821:

         This also applies to any symbols representing parameter values,
         such as "TO" or "to" for the forward-path.  Command codes and
         the argument fields are separated by one or more spaces.

and section 2.4 of RFC 2812:

   SMTP commands and replies have a rigid syntax.  All commands begin
   with a command verb.  All Replies begin with a three digit numeric
   code.  In some commands and replies, arguments MUST follow the verb
   or reply code.  Some commands do not accept arguments (after the
   verb), and some reply codes are followed, sometimes optionally, by
   free form text.  In both cases, where text appears, it is separated
   from the verb or reply code by a space character.  

I interpret that to mean that a blank should separate appear after
"FROM:" and before "<test@test.cz>" as well as after "TO:" and
before "<foo@bar.cz>"

However, the First Rule, "Be liberal in what you accept and ..."
requires that dccifd accept "MAIL FROM:<test@test.cz>"
I think this patch to the 1.3.15 version of dccifd/dccifd.c fixes it:


*** dccifd.c    Tue Aug  9 12:07:54 2005
--- new-dccifd.c        Mon Aug 15 11:49:22 2005
***************
*** 2499,2510 ****
                        return ptp->verb;
                }
  
                if (ptp->parm_len) {
-                       /* require parameter */
-                       i = strspn(pp, " \t");
-                       if (i == 0)
-                               continue;
-                       pp += i;
                        if (*pp == '\r') {
                                SMTP_REPLY(501_NO_ARG);
                                return SMTP_VERB_ERR;
--- 2499,2509 ----
                        return ptp->verb;
                }
  
+               i = strspn(pp, " \t");
+               if (i == 0)
+                       continue;
+               pp += i;
                if (ptp->parm_len) {
                        if (*pp == '\r') {
                                SMTP_REPLY(501_NO_ARG);
                                return SMTP_VERB_ERR;
***************
*** 2514,2525 ****
                                return SMTP_VERB_ERR;
                        }
                        pp += ptp->parm_len;
                }
- 
-               i = strspn(pp, " \t");
-               if (i == 0)
-                       continue;
-               pp += i;
  
                *ppp = pp;
                *pep = strpbrk(pp, " \t\r");
--- 2513,2520 ----
                                return SMTP_VERB_ERR;
                        }
                        pp += ptp->parm_len;
+                       pp += strspn(pp, " \t");
                }
  
                *ppp = pp;
                *pep = strpbrk(pp, " \t\r");




More information about the DCC mailing list

Contact vjs@rhyolite.com by mail or use the form.