[milters] Archive

Lists Index Date Thread Search

Article: 3853
From: Fabio Sangiovanni
Date: 2014-02-18 12:50:33 -0500
Subject: Re: milter-link: prevent disclosure of private URIBL

Hi Antony,
thanks for your reply.

I get your point, but unfortunately I can't get the correct bash 
expansion to make it compile.



# CFLAGS='-DBLACK_LISTED_URL_FORMAT="black listed URL host %s" 
-DBLACK_LISTED_MAIL_FORMAT="black listed <%s>"' ./configure
platform is... Linux
checking for md5sum... md5sum
checking for autoconf-2.61... no
checking for autoconf-2.59... no
checking for autoconf... autoconf

milter-link/1.5.1
Copyright 2006, 2010 by Anthony Howe. All rights reserved.


Generating files...

configure: creating ./config.status
config.status: creating manual.shtml
config.status: creating startup.sh
config.status: creating sample.mc
config.status: creating install.sh
config.status: creating makefile
config.status: creating config.h

milter-link/1.5.1
Copyright 2006, 2010 by Anthony Howe. All rights reserved.

   Platform..............: Linux gcc
   LibSnert..............: yes
   --prefix..............: /usr/local
   --datadir.............: ${prefix}/share
   --localstatedir.......: /var
   --exec_prefix.........: ${prefix}
   --sbindir.............: ${exec_prefix}/sbin
   --libexecdir..........: ${exec_prefix}/libexec
   --enable-run-user.....: milter
   --enable-run-group....: milter
   --enable-pid..........: /var/run/milter/milter-link.pid
   --enable-socket.......: /var/run/milter/milter-link.socket
   CFLAGS................: -DBLACK_LISTED_URL_FORMAT="black listed URL 
host %s" -DBLACK_LISTED_MAIL_FORMAT="black listed <%s>" 
-I/usr/include/db4 -D_REENTRANT -O2 -Wall -m64 -I${top_srcdir}/../../include
   LDFLAGS...............:  -m64 -L${top_srcdir}/../../lib
   LIBS..................:  -lsnert -lpthread -ldl  -lmilter -ldb-4.7  
-lrt -lpthread

# make install
gcc -DMILTER_BUILD=`cat BUILD_ID.TXT` -DMILTER_BUILD_STRING='"'`cat 
BUILD_ID.TXT`'"' \
     -DBLACK_LISTED_URL_FORMAT="black listed URL host %s" 
-DBLACK_LISTED_MAIL_FORMAT="black listed <%s>" -I/usr/include/db4 
-D_REENTRANT -O2 -Wall -m64 -I./../../include -m64 -L./../../lib  
-D_BUILT="\"`date +'%a, %d %b %Y %H:%M:%S %z'`\"" -o milter-link 
milter-link.c -lsnert -lpthread -ldl -lmilter -ldb-4.7  -lrt -lpthread
milter-link.c:135: error: ‘black’ undeclared here (not in a function)
milter-link.c:135: error: expected ‘,’ or ‘;’ before ‘listed’
milter-link.c:136: error: invalid initializer
milter-link.c:136: error: expected ‘,’ or ‘;’ before ‘listed’
make: *** [milter-link] Error 1



If I try to fix quoting, compilation breaks in another point:



# CFLAGS="-DBLACK_LISTED_URL_FORMAT='\"black listed URL host %s\"' 
-DBLACK_LISTED_MAIL_FORMAT='\"black listed <%s>\"'" ./configure
platform is... Linux
checking for md5sum... md5sum
checking for autoconf-2.61... no
checking for autoconf-2.59... no
checking for autoconf... autoconf

milter-link/1.5.1
Copyright 2006, 2010 by Anthony Howe. All rights reserved.


Generating files...

configure: creating ./config.status
config.status: creating manual.shtml
config.status: creating startup.sh
config.status: creating sample.mc
config.status: creating install.sh
config.status: creating makefile
config.status: creating config.h

milter-link/1.5.1
Copyright 2006, 2010 by Anthony Howe. All rights reserved.

   Platform..............: Linux gcc
   LibSnert..............: yes
   --prefix..............: /usr/local
   --datadir.............: ${prefix}/share
   --localstatedir.......: /var
   --exec_prefix.........: ${prefix}
   --sbindir.............: ${exec_prefix}/sbin
   --libexecdir..........: ${exec_prefix}/libexec
   --enable-run-user.....: milter
   --enable-run-group....: milter
   --enable-pid..........: /var/run/milter/milter-link.pid
   --enable-socket.......: /var/run/milter/milter-link.socket
   CFLAGS................: -DBLACK_LISTED_URL_FORMAT='"black listed URL 
host %s"' -DBLACK_LISTED_MAIL_FORMAT='"black listed <%s>"' 
-I/usr/include/db4 -D_REENTRANT -O2 -Wall -m64 -I${top_srcdir}/../../include
   LDFLAGS...............:  -m64 -L${top_srcdir}/../../lib
   LIBS..................:  -lsnert -lpthread -ldl  -lmilter -ldb-4.7  
-lrt -lpthread


# make build
gcc -DMILTER_BUILD=`cat BUILD_ID.TXT` -DMILTER_BUILD_STRING='"'`cat 
BUILD_ID.TXT`'"' \
     -DBLACK_LISTED_URL_FORMAT='"black listed URL host %s"' 
-DBLACK_LISTED_MAIL_FORMAT='"black listed <%s>"' -I/usr/include/db4 
-D_REENTRANT -O2 -Wall -m64 -I./../../include -m64 -L./../../lib  
-D_BUILT="\"`date +'%a, %d %b %Y %H:%M:%S %z'`\"" -o milter-link 
milter-link.c -lsnert -lpthread -ldl -lmilter -ldb-4.7  -lrt -lpthread
milter-link.c: In function ‘testMail’:
milter-link.c:496: warning: too many arguments for format
milter-link.c:496: warning: too many arguments for format
milter-link.c: In function ‘testURI’:
milter-link.c:600: warning: too many arguments for format
milter-link.c:600: warning: too many arguments for format
milter-link.c:625: warning: too many arguments for format
milter-link.c:625: warning: too many arguments for format
milter-link.c: In function ‘printInfo’:
milter-link.c:1394: error: expected ‘)’ before ‘black’
milter-link.c:1402: error: expected ‘;’ before ‘}’ token
make: *** [milter-link] Error 1



Have you got any suggestions?


Thanks,

Fabio

On 18/02/14 15:53, Anthony Howe wrote:
> On 18 Feb 2014 06:00, Fabio Sangiovanni shouted from a galaxy far far
> away...:
>> Is there a way to prevent milter-link to disclose the zone? Can I
>> somehow override the smtp response message for URIBL-related rejects?
>> I think this could be a nice feature to have out of the box.
> Yes. There are macros that can be overridden. From milter-link.c
>
> #ifndef BLACK_LISTED_URL_FORMAT
> #define BLACK_LISTED_URL_FORMAT         "black listed URL host %s by %s"
>         /* 1st URL domain, 2nd list name */
> #endif
>
> #ifndef BLACK_LISTED_MAIL_FORMAT
> #define BLACK_LISTED_MAIL_FORMAT        "black listed <%s> by %s"
>          /* 1st mail address, 2nd list name */
> #endif
>
>
> So simply use CFLAGS during configure of milter-link:
>
> $ CFLAGS='-DBLACK_LISTED_MAIL_FORMAT="black listed URL host %s"
> -DBLACK_LISTED_MAIL_FORMAT="black listed <%s>"' ./configure
> $ make install
>
> That should suffice. Ignore any warnings about too many arguments.
>



Lists Index Date Thread Search