libmiter version

Rose, Bobby brose@med.wayne.edu
Sun May 21 15:04:13 UTC 2006


I'm posting the question with Snertsoft also about this but here is what
they have in the changelog that explains what they are doing.  It does
sound like sendmail allows it because sendmail isn't really being
hacked.


Added experimental code to implment milter specific SMTP
	commands using the libmilter xxfi_unknown handler. This
	requires BOTH sendmail and libmilter be built with
   	
   		APPENDDEF(`confENVDEF', `-DSMFI_VERSION=4')

	specified in your devtools/Site/site.config.m4 file. This
	would allow for an administrator to get and/or remove
	individual cache entries without having to stop the milter.
   	
   	Command processing is restricted only to hosts that have
   	either:
   	
   		milter-sender-command:ip	OK
   		milter-sender-command:hostname	OK
  	
   	defined in the access.db. Also if you use FEATURE(`great_pause')
   	you will require either:
   	
   		GreatPause:ip			0
   		GreatPause:hostname 		0
   		
   	For example you should have this at a minimum:
   	
   		milter-sender-command:127.0.0.1	OK
   		GreetPause:127.0.0.1		0
   		
   	The extra SMTP commands are:
   	
   		milter-sender cache-get $KEY
   		milter-sender cache-remove $KEY
   		
   	Where $KEY is the cache key to get or remove. Due to design
	limitations in the libmilter API, a successful command is
	returned as 500 5.0.0 and unsuccessful command will be 500
	5.y.z and a textual response.
   	
   	See contrib/milter-cmd.sh for an example shell script using
	nc(1) to provide a simple command line interface.




 

-----Original Message-----
From: dcc-admin@rhyolite.com [mailto:dcc-admin@rhyolite.com] On Behalf
Of Vernon Schryver
Sent: Friday, May 19, 2006 10:52 PM
To: dcc@rhyolite.com
Subject: Re: libmiter version

> 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
_______________________________________________
DCC mailing list      DCC@rhyolite.com
http://www.rhyolite.com/mailman/listinfo/dcc




More information about the DCC mailing list

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