This one time, at band camp, Andreas Metzler said:
> On 2005-06-18 Stephen Gran <[EMAIL PROTECTED]> wrote:
> 
> > As for the sendmail version, I think you're right - just defining them
> > in the milter after including the clamav-config.h ought to do it
> > (although it will break things for anyone compiling clamav with a
> > non-debian sendmail installed).
> 
> > Hmm, have to think about this.  Maybe this needs grotesque Makefile
> > hackery - look for an environment variable, otherwise run gcc with
> > -DNO_SENDMAIL or something, and define _that_ in the milter to mean
> > SENDMAIL_VERSION=$(debian_sendmail_version).  That's starting to feel
> > like overkill, but it would easily allow people to rebuild against a
> > non-standard sendmail, which feels like the right thing.
> 
> I doubt whether there is a working solution for this, as your aims
> are:
> 
> #1 if /usr/sbin/sendmail does not exist build as if
>   ${sendmail version in sid} was installed

This one is easy - it must exist, according to policy (which I have just
reread, thanks to you :)

> #2 if /usr/sbin/sendmail exists but is not sendmail (exim, qmail,
>   esmtp, ...)  build as if ${sendmail version in sid} was installed

Yes.

> #3 if /usr/sbin/sendmail exists and is a real sendmail retrieve version
>   information from binary and hardcode _these_ values.

And yes.

> On top of that do not forget to add the corresponding dependency
> information.

And this is another hard part.  If we build with SENDMAIL_VERSION
defined to something (whether extracted from a real sendmail, or hacked
in), how do we express this in dependencies?  I think, we have to
Conflict: sendmail (<< SENDMAIL_VERSION), rather than 
Depends: sendmail (>= SENDMAIL_VERSION)

in order to make it work cleanly.  The problem here, I think, is that
the milter doesn't actually depend on sendmail to run now that the
milter library is properly built as a shared library in a seperate
package.  It will, however, introduce behavior that older sendmail's
can't cope with. 

> I guess that just detecting whether /usr/sbin/sendmail is a real sendmail
> is a quite hard problem without elegant solution. Which is why I'd
> suggest to drop requirement #3.
>                 cu andreas

I think we can do this in clamav-milter.c:
#ifundef SENDMAIL_VERSION_A
#define SENDMAIL_VERSION_A 8
#endif

#ifundef SENDMAIL_VERSION_B
#define SENDMAIL_VERSION_B 13
#endif

after including clamav-config.h, without introducing any breakage.  In
combination with the Conflicts: above, I think this will produce the
correct behavior.

Does this seem reasonable to you?
-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        [EMAIL PROTECTED] |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

Reply via email to