Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Thread

DKIM support

DKIM support

2008-09-25 by Ondrej Valousek

Just trying to compile with DKIM support but I can not - compiler is
complaining about undefined "bool" type.
That's strange, because DKIM milter heavily depends on bool and I
compiled it w/o any problems. Does anyone know?
Thanks,

Ondrej

Re: [milter-greylist] DKIM support

2008-09-25 by Ondrej Valousek

And the answer is:
DKIM-milter checks for compiler C99 compliance and for stdbool.h
existence. If not found, bool is defined like this:
/*
**  Define bool, true, false (from the C99 standard)
*/

# if SM_CONF_STDBOOL_H
#  include <stdbool.h>
# else /* SM_CONF_STDBOOL_H */
#  ifndef __cplusplus
    typedef int bool;

Obviously, there is nothing like that in milter-greylist package so
hence the compiler errors.
Can we have it fixed please?
Thanks,

Ondrej

Ondrej Valousek wrote:
Show quoted textHide quoted text
>
> Just trying to compile with DKIM support but I can not - compiler is
> complaining about undefined "bool" type.
> That's strange, because DKIM milter heavily depends on bool and I
> compiled it w/o any problems. Does anyone know?
> Thanks,
>
> Ondrej
>
>

Re: [milter-greylist] DKIM support

2008-09-25 by Emmanuel Dreyfus

On Thu, Sep 25, 2008 at 04:31:10PM +0200, Ondrej Valousek wrote:
> Obviously, there is nothing like that in milter-greylist package so
> hence the compiler errors.
> Can we have it fixed please?

Sure. Will you contribute the patch?

-- 
Emmanuel Dreyfus
manu@...

Re: [milter-greylist] DKIM support

2008-09-25 by Ondrej Valousek

I would like to, really, but unfortunately I am not very familiar with
configure/configure.ac scripts.
I would happily contribute C patch, but that's not what we need here....
Anyone else?

Emmanuel Dreyfus wrote:
Show quoted textHide quoted text
>
> On Thu, Sep 25, 2008 at 04:31:10PM +0200, Ondrej Valousek wrote:
> > Obviously, there is nothing like that in milter-greylist package so
> > hence the compiler errors.
> > Can we have it fixed please?
>
> Sure. Will you contribute the patch?
>
> -- 
> Emmanuel Dreyfus
> manu@... <mailto:manu%40netbsd.org>
>
>

Re: [milter-greylist] DKIM support

2008-09-26 by Ondrej Valousek

Ok, here is the patch:

diff -u milter-greylist.bak/config.h.in milter-greylist/config.h.in
--- milter-greylist.bak/config.h.in     2007-08-20 15:14:12.000000000 +0200
+++ milter-greylist/config.h.in 2008-09-26 13:23:30.000000000 +0200
@@ -90,6 +90,10 @@
 /* we use libspf_alt */
 #undef HAVE_SPF_ALT

+/* we use libdkim */
+#undef USE_DKIM
+
+
 /* Define to 1 if `stat' has the bug that it succeeds when given the
    zero-length file name argument. */
 #undef HAVE_STAT_EMPTY_STRING_BUG
@@ -157,6 +161,9 @@
 /* Define to 1 if `vfork' works. */
 #undef HAVE_WORKING_VFORK

+/* Define to 1 if stdbool.h exists. */
+#undef HAVE_STDBOOL_H
+
 /* Define to 1 if `lstat' dereferences a symlink specified with a trailing
    slash. */
 #undef LSTAT_FOLLOWS_SLASHED_SYMLINK
Only in milter-greylist: config.status
diff -u milter-greylist.bak/configure.ac milter-greylist/configure.ac
--- milter-greylist.bak/configure.ac    2008-08-21 23:05:35.000000000 +0200
+++ milter-greylist/configure.ac        2008-09-26 13:48:51.000000000 +0200
@@ -91,11 +91,6 @@
 AC_ARG_WITH(openssl,
        [  --with-openssl=DIR  Find OpenSSL in DIR],
        [LDFLAGS=$LDFLAGS" -L$withval/lib -Wl,$rpath$withval/lib"])
-AC_ARG_WITH(libdkim,
-       [  --with-libdkim=DIR  Find Sendmail's libdkim in DIR],
-       [CFLAGS=$CFLAGS" -I$withval/include -DUSE_DKIM"
-           LIBS="-lcrypto -ldkim $LIBS"
-           LDFLAGS=$LDFLAGS" -L$withval/lib -Wl,$rpath$withval/lib"])
 AC_ARG_WITH(openldap,
        [  --with-openldap=DIR  Find OpenLDAP in DIR],
        [CFLAGS=$CFLAGS" -I$withval/include -DUSE_LDAP -DLDAP_DEPRECATED"
@@ -119,7 +114,7 @@

 # Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h
strings.h sys/socket.h sys/time.h syslog.h unistd.h sys/param.h netdb.h
getopt.h sys/cdefs.h arpa/nameser.h])
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h
strings.h sys/socket.h sys/time.h syslog.h unistd.h sys/param.h netdb.h
getopt.h sys/cdefs.h arpa/nameser.h stdbool.h])

 # Checks for typedefs, structures, and compiler characteristics.
 AC_TYPE_PID_T
@@ -263,6 +258,27 @@
 LDFLAGS=$SAVEDLDFLAGS
 CFLAGS=$SAVEDCFLAGS

+# Try to configure for libdkim
+SAVEDLDFLAGS=$LDFLAGS
+SAVEDCFLAGS=$CFLAGS
+AC_ARG_WITH(libdkim,
+       [  --with-libdkim=DIR  Find Sendmail's libdkim in DIR],
+       [LDFLAGS=$LDFLAGS" -L$withval/lib -Wl,$rpath$withval/lib"
+           CFLAGS=$CFLAGS" -I$withval/include"
+           AC_CHECK_LIB([dkim -lsm -lcrypto], dkim_init, [
+               SAVEDLDFLAGS=$LDFLAGS
+               SAVEDCFLAGS=$CFLAGS
+               LIBS=$LIBS" -ldkim -lcrypto"
+               AC_DEFINE([USE_DKIM], [], [we use libdkim])
+               ], [echo "libdkim not found, check config.log for details"
+                   echo "Remove --with-dkim to build without DKIM support"
+                   exit 1;])
+])
+LDFLAGS=$SAVEDLDFLAGS
+CFLAGS=$SAVEDCFLAGS
+
+
+
 AC_ARG_ENABLE(rpath,
        [  --disable-rpath      do not hardcode runtime library paths],
        [if test x$enableval = xno; then
Common subdirectories: milter-greylist.bak/CVS and milter-greylist/CVS
diff -u milter-greylist.bak/dkimcheck.c milter-greylist/dkimcheck.c
--- milter-greylist.bak/dkimcheck.c     2008-08-21 23:05:35.000000000 +0200
+++ milter-greylist/dkimcheck.c 2008-09-26 13:46:01.000000000 +0200
@@ -40,6 +40,9 @@
 #endif
 #endif
 #include <ctype.h>
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
 #include <dkim.h>
 #include <errno.h>
 #include <err.h>
diff -u milter-greylist.bak/milter-greylist.h
milter-greylist/milter-greylist.h
--- milter-greylist.bak/milter-greylist.h       2008-08-21
23:05:35.000000000 +0200
+++ milter-greylist/milter-greylist.h   2008-09-26 13:57:43.000000000 +0200
@@ -38,6 +38,9 @@
 #include <netdb.h>

 #ifdef USE_DKIM
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
 #include <dkim.h>
 #endif


Ondrej Valousek wrote:
Show quoted textHide quoted text
>
> I would like to, really, but unfortunately I am not very familiar with
> configure/configure.ac scripts.
> I would happily contribute C patch, but that's not what we need here....
> Anyone else?
>
> Emmanuel Dreyfus wrote:
> >
> > On Thu, Sep 25, 2008 at 04:31:10PM +0200, Ondrej Valousek wrote:
> > > Obviously, there is nothing like that in milter-greylist package so
> > > hence the compiler errors.
> > > Can we have it fixed please?
> >
> > Sure. Will you contribute the patch?
> >
> > --
> > Emmanuel Dreyfus
> > manu@... <mailto:manu%40netbsd.org> <mailto:manu%40netbsd.org>
> >
> >
>
>

Re: [milter-greylist] DKIM support

2008-09-26 by Emmanuel Dreyfus

On Fri, Sep 26, 2008 at 02:00:39PM +0200, Ondrej Valousek wrote:
> Ok, here is the patch:

Congratulations, you are now an autoconf hacker! :-)

-- 
Emmanuel Dreyfus
manu@...

Re: [milter-greylist] DKIM support

2008-09-26 by Ondrej Valousek

Yes, it wasn't that difficult to understand, eventually :-)

Emmanuel Dreyfus wrote:
Show quoted textHide quoted text
>
> On Fri, Sep 26, 2008 at 02:00:39PM +0200, Ondrej Valousek wrote:
> > Ok, here is the patch:
>
> Congratulations, you are now an autoconf hacker! :-)
>
> -- 
> Emmanuel Dreyfus
> manu@... <mailto:manu%40netbsd.org>
>
>

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.