[milters] Archive

Lists Index Date Thread Search

Article: 935
From: Anthony Howe
Date: 2006-05-21 12:25:42 -0400
Subject: Re: milter-sender and SMFI_VERSION

Removal...........: milters-request@milter.info?subject=remove
More information..: http://www.milter.info/#Support

Rose, Bobby wrote:
> I'm currently running 1.08 of milter-sender and lately my cache db has
> been getting corrupted and I resolve it by stopping the milter and
> removing the cache database and restarting.  I'm not sure why it's been
> happening but I noticed that version 1.10 was posted so I decided to
> update so as to be current.  But I discovered that I have to change
> SMFI_VERSION in my sendmail build and doing so breaks the other milter

You don't HAVE to enable SMFI_VERSION=4 for milter-sender. You only need 
to if you really want to try the experimental feature that provides SMTP 
command extensions for managing the cache without having to restart the 
milter. milter-sender/1.10 will happily work with a standard libmilter 
SMFI_VERSION=2. Just some extras will be off.

> that I use called DCC (http://www.dcc-servers.net/dcc/)   After I
> recompile sendmail, milter-sender is fine but DCC  logs this error
> DCC: smfi_register: version mismatch application: 2 != milter: 4

Does DCC countinue to run, in which case its only a warning that can be 
ignored. If DCC stops, it should be a simple change. Find the 
smfi_register() call your DCC milter. Its probably something like this 
in their code, in main():

	if (smfi_register(milter_dcc) == MI_FAILURE)
		/* error action here */

and change as follows

	/* Figure out libmilter runtime version. */
	for (milter_dcc.xxfi_version = 4; 2 <= milter_dcc.xxfi_version; 
milter_dcc.xxfi_version--) {
		if (smfi_register(milter_dcc) == MI_SUCCESS)

	if (milter_dcc.xxfi_version < 2) {
		/* error action here */

Where ever you see milter_dcc above, replace it with the name that 
originally appeared in the call to smfi_register(something).

> Now I have posted this question with the DCC list and this was the
> response but then this also caused me to wonder about other milters that
> people might be running in conjunction with the newer version of
> milter-sender that might also be broken.  I've rolled back my
> milter-sender version back to 1.08 for now since I prefer to have both
> milters in use.
> -------------------------------
> 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
> <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

Well Claus of sendmail.org tells me the NEW features won't be enable 
unless a sendmail 8.14 is released, which is a long way off from 
happening. I've been begging for a few months now.

Of course no one can test/use the new features unless they do the 
APPENDDEF() as I outlined and I don't think anyone KNOWS about the new 
features unless they use a Snert milter like milter-cli. I've been 
running with SMFI_VERSION=4 for a good year now and have about 3 or 4 
milters that take advantage of the extra handlers xxfi_unknown and 
xxfi_data, when enabled. I've had no problems with sendmail or libmilter.

Remember though when you update your site.config.m4, you have to rebuild 
sendmail, libmilter, and the milters you use so that they all agree. All 
the Snert milters have code similar to that above that detect the 
runtime version and happily run with SMFI_VERSION=2, 3, or 4.

> assume they will change that line in mfapi.h or at least document
> I don't think there's anything wrong with hacking sendmail internals,

You don't have to hack the sendmail internals. Just rebuild with the 
redefined SMFI_VERSION and modify/inform 3rd party milters how to handle 
superior version numbers.

> 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."

And what does that mean with respect to software? You'll be fine if you 
save your original .c file first, make the changes, test them, generate 
a patch, and submit it to the dcc milter author.

Anthony C Howe          Skype: SirWumpus                    SnertSoft
+33 6 11 89 73 78         AIM: SirWumpus    Sendmail Milter Solutions
http://www.snert.com/     ICQ: 7116561

Lists Index Date Thread Search