Jan Pieter Cornet wrote:

>Also, your code assumes you cannot call smfi_setreply in the helo()
>callback, but that assumption is wrong. At least, it is according to
>the milter API documentation. It's probably very useful to set a reply
>after HELO!
>


Ok, here are part of the revised diffs to mimedefang.c:

*** 556,561 ****

--- 559,595 ----

       data->heloArg = NULL;

     }

     data->heloArg = strdup_with_log(helohost);

+

+     if (doHeloCheck) {

+       char buf2[SMALLBUF];

+       int n = MXHeloOK(MultiplexorSocketName, buf2, data->hostip,

+                        data->hostname, data->heloArg);

+       if (n == 0) {

+           set_dsn(ctx, buf2, 5);

+           /* We reject connections from this relay */

+           cleanup(ctx);

+           DEBUG_EXIT("helo", __LINE__, "SMFIS_REJECT");

+           return SMFIS_REJECT;

+       }

+       if (n < 0) {

+           set_dsn(ctx, buf2, 4);

+           cleanup(ctx);

+           DEBUG_EXIT("helo", __LINE__, "SMFIS_TEMPFAIL");

+           return SMFIS_TEMPFAIL;

+       }

+       if (n == 2) {

+           set_dsn(ctx, buf2, 2);

+           cleanup(ctx);

+           return SMFIS_ACCEPT;

+       }

+       if (n == 3) {

+           set_dsn(ctx, buf2, 2);

+           cleanup(ctx);

+           return SMFIS_DISCARD;

+       }

+     }

+

+     DEBUG_EXIT("helo", __LINE__, "SMFIS_CONTINUE");

     return SMFIS_CONTINUE;

 }



I'm wondering, however, if this is the correct handling... What about "n
== 1"?

Suggestion for the future... perhaps have an enum for these values
that's a little more intuitive.

-Philip




_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to