Yahoo Groups archive

Milter-greylist

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

Thread

milter-greylist 4.4 alpha1 is available

milter-greylist 4.4 alpha1 is available

2012-02-21 by manu@netbsd.org

Hello everybody

Time has come for a new stable release. Here is 4.4 alpha1, please test and
report bugs.

Here is the ChangeLog since 2.2:

4.4a1
        Typo fixes in man pages (Bernhard Schneider)
        localaddr option so that Postifix user can use spf self
        Allow filtering header and body against LDAP or CURL gathered properties
        Add format string to report last matching LDAP or CURL propery
        Fix memory corruption bug
        Add a addfooter action clause in ACL, to add mail a footer
        Allow per-dacl maxpeek setting, set by maxpeer action clause in racl
        Add LDAP or CURL gathered property substitution in format strings
        Add continue type ACL
        p0f v3 support
4.3.9
        Fix wrong message size tracking, causing bug in spamd (Attila Bruncsak)
        Fix ratelimit sliding window for computing average
        Fix p0f port byte order (Enrico Scholz)
        Fix milter-greylist.m4 for newer Sendmail (Joe Pruett)
        Fix autoconf warning about --datarootdir (R P Herrold)
        Add spamassassin toggling to the .spec file (Adam Katz)
        Fix DKIM (John Wood, Jörgen Lundman)
4.3.8
        Fix spamd hang if message contains NULL (Enrico Scholz)
        Format string for SpamAssassin score
        Build fix for Solaris
        Send the queueid to spamd (Petar Bogdanovic)
        Close-on-exec sockets to avoid file shortage with stat (Enrico Scholz)
        Add a missing comma in X-Greylist (Kouhei Sutou)
        Look for liresolv in ${libdir} instead of /usr/lib (DUFRESNE VINCENT)
        Fix SPF on Postfix (Kouhei Sutou)
4.3.7
        Build fix when SPF is enabled
        Ratelimit on SMTP sessions and data size
        Fix missing ratelimit initialization 
        Test for legacy config file timestamp so that it does not loop reloading
4.3.6
        New rate limiting feature
        Add a domatch keyword to ldapconf to enable ldapcheck matches
        Network byte order byg fix in p0f code (Adrian Dabrowski)
        Fix MX clause wrong results caused by thread unsafety (Hajimu UMEMOTO)
        Do not reject message if p0f cannot identiy the remote system
4.3.5
        Update .spec file for libcurl, GeoIP and p0f support (Chris Bennett)
        Really support dkim self and dkim none clauses
        Better configure test to avoid resolver memory leaks (Hajimu UMEMOTO)
        Fix p0f wrong results caused by thread unsafety (Enrico Scholz)
        Fix GeoIP related crashes caused by thread unsafety (Enrico Scholz)
        Start as root and drop priv later on RedHat (Ole Hansen)
        Fix dumpfile argument on command line (Ole Hansen)
        Fix missing reason for whitelisting (Attila Bruncsak)
        Wait 5 seconds before stopping, for database dump (Attila Bruncsak)
        Add mx ACL clause (Rudy Eschauzier)
        Do not use socket mode for the PID file (Kouhei Sutou)
        Fix tarpit deadlock (Kouhei Sutou)
4.3.4
        Restore not ACL keyword functionnality (Benoit Branciard)
        Fix uninitialized thread condition variable (Petar Bogdanovic)
        Fix Debian startup script
        New tarpit feature (Kouhei Sutou)
        Support make install as unprivilegied user (Kouhei Sutou)
4.3.3 
        Fix unallocated memory use for ldapcheck and urlcheck property matching
        Fix off-by one bug in DATA stage filtering (Pascal Lalonde)
        Allow ACL override by ldapcheck clauses (Piotr Wadas)
        Header for autowhitelisted messages bug fix (Attila Bruncsak)
        Fix MX sync stop on config reload (Attila Bruncsak, Hajimu UMEMOTO)
        Improve Debian startup script (Adam Katz)
        Make SpamAssassin headers Sendmail-like (Petar Bogdanovic)
4.3.2
        Merge autowhite and greylist databases (Rudy Eschauzier)
4.3.1
        Log ACL id instead of line number (John Thiltges)
        Fix LDAP thread safety issues
        Make LDAP querries timeout configurable
        Make MX sync timeout peer-configurable (Attila Bruncsak)
        Fix a crash when LDAP server is down
        Update contributor list
        Make sure dump is really on disk even with a buggy ext4fs
        Build with OpenLDAP but not CURL (Matthias Scheler)
        Do not complain about unreachable p0f daemon if it is unconfigured
        Fix buffer overflow in SpamAssassin support (Enrico Scholz)
        Fix socket mode in sample config file
        Build fix on tru64 and Solaris
        4.2 Branch forked


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-21 by shuttlebox

On Tue, Feb 21, 2012 at 7:22 AM,  <manu@...> wrote:
> Hello everybody
>
> Time has come for a new stable release. Here is 4.4 alpha1, please test and
> report bugs.

I can't compile with curl support, without it it works.

/opt/csw/bin/gcc-4.6 -mtune=i686 -O2 -pipe -m32 -march=i386 -Wall
-I/opt/csw/lib/include -DUSE_CURL -I/opt/csw/lib/include -DUSE_GEOIP
-I/opt/csw/lib/include -DUSE_FD_POOL -DHAVE_DATA_CALLBACK -DUSE_DNSRBL
-DCONFFILE=\"/etc/opt/csw/greylist.conf\"
-DDUMPFILE=\"/var/opt/csw/miltergreylist/milter-greylist/greylist.db\"
-D_BSD_SOURCE -I. -I. -I/opt/csw/include -I/opt/csw/include  -c -o
urlcheck.o urlcheck.c
urlcheck.c: In function 'find_boundary':
urlcheck.c:302:16: error: 'struct line' has no member named 'l_lines'
urlcheck.c: In function 'curl_post':
urlcheck.c:365:35: error: 'struct line' has no member named 'b_lines'
urlcheck.c:391:8: error: 'struct line' has no member named 'b_list'
urlcheck.c:395:35: error: 'struct line' has no member named 'b_lines'
gmake: *** [urlcheck.o] Error 1
gmake: Leaving directory
`/home/bonivart/opencsw/miltergreylist/trunk/work/solaris9-i386/build-isa-i386/milter-greylist-4.4a1'
gmake[1]: *** [build-work/solaris9-i386/build-isa-i386/milter-greylist-4.4a1/Makefile]
Error 2
gmake[1]: Leaving directory `/home/bonivart/opencsw/miltergreylist/trunk'
gmake: *** [build-isa-i386] Error 2

/peter

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-22 by shuttlebox

On Wed, Feb 22, 2012 at 3:33 AM,  <manu@...> wrote:
> shuttlebox <shuttlebox@...> wrote:
>
>> I can't compile with curl support, without it it works.
>
> please patch:
> http://ftp.espci.fr/shadow/manu/mg44a1p1.patch

Now it compiles! Thanks.

/peter

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-23 by Gary Faith

I attempted to compile after using the following command to configure
milter-greylist
 
./configure --with-libspf2=/usr/local --enable-p0f3
--enable-spamassassin --sysconfdir=/etc --localstatedir=/var
 
and I received this error:
 
mscan:~/downloads/milter-greylist/milter-greylist-4.4a1 # make
gcc -g -O2 -Wall -I/usr/local/include -DUSE_P0F -DHAVE_P0F3 -DUSE_SPAMD
-DCONFFILE=\"/etc/mail/greylist.conf\"
-DDUMPFILE=\"/var/milter-greylist/greylist.db\" -D_BSD_SOURCE -I. -I.   
-c -o spamd.o spamd.c
spamd.c: In function �spamd_check�:
spamd.c:195: error: �struct line� has no member named �l_lines�
make: *** [spamd.o] Error 1

It wasn't a big deal because I realized that it was using spamd and the
server is running spamassassin without using the spamd daemon.  So I
modified the line to below

./configure --with-libspf2=/usr/local --enable-p0f3 --sysconfdir=/etc
--localstatedir=/var

since I didn't need spamd and it compiled correctly.  Thought I would
mention the error just so you know.
 
Gary Faith

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-24 by manu@netbsd.org

Gary Faith <gafaith@...> wrote:

> since I didn't need spamd and it compiled correctly.  Thought I would
> mention the error just so you know.

Here is the fix. It happened because I do not run millter-greylist with
all options, therefore I missed it:

Index: spamd.c
===================================================================
RCS file: /cvsroot/milter-greylist/spamd.c,v
retrieving revision 1.21
diff -r1.21 spamd.c
195c195
<               if (spamd_write(sock, l->l_lines, l->l_len) == -1)
---
>               if (spamd_write(sock, l->l_line, l->l_len) == -1)


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-24 by Gary Faith

That fixed the compile problem.
 
Gary


>>> <manu@...> 2/23/2012 9:43 PM >>>
  
Gary Faith  wrote:

> since I didn't need spamd and it compiled correctly. Thought I would
> mention the error just so you know.

Here is the fix. It happened because I do not run millter-greylist with
all options, therefore I missed it:

Index: spamd.c
===================================================================
RCS file: /cvsroot/milter-greylist/spamd.c,v
retrieving revision 1.21
diff -r1.21 spamd.c
195c195
< if (spamd_write(sock, l->l_lines, l->l_len) == -1)
---
> if (spamd_write(sock, l->l_line, l->l_len) == -1)

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz 
manu@...g ( mailto:manu%40netbsd.org )

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-24 by manu@netbsd.org

Gary Faith <gafaith@...> wrote:

> That fixed the compile problem.

Great, I wonder if it is wise to do an alpha 2 right now: there may be
some compiling issue remaining.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

RE: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-24 by Bruncsak, Attila

> Hello everybody
> 
> Time has come for a new stable release. Here is 4.4 alpha1, please test and
> report bugs.
> 

Hello,

Since the previous version 4.3.9 the definition of priv_cur_rcpt
the member of struct lmfi_priv changed from pointer to string
to string width fix length allocation.

This changes were not reflected in acl.c and because of that
the default log format has changed.

Attached the patch which fixes that bug
via reflecting the definition change in acl.c.

Bests,
Attila

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-24 by shuttlebox

On Fri, Feb 24, 2012 at 7:19 AM,  <manu@...> wrote:
> Gary Faith <gafaith@...> wrote:
>
>> That fixed the compile problem.
>
> Great, I wonder if it is wise to do an alpha 2 right now: there may be
> some compiling issue remaining.

CONFIGURE_ARGS  = --prefix=/opt/csw
CONFIGURE_ARGS += --sysconfdir=/etc/opt/csw
CONFIGURE_ARGS += --with-user=`/usr/xpg4/bin/id -u`
CONFIGURE_ARGS += --with-conffile=/etc/opt/csw/greylist.conf
CONFIGURE_ARGS += --enable-dnsrbl
CONFIGURE_ARGS += --enable-stdio-hack
CONFIGURE_ARGS += --localstatedir=/var/opt/csw
CONFIGURE_ARGS += --with-libGeoIP=/opt/csw/lib
CONFIGURE_ARGS += --with-libspf2=/opt/csw/lib
CONFIGURE_ARGS += --mandir=/opt/csw/share/man
CONFIGURE_ARGS += --with-libcurl=/opt/csw/lib

And Gary used:

./configure --with-libspf2=/usr/local --enable-p0f3
--enable-spamassassin --sysconfdir=/etc --localstatedir=/var

That leaves --enable-mx, --enable-drac and --enable-postfix. I added
them even though I don't need them just to test and had trouble with
drac:

/opt/csw/bin/gcc-4.6 -mtune=i686 -O2 -pipe -m32 -march=i386 -Wall
-I/opt/csw/lib/include -DUSE_CURL -I/opt/csw/lib/include -DUSE_GEOIP
-I/opt/csw/lib/include -DUSE_FD_POOL -DUSE_DRAC -DHAVE_DATA_CALLBACK
-DUSE_DNSRBL -DUSE_MX -DUSE_POSTFIX
-DCONFFILE=\"/etc/opt/csw/greylist.conf\"
-DDUMPFILE=\"/var/opt/csw/milter-greylist/greylist.db\" -D_BSD_SOURCE
-I. -I. -I/opt/csw/include -I/opt/csw/include  -c -o milter-greylist.o
milter-greylist.c
milter-greylist.c: In function 'real_header':
milter-greylist.c:809:11: warning: variable 'stat' set but not used
[-Wunused-but-set-variable]
milter-greylist.c: In function 'real_body':
milter-greylist.c:886:11: warning: variable 'stat' set but not used
[-Wunused-but-set-variable]
milter-greylist.c: In function 'real_eom':
milter-greylist.c:988:11: warning: variable 'stat' set but not used
[-Wunused-but-set-variable]
milter-greylist.c: In function 'gmtoffset':
milter-greylist.c:2040:2: warning: implicit declaration of function
'gmtime_r' [-Wimplicit-function-declaration]
milter-greylist.c:2041:2: warning: implicit declaration of function
'localtime_r' [-Wimplicit-function-declaration]
milter-greylist.c: In function 'check_drac':
milter-greylist.c:2218:2: warning: implicit declaration of function
'dbopen' [-Wimplicit-function-declaration]
milter-greylist.c:2218:41: error: 'O_SHLOCK' undeclared (first use in
this function)
milter-greylist.c:2218:41: note: each undeclared identifier is
reported only once for each function it appears in
milter-greylist.c:2226:2: warning: passing argument 2 of 'ddb->get'
from incompatible pointer type [enabled by default]
milter-greylist.c:2226:2: note: expected 'struct DB_TXN *' but
argument is of type 'struct DBT *'
milter-greylist.c:2226:2: error: too few arguments to function 'ddb->get'
milter-greylist.c:2227:2: error: too few arguments to function 'ddb->close'
milter-greylist.c: In function 'fstring_expand':
milter-greylist.c:2568:2: warning: implicit declaration of function
'strtok_r' [-Wimplicit-function-declaration]
milter-greylist.c:2568:15: warning: assignment makes pointer from
integer without a cast [enabled by default]
gmake: *** [milter-greylist.o] Error 1

Removing drac, it built.

/peter

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-25 by manu@netbsd.org

shuttlebox <shuttlebox@...> wrote:

> milter-greylist.c: In function 'gmtoffset':
> milter-greylist.c:2040:2: warning: implicit declaration of function
> 'gmtime_r' [-Wimplicit-function-declaration]
> milter-greylist.c:2041:2: warning: implicit declaration of function
> 'localtime_r' [-Wimplicit-function-declaration]
> milter-greylist.c: In function 'check_drac':

gmtime_r() and localtime_r() are suppossed to be in <time.h>
Please look at the file and check why they are not defined. There is
probably an #ifdef

> milter-greylist.c:2218:2: warning: implicit declaration of function
> 'dbopen' [-Wimplicit-function-declaration]
> milter-greylist.c:2218:41: error: 'O_SHLOCK' undeclared (first use in
> this function)

dbopen() is supposed to come from <db.h> or <db_185.h>, I suspect the
right file is not included at all here. Where is dbopen() defined at
yours?

> milter-greylist.c:2568:2: warning: implicit declaration of function
> 'strtok_r' [-Wimplicit-function-declaration]

strtok_r() is supposed to be in <string.h>, could you check what
happened?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-25 by shuttlebox

On Sat, Feb 25, 2012 at 3:58 AM,  <manu@...> wrote:
>> milter-greylist.c:2218:2: warning: implicit declaration of function
>> 'dbopen' [-Wimplicit-function-declaration]
>> milter-greylist.c:2218:41: error: 'O_SHLOCK' undeclared (first use in
>> this function)
>
> dbopen() is supposed to come from <db.h> or <db_185.h>, I suspect the
> right file is not included at all here. Where is dbopen() defined at
> yours?

By using -DUSE_DB185_EMULATION I got rid of the dbopen errors, dbopen
wasn't defined in db.h but in db_185.h, now I only have the O_SHLOCK
error left. Where would these flags be defined? Could this be a
difference between Linux and Solaris?

/peter

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-25 by manu@netbsd.org

shuttlebox <shuttlebox@...> wrote:

> By using -DUSE_DB185_EMULATION I got rid of the dbopen errors, dbopen
> wasn't defined in db.h but in db_185.h, now I only have the O_SHLOCK
> error left. Where would these flags be defined? Could this be a
> difference between Linux and Solaris?

No idea, I don't use either :-)

Can you have a look to your bdb sources? What version is it? Is O_SHLOCK
used anywhere in it?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-25 by shuttlebox

On Sat, Feb 25, 2012 at 2:19 PM,  <manu@...> wrote:
> shuttlebox <shuttlebox@...> wrote:
>
>> By using -DUSE_DB185_EMULATION I got rid of the dbopen errors, dbopen
>> wasn't defined in db.h but in db_185.h, now I only have the O_SHLOCK
>> error left. Where would these flags be defined? Could this be a
>> difference between Linux and Solaris?
>
> No idea, I don't use either :-)
>
> Can you have a look to your bdb sources? What version is it? Is O_SHLOCK
> used anywhere in it?

I'm using 4.8.30 and grep:ed the sources, found no trace of O_SHLOCK.

/peter

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-25 by manu@netbsd.org

shuttlebox <shuttlebox@...> wrote:

> I'm using 4.8.30 and grep:ed the sources, found no trace of O_SHLOCK.

Reading the sources, the flag is passed to open(2). In Solaris open(2)
man page, I find no way to get an unexclusive lock on the file.

The simplier solution is to define it as 0. Unix locks are advisory
anyway. We could add a flock(LOCK_SH) but it is probably not worth the
trouble.

Index: milter-greylist.c
===================================================================
RCS file: /cvsroot/milter-greylist/milter-greylist.c,v
retrieving revision 1.244
diff -U 4 -r1.244 milter-greylist.c
--- milter-greylist.c   25 Feb 2012 02:38:13 -0000      1.244
+++ milter-greylist.c   25 Feb 2012 15:50:48 -0000
@@ -2205,8 +2205,11 @@
        return;
 }
 
 #ifdef USE_DRAC
+#ifndef O_SHLOCK
+#define O_SHLOCK 0
+#endif /* O_SHLOCK */
 static int
 check_drac(dotted_ip)
        char *dotted_ip;
 {
-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-25 by shuttlebox

On Sat, Feb 25, 2012 at 5:18 PM,  <manu@...> wrote:
> shuttlebox <shuttlebox@...> wrote:
>
>> I'm using 4.8.30 and grep:ed the sources, found no trace of O_SHLOCK.
>
> Reading the sources, the flag is passed to open(2). In Solaris open(2)
> man page, I find no way to get an unexclusive lock on the file.
>
> The simplier solution is to define it as 0. Unix locks are advisory
> anyway. We could add a flock(LOCK_SH) but it is probably not worth the
> trouble.
>
> Index: milter-greylist.c
> ===================================================================
> RCS file: /cvsroot/milter-greylist/milter-greylist.c,v
> retrieving revision 1.244
> diff -U 4 -r1.244 milter-greylist.c
> --- milter-greylist.c   25 Feb 2012 02:38:13 -0000      1.244
> +++ milter-greylist.c   25 Feb 2012 15:50:48 -0000
> @@ -2205,8 +2205,11 @@
>        return;
>  }
>
>  #ifdef USE_DRAC
> +#ifndef O_SHLOCK
> +#define O_SHLOCK 0
> +#endif /* O_SHLOCK */
>  static int
>  check_drac(dotted_ip)
>        char *dotted_ip;
>  {

With that it built, I also ended up putting these additions into our
build system to get drac support to build:

EXTRA_LIB = /opt/csw/bdb48/lib
EXTRA_INC = /opt/csw/bdb48/include
EXTRA_CFLAGS = -DUSE_DB185_EMULATION
EXTRA_LDFLAGS = -ldb

/peter

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-25 by manu@netbsd.org

shuttlebox <shuttlebox@...> wrote:

> With that it built, I also ended up putting these additions into our
> build system to get drac support to build:

Good. I would like to fix the warnings about gmtime_r() localtime_t()
and strtok_r(). I suspect Solaris just needs a -Dsomething to get it in
order.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-25 by shuttlebox

On Sat, Feb 25, 2012 at 6:59 PM,  <manu@...> wrote:
> shuttlebox <shuttlebox@...> wrote:
>
>> With that it built, I also ended up putting these additions into our
>> build system to get drac support to build:
>
> Good. I would like to fix the warnings about gmtime_r() localtime_t()
> and strtok_r(). I suspect Solaris just needs a -Dsomething to get it in
> order.

This is what I could find, does it help?

/usr/include/time.h

#if     defined(__EXTENSIONS__) || defined(_REENTRANT) || \
            (_POSIX_C_SOURCE - 0 >= 199506L)
extern struct tm *gmtime_r(const time_t *, struct tm *);
extern struct tm *localtime_r(const time_t *, struct tm *);
#endif  /* defined(__EXTENSIONS__) || defined(_REENTRANT) .. */

/usr/include/string.h

#if     defined(__EXTENSIONS__) || defined(_REENTRANT) || \
            (_POSIX_C_SOURCE - 0 >= 199506L)
extern char *strtok_r(char *, const char *, char **);
#endif  /* defined(__EXTENSIONS__) || defined(_REENTRANT) .. */

/peter

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-26 by manu@netbsd.org

Gary Faith <gafaith@...> wrote:

> I know this doesn't have to do with the compile problem but I found this
> in the milter-greylist.c.
> 
>         default:
>                 mg_log(LOG_ERR, "check_drack: errno=%d", errno);
>                 break;
>         }

What problem were you tracking down?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-26 by shuttlebox

On Sun, Feb 26, 2012 at 4:37 AM,  <manu@...> wrote:
> shuttlebox <shuttlebox@...> wrote:
>
>> This is what I could find, does it help?
>
> Yes, please try this patch:
> http://ftp.espci.fr/shadow/manu/mg44a1p2.patch

I still get the warnings. I'm not sure I understand how you're trying
to solve this but I'm guessing you want to trigger EXTENSIONS to be
used..? However, configure doesn't seem to pick it up:

checking if -D_REENTRANT is needed to use localtime_r and strtok_r... no
checking if -D__EXTENSIONS__ is needed to use localtime_r and strtok_r... no

Also, the build command hasn't added it either:

/opt/csw/bin/gcc-4.6 -mtune=i686 -O2 -pipe -m32 -march=i386
-DUSE_DB185_EMULATION -Wall -I/opt/csw/lib/include -DUSE_CURL
-I/opt/csw/lib/include -DUSE_GEOIP -I/opt/csw/lib/include
-DUSE_FD_POOL -DUSE_DRAC -DHAVE_DATA_CALLBACK -DUSE_DNSRBL
-DCONFFILE=\"/etc/opt/csw/greylist.conf\"
-DDUMPFILE=\"/var/opt/csw/milter-greylist/greylist.db\" -D_BSD_SOURCE
-I. -I. -I/opt/csw/bdb48/include -I/opt/csw/include
-I/opt/csw/bdb48/include -I/opt/csw/include  -c -o milter-greylist.o
milter-greylist.c
milter-greylist.c: In function 'real_header':
milter-greylist.c:812:11: warning: variable 'stat' set but not used
[-Wunused-but-set-variable]
milter-greylist.c: In function 'real_body':
milter-greylist.c:889:11: warning: variable 'stat' set but not used
[-Wunused-but-set-variable]
milter-greylist.c: In function 'real_eom':
milter-greylist.c:991:11: warning: variable 'stat' set but not used
[-Wunused-but-set-variable]
milter-greylist.c: In function 'gmtoffset':
milter-greylist.c:2043:2: warning: implicit declaration of function
'gmtime_r' [-Wimplicit-function-declaration]
milter-greylist.c:2044:2: warning: implicit declaration of function
'localtime_r' [-Wimplicit-function-declaration]
milter-greylist.c: In function 'fstring_expand':
milter-greylist.c:2571:2: warning: implicit declaration of function
'strtok_r' [-Wimplicit-function-declaration]
milter-greylist.c:2571:15: warning: assignment makes pointer from
integer without a cast [enabled by default]

If I add EXTENSIONS manually to our build system it works:

EXTRA_CFLAGS = -DUSE_DB185_EMULATION -D__EXTENSIONS__

/opt/csw/bin/gcc-4.6 -mtune=i686 -O2 -pipe -m32 -march=i386
-DUSE_DB185_EMULATION -D__EXTENSIONS__ -Wall -I/opt/csw/lib/include
-DUSE_CURL -I/opt/csw/lib/include -DUSE_GEOIP -I/opt/csw/lib/include
-DUSE_FD_POOL -DUSE_DRAC -DHAVE_DATA_CALLBACK -DUSE_DNSRBL
-DCONFFILE=\"/etc/opt/csw/greylist.conf\"
-DDUMPFILE=\"/var/opt/csw/milter-greylist/greylist.db\" -D_BSD_SOURCE
-I. -I. -I/opt/csw/bdb48/include -I/opt/csw/include
-I/opt/csw/bdb48/include -I/opt/csw/include  -c -o milter-greylist.o
milter-greylist.c
milter-greylist.c: In function 'real_header':
milter-greylist.c:812:11: warning: variable 'stat' set but not used
[-Wunused-but-set-variable]
milter-greylist.c: In function 'real_body':
milter-greylist.c:889:11: warning: variable 'stat' set but not used
[-Wunused-but-set-variable]
milter-greylist.c: In function 'real_eom':
milter-greylist.c:991:11: warning: variable 'stat' set but not used
[-Wunused-but-set-variable]


/peter bonivart

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-26 by shuttlebox

On Sun, Feb 26, 2012 at 6:32 PM,  <manu@...> wrote:
> shuttlebox <shuttlebox@...> wrote:
>
>> checking if -D__EXTENSIONS__ is needed to use localtime_r and strtok_r... no
>
> Please send me config.log

Here it is: http://pastebin.ca/2121785

/peter bonivart

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-26 by manu@netbsd.org

shuttlebox <shuttlebox@...> wrote:

> Here it is: http://pastebin.ca/2121785

Ok, this is a warning, and we will not catch it since we do not test
with -Werror. OTOH I am scared of testing with -Werror, it may break
badly on other systems. I give up, this is just warnings, after all.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-26 by shuttlebox

On Sun, Feb 26, 2012 at 9:20 PM,  <manu@...> wrote:
> shuttlebox <shuttlebox@...> wrote:
>
>> Here it is: http://pastebin.ca/2121785
>
> Ok, this is a warning, and we will not catch it since we do not test
> with -Werror. OTOH I am scared of testing with -Werror, it may break
> badly on other systems. I give up, this is just warnings, after all.

But you are keeping the O_SHLOCK definitions, right?

No problem here with not continuing, I don't even use DRAC, I just
wanted to test different options for you. :)


/peter bonivart

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-26 by shuttlebox

On Sun, Feb 26, 2012 at 9:26 PM, Gary Faith <gafaith@...> wrote:
> I was looking at the check_drac issue in the milter-greylist.c.   I searched
> for check_drac and found that you had check_drack instead of check_drac.  At
> first look, I thought it might have been an issue causing problems with
> compiling but then I realized that this was just a descriptive entry in the
> log file.  Still needs fixed but has nothing to do with the compiling
> problem.
>
> Gary
>
>>>> <manu@...> 2/26/2012 1:31 AM >>>
>
>
>
> Gary Faith wrote:
>
>> I know this doesn't have to do with the compile problem but I found this
>> in the milter-greylist.c.
>>
>> default:
>> mg_log(LOG_ERR, "check_drack: errno=%d", errno);
>> break;
>> }
>
> What problem were you tracking down?

It also says "worakround" on line 492 of configure.ac:

# Solaris 256 streams limitation worakround

:)

/peter bonivart

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-27 by manu@netbsd.org

shuttlebox <shuttlebox@...> wrote:

> No problem here with not continuing, I don't even use DRAC, I just
> wanted to test different options for you. :)

Thank you for that. :-)

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-28 by Oliver Fromme

manu@... wrote:
 > shuttlebox <shuttlebox@...> wrote:
 > 
 > > I'm using 4.8.30 and grep:ed the sources, found no trace of O_SHLOCK.
 > 
 > Reading the sources, the flag is passed to open(2). In Solaris open(2)
 > man page, I find no way to get an unexclusive lock on the file.

Just for the record:  O_SHLOCK and O_EXLOCK are BSD-extensions,
so SysV-based systems like Solaris/SunOS 5.x don't support it.

 > The simplier solution is to define it as 0. Unix locks are advisory
 > anyway. We could add a flock(LOCK_SH) but it is probably not worth the
 > trouble.

flock() is also a BSD-extension.  :-)  Solaris supports flock()
from its compatibility interfaces, but the implementation just
calls fcntl() underneath, which is a POSIX-standard.

So, the most portable and easiest way is to use only fcntl()
for locking on all platforms.  No #ifdef required.

Best regards
   Oliver


-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Gesch\ufffdftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht M\ufffdn-
chen, HRB 125758,  Gesch\ufffdftsf\ufffdhrer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"Life is short (You need Python)"
        -- Bruce Eckel, ANSI C++ Comitee member, author
           of "Thinking in C++" and "Thinking in Java"

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-28 by manu@netbsd.org

Oliver Fromme <olli@...> wrote:

> So, the most portable and easiest way is to use only fcntl()
> for locking on all platforms.  No #ifdef required.

And do you have a way to atomicaly open and lock?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-28 by Oliver Fromme

manu@... wrote:
 > Oliver Fromme <olli@...> wrote:
 > 
 > > So, the most portable and easiest way is to use only fcntl()
 > > for locking on all platforms.  No #ifdef required.
 > 
 > And do you have a way to atomicaly open and lock?

No, but I don't think that is necessary anyway.

You only have to be careful if you want to use O_TRUNC at the
same time.  In this case, you must first open the file without
O_TRUNC, then acquire the lock with fcntl(), and if successful,
use ftruncate() on the descriptor.

If fcntl() was not successful, just close the file descriptor
again.  In this case the file won't be touched at all (not even
the mtime or ctime).

Best regards
   Oliver


-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Gesch\ufffdftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht M\ufffdn-
chen, HRB 125758,  Gesch\ufffdftsf\ufffdhrer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"We, the unwilling, led by the unknowing,
are doing the impossible for the ungrateful.
We have done so much, for so long, with so little,
we are now qualified to do anything with nothing."
\ufffd \ufffd \ufffd \ufffd -- Mother Teresa

Re: [milter-greylist] milter-greylist 4.4 alpha1 is available

2012-02-28 by Johann Klasek

On Sun, Feb 26, 2012 at 04:08:22PM +0100, shuttlebox wrote:
> On Sun, Feb 26, 2012 at 4:37 AM,  <manu@...> wrote:
> > shuttlebox <shuttlebox@...> wrote:
> >
> >> This is what I could find, does it help?
> >
> > Yes, please try this patch:
> > http://ftp.espci.fr/shadow/manu/mg44a1p2.patch
> 
> I still get the warnings. I'm not sure I understand how you're trying
> to solve this but I'm guessing you want to trigger EXTENSIONS to be
> used..? However, configure doesn't seem to pick it up:
> 
> checking if -D_REENTRANT is needed to use localtime_r and strtok_r... no
> checking if -D__EXTENSIONS__ is needed to use localtime_r and strtok_r... no
> 
> Also, the build command hasn't added it either:
> 
> /opt/csw/bin/gcc-4.6 -mtune=i686 -O2 -pipe -m32 -march=i386
> -DUSE_DB185_EMULATION -Wall -I/opt/csw/lib/include -DUSE_CURL
> -I/opt/csw/lib/include -DUSE_GEOIP -I/opt/csw/lib/include
> -DUSE_FD_POOL -DUSE_DRAC -DHAVE_DATA_CALLBACK -DUSE_DNSRBL
> -DCONFFILE=\"/etc/opt/csw/greylist.conf\"
> -DDUMPFILE=\"/var/opt/csw/milter-greylist/greylist.db\" -D_BSD_SOURCE
> -I. -I. -I/opt/csw/bdb48/include -I/opt/csw/include
> -I/opt/csw/bdb48/include -I/opt/csw/include  -c -o milter-greylist.o
> milter-greylist.c
> milter-greylist.c: In function 'real_header':
> milter-greylist.c:812:11: warning: variable 'stat' set but not used
> [-Wunused-but-set-variable]
> milter-greylist.c: In function 'real_body':
> milter-greylist.c:889:11: warning: variable 'stat' set but not used
> [-Wunused-but-set-variable]
> milter-greylist.c: In function 'real_eom':
> milter-greylist.c:991:11: warning: variable 'stat' set but not used
> [-Wunused-but-set-variable]
> milter-greylist.c: In function 'gmtoffset':
> milter-greylist.c:2043:2: warning: implicit declaration of function
> 'gmtime_r' [-Wimplicit-function-declaration]
> milter-greylist.c:2044:2: warning: implicit declaration of function
> 'localtime_r' [-Wimplicit-function-declaration]
> milter-greylist.c: In function 'fstring_expand':
> milter-greylist.c:2571:2: warning: implicit declaration of function
> 'strtok_r' [-Wimplicit-function-declaration]
> milter-greylist.c:2571:15: warning: assignment makes pointer from
> integer without a cast [enabled by default]

_r functions are only defined with correct prototypes if 
 a) gcc is called with option -pthreads (POSIX threads)
 b) cc (Sun Studio Compiler) with -mt -lpthread

This defines implicit _REENTRANT and therefore the extended system interface which
will be enabled by defining __EXTENSIONS__ is not needed (AFAIK).
As I have experienced _REENTRANT should not be defined explicitly (except for a
temporary hack or so).


> 
> If I add EXTENSIONS manually to our build system it works:
> 
> EXTRA_CFLAGS = -DUSE_DB185_EMULATION -D__EXTENSIONS__

What about with set the compile option -ptreads?

[..]

Johann E.K.

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.