libmiter version

Vernon Schryver vjs@calcite.rhyolite.com
Sat May 20 02:51:41 UTC 2006


> From: "Rose, Bobby" <brose@med.wayne.edu>

> In addition to using DCC as a sendmail milter, I also use Snertsoft's
> milter-sender.  The current version of milter-sender requires that
> sendmail and libmilter be compiled with 
> APPENDDEF(`confENVDEF', `-DSMFI_VERSION=4')

Sendmail.org's default is "#define SMFI_VERSION 2" and no alternatives
are documented.  Changing that sort of undocumented thing can sometimes
be good and necessary, but it is often big mistake.  Note that I know
nothing about Snertsoft's milter-sender but what I've seen with a few
minutes of poking around on the web.

> To implment milter specific SMTP commands using the libmilter
> xxfi_unknown handler.  The problem is that changing the sendmail milter
> version definition breaks dccm which seems to require version 2.  Is it
> possible for dccm to have a ifdef for version 4 without breaking it?

What you should have done when starting to hack sendmail internals and
voilating the API (what you are doing whether you realize or admit it
or not), is to consult the sendmail source and documentation.  When I
do that, I see that mismatches of SMFI_VERSION values between the
milter and the MTA cause one or the other to give up.  This is all
inside the sendmail source, either MTA or libmilter.a, and outside the
ken of the milter itself.  That's probably why dccm does not work with
your version of sendmail and libmiter.a.

Dccm merely uses libmilter.a and doesn't know what SMFI_VERSION might
mean.  Dccm includes the standard block of code prescribed by the milter
documention.  You can see it with the hits of
http://www.google.com/search?q=SMFI_VERSION+site:sendmail.org
Since dccm is not built as part of sendmail, APPENDDEF() has no effect.
dccm gets SMFI_VERSION from mfapi.h, sometimes .../sendmail/libmilter/mfapi.h.
If you want dccm and other external milters to use SMFI_VERSION=4, you
will probably need to modify mfapi.h and then rebuild dccm and any other
external milters.

I have only one clue about how the result might work.  When and if the
Sendmail.org folks think SMFI_VERSION=4 is ready for prime time, I
assume they will change that line in mfapi.h or at least document 
APPENDDEF(SMFI_VERSION).

I don't think there's anything wrong with hacking sendmail internals,
provided you remember two things.  I've done it professionally.
The two things to remember are "If you break it, you own it" and
"Warranty void if seal is broken."


Vernon Schryver    vjs@rhyolite.com



More information about the DCC mailing list

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