Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 156586

Summary: ebuild for milter-greylist
Product: Gentoo Linux Reporter: Robert S <robert.spam.me.senseless>
Component: New packagesAssignee: Default Assignee for New Packages <maintainer-wanted>
Status: CONFIRMED ---    
Severity: enhancement CC: andreis.vinogradovs, atoth, barzog, coran.fisher, net-mail+disabled, robert.spam.me.senseless, tb
Priority: High Keywords: EBUILD
Version: unspecified   
Hardware: All   
OS: Other   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 262919    
Bug Blocks:    
Attachments: Ebuild for milter-greylist-3.0
Ebuild for milter-greylist-3.1.8
Ebuild for milter-greylist 4.0beta4
milter-greylist-4.0.ebuild file
config.log
output from emerge --info
Modified ebuild with correct dependencies
milter-greylist-4.3.4.ebuild
ebuild for milter-greylist-4.3.4 (development version)
milter-greylist-4.3.4.ebuild
init script for milter-greylist
gentoo.confd file for milter-greylist ebuild
fixed ebuild
bump version
Modified conf file
milter-greylist-4.3.8.ebuild

Description Robert S 2006-11-29 02:34:23 UTC
This ebuild will install milter-greylist along with config files and startup scripts.  I've tested it on x86 and amd64.  On amd64, it segfaults when you enter "milter-greylist -D".  Otherwise it seems to work fine.  No reply yet from milter-greylist mailing list on why this is so.  Maybe a problem with libspf2.  Note - if this is compiled with libspf2-1.2.5-r1 it crashes on amd64 after running for a few hours.  I haven't had this problem with the -r2 version - after about 5 day's continuous running.

Note - I'm not an ebuild guru - there may be more elegant ways of doing this.  It needs to make use of /etc/conf.d/milter-greylist - which it doesn't at the moment.  It could also do with some "einfo" messages on sendmail configuration.

$ cat mail-filter/milter-greylist/milter-greylist-3.0.ebuild
#--------8><--------8><--------8><--------8><--------8><--------8><--------
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

inherit eutils

DESCRIPTION="milter-greylist is a stand-alone milter written in C that implements the  greylist filtering method"
SRC_URI="ftp://ftp.espci.fr/pub/milter-greylist/${P}.tgz"
HOMEPAGE="http://hcpnet.free.fr/milter-greylist"

DEPEND="virtual/libc
        mail-filter/libspf2
        mail-mta/sendmail
        spf? ( >=mail-filter/libspf2-1.2.5-r2 )"

SLOT="0"
LICENSE="BSD"
KEYWORDS="~x86 ~amd64"
IUSE="spf dnsrbl"

pkg_setup() {
        if [ ! -e /usr/lib/libmilter.a ] ; then
            ewarn "Sendmail must be compiled with milter support -"
            ewarn "recompile sendmail with milter USE flag enabled"
            die "need milter-enabled sendmail"
        fi
}

src_compile() {
        local myconf
        use spf && {
            myconf="${myconf} --with-libspf2=/usr/lib"
            }
        use dnsrbl && {
            myconf="${myconf} --enable-dnsrbl"
            }
        sed "18s/^/DESC\=\"milter-greylist\"\n/; s|DAEMON=/usr/local/bin/$NAME|DAEMON=@BINDIR@/$NAME|" rc-gentoo.sh.in > rc-gentoo.sh.in.tmp
        mv rc-gentoo.sh.in.tmp rc-gentoo.sh.in
        econf ${myconf} --with-user=smmsp || die
        emake || die "build error"
}

src_install () {
        newinitd rc-gentoo.sh milter-greylist
        emake DESTDIR=${D} install || die "install error"
        dodoc ChangeLog README
        diropts "-o smmsp -m 755"
        into /
        keepdir /var/milter-greylist
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-11-29 02:59:23 UTC
Please, don't inline ebuilds, use attachments. Thanks.
Comment 2 Robert S 2006-12-26 03:35:35 UTC
A few improvements.  Adds a file in /etc/conf.d.  Some instructions at the end of the emerge.  The ebuild has now been uploaded as an attachment.

This is a very useful package - it hugely reduces the amount of spam that I get - especially if dynamic IP addresses are greylisted - see http://tech.groups.yahoo.com/group/milter-greylist/message/2994.
Comment 3 Robert S 2006-12-26 03:36:50 UTC
Created attachment 104734 [details]
Ebuild for milter-greylist-3.0
Comment 4 Robert S 2007-04-21 00:48:29 UTC
Created attachment 116870 [details]
Ebuild for milter-greylist-3.1.8

Here is an ebuild for the last of the 3.1 series.  It works on x86 and amd64.
Comment 5 Thomas Beutin 2007-05-29 10:33:25 UTC
i've problems with the geoip-support: dev-libs/geoip is emerged on the system, but i get a lot of lines similar like this on my mailserver:
May 29 12:21:49 laokoon milter-greylist: GeoIP is not available
May 29 12:21:55 laokoon milter-greylist: GeoIP is not available
May 29 12:21:56 laokoon milter-greylist: GeoIP is not available
May 29 12:22:35 laokoon milter-greylist: GeoIP is not available
May 29 12:22:36 laokoon milter-greylist: GeoIP is not available
May 29 12:24:16 laokoon milter-greylist: GeoIP is not available
May 29 12:24:19 laokoon milter-greylist: GeoIP is not available
May 29 12:24:43 laokoon milter-greylist: GeoIP is not available
May 29 12:25:11 laokoon milter-greylist: GeoIP is not available
May 29 12:26:21 laokoon milter-greylist: GeoIP is not available
May 29 12:26:25 laokoon milter-greylist: GeoIP is not available
May 29 12:26:57 laokoon milter-greylist: GeoIP is not available

Any idea what's missing?
Comment 6 Robert S 2007-05-29 11:31:45 UTC
Try adding this to /etc/mail/greylist.conf

geoipdb "/usr/share/GeoIP/GeoIP.dat"
Comment 7 Thomas Beutin 2007-05-29 12:29:05 UTC
(In reply to comment #6)
> Try adding this to /etc/mail/greylist.conf
> 
> geoipdb "/usr/share/GeoIP/GeoIP.dat"
> 
Ok, this seems to help.

BTW: What do You think about adding a "curl" USE flag? It is just an idea...
Comment 8 Robert S 2007-05-29 13:02:18 UTC
Personally I don't have a use for it - I haven't sussed out URL checks.  It would be very easy to do.
Comment 9 W-Mark Kubacki 2007-06-05 09:33:33 UTC
I do use milter-greylist on some mailservers with Postfix, and it runs fine. So better set the dependency to mail-filter/libmilter.

libspf2 should only be polled when spf useflags is set.

Please see my ebuilds at https://svn.ossdl.de/all/ossdl/mail-filter/milter-greylist/ .

If you're searching for a maintainer just drop me a line.
Comment 10 Henrique Dias 2007-06-26 17:27:33 UTC
Is possible to say when the ebuild is in the portage tree?
If you need help I can spend some time with this.

Thank you,

Henrique Dias
Comment 11 Robert S 2007-10-07 01:33:44 UTC
Created attachment 132788 [details]
Ebuild for milter-greylist 4.0beta4

Upgraded to latest version, added curl USE flag
Comment 12 Simon Gao 2008-03-11 04:09:34 UTC
Created attachment 145791 [details]
milter-greylist-4.0.ebuild file

ebuild for milter-greylist-4.0 release version.
Comment 13 Thomas Beutin 2008-07-21 14:41:49 UTC
Oops, on my new server both versions (3.1.8 and 4.0) fails to compile:

checking for select... no
checking for socket... no
checking for initgroups... no
checking for strlcat... no
checking for vsyslog... no
checking for pthread_create in -lpthread... no
checking for pthread_create in -lc_r... no
checking for pthread_create in -lpthreads -lpthread... no
Required libpthread not found. Use --with-libpthread

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/mail-filter/milter-greylist-4.0/work/milter-greylist-4.0/config.log
 * 
 * ERROR: mail-filter/milter-greylist-4.0 failed.
Comment 14 Thomas Beutin 2008-07-21 14:44:35 UTC
Created attachment 161006 [details]
config.log

the config.log mentonied above
Comment 15 Thomas Beutin 2008-07-21 14:51:08 UTC
Created attachment 161007 [details]
output from emerge --info

output from emerge --info of the failing server
Comment 16 Robert S 2008-07-21 22:16:16 UTC
I had this problem a lot initially - especially on other distros (eg. Debian).  Its usually a dependency problem.  The "Required libpthread not found. Use --with-libpthread" message is often misleading.  Have you installed GeoIP?  You could try turning off some of the USE flags (geoip/curl/dnsrbl/spf) to find out what the offending feature is.
Comment 17 Thomas Beutin 2008-07-22 08:12:30 UTC
(In reply to comment #16)
> I had this problem a lot initially - especially on other distros (eg. Debian). 
> Its usually a dependency problem.  The "Required libpthread not found. Use
> --with-libpthread" message is often misleading.  Have you installed GeoIP?  You
> could try turning off some of the USE flags (geoip/curl/dnsrbl/spf) to find out
> what the offending feature is.
Ok, the missing dev-libs/geoip leads to this. But shouldn't there be an entry like "geoip? ( dev-libs/geoip )" in the DEPEND section off the ebuild?
Comment 18 Robert S 2008-07-22 11:05:55 UTC
Created attachment 161088 [details]
Modified ebuild with correct dependencies

I've modified the ebuild.  Its been tested on a pristine gentoo install.  Note that there is a problem with package collisions between ssmtp and sendmail.  I've put a comment into the ebuild to deal with this.  If ssmtp is installed you should do:
# emerge -C ssmtp
# echo mail-mta/ssmtp >> /etc/portage/package.mask
before building this ebuild - as per http://bugs.gentoo.org/167952.

Changes are:
Added missing geoip and curl dependencies
Fixed startup script to remove .pid file on shutdown

Anyone interested in maintaining this package?  I don't have enough in-depth knowledge to do this.
Comment 19 Thomas Beutin 2008-08-02 15:00:10 UTC
(In reply to comment #18)
[...]
> Anyone interested in maintaining this package?  I don't have enough in-depth
> knowledge to do this.
You did a great work!

As of Comment  #9 From W-Mark Kubacki was interested to do this, but he isn't (any longer?) in the CC section of this bug. Should we ask him by mail?

Comment 20 Andreis Vinogradovs ( slepnoga ) 2010-01-12 23:39:25 UTC
Created attachment 216308 [details]
milter-greylist-4.3.4.ebuild

This ebuild place in rion overlay
Comment 21 Thomas Beutin 2010-01-14 12:43:22 UTC
(In reply to comment #20)
> Created an attachment (id=216308) [details]
> milter-greylist-4.3.4.ebuild
> 
> This ebuild place in rion overlay
> 
when i use the ebuild from
http://rion-overlay.googlecode.com/hg/mail-filter/milter-greylist/milter-greylist-4.3.4.ebuild to install mail-filter/milter-greylist-4.3.4 then there is no file /etc/init.d/milter-greylist installed to start and stop the deamon. Is this intended?
Comment 22 Robert S 2010-01-14 22:17:03 UTC
Created attachment 216548 [details]
ebuild for milter-greylist-4.3.4 (development version)

This ebuild is a slight modification of my previous one and creates the appropriate init.d file.  I haven't looked at the 4.3.* versions at this stage as I'm planning to stick to the stable version.
Comment 23 Attila Tóth 2010-01-26 18:08:20 UTC
(In reply to comment #21)
> (In reply to comment #20)
> > Created an attachment (id=216308) [details] [details]
> > milter-greylist-4.3.4.ebuild
> > 
> > This ebuild place in rion overlay
> > 
> when i use the ebuild from
> http://rion-overlay.googlecode.com/hg/mail-filter/milter-greylist/milter-greylist-4.3.4.ebuild
> to install mail-filter/milter-greylist-4.3.4 then there is no file
> /etc/init.d/milter-greylist installed to start and stop the deamon. Is this
> intended?
> 

The attached ebuild has the necessary lines commented out. However it seems to be OK in the overlay mentioned earlier. You should take care of copying the files to their proper place if not using the whole overlay.

Regards:
Dw.
Comment 24 Andreis Vinogradovs ( slepnoga ) 2010-01-26 22:15:46 UTC
Created attachment 217508 [details]
milter-greylist-4.3.4.ebuild

fixed ebuild.
Comment 25 Andreis Vinogradovs ( slepnoga ) 2010-01-26 22:18:05 UTC
Created attachment 217510 [details]
init script for milter-greylist
Comment 26 Andreis Vinogradovs ( slepnoga ) 2010-01-26 22:19:57 UTC
Created attachment 217512 [details]
gentoo.confd file for milter-greylist ebuild
Comment 27 Andreis Vinogradovs ( slepnoga ) 2010-02-05 02:44:14 UTC
Created attachment 218473 [details]
fixed ebuild
Comment 28 Andreis Vinogradovs ( slepnoga ) 2010-03-15 14:19:14 UTC
This bug depend on #262919
Owner's, please ad depend
Comment 29 Andreis Vinogradovs ( slepnoga ) 2010-07-05 05:26:00 UTC
Created attachment 237533 [details]
bump version
Comment 30 Robert S 2010-07-17 13:13:06 UTC
Created attachment 239139 [details]
Modified conf file

There are a number of problems with 4.3.7.  When you compile it with the "curl dnsrbl geoip p0f sendmail ssl" USE flags it does not compile:

x86_64-pc-linux-gnu-gcc -O2 -pipe -Wall -Iyes/include -Iyes/include -Iyes/include -DUSE_CURL -Iyes/include -DUSE_GEOIP -DUSE_P0F -DHAVE_DATA_CALLBACK -DUSE_DNSRBL -DCONFFILE=\"/etc/mail/milter-greylist.conf\" -DDUMPFILE=\"/var/lib/milter-greylist/milter-greylist.db\" -D_BSD_SOURCE -I. -I.    -c -o conf.o conf.c
mv y.tab.c conf_yacc.c
mv: cannot stat `y.tab.c': No such file or directory
make: *** [conf_yacc.c] Error 1
make: *** Waiting for unfinished jobs....
milter-greylist.c: In function ‘fstring_expand’:
milter-greylist.c:2698: warning: dereferencing pointer ‘addr.85’ does break strict-aliasing rules
milter-greylist.c:2698: warning: dereferencing pointer ‘addr.85’ does break strict-aliasing rules
milter-greylist.c:2698: note: initialized from here
milter-greylist.c:2489: warning: ‘last’ may be used uninitialized in this function
 * ERROR: mail-filter/milter-greylist-4.3.7 failed:
etc.

This can be overcome by replacing "econf" with "./configure --prefix=/usr" and adding "make" at the bottom of src_configure().  Not very elegant but works.

Also in the file gentoo.confd the variable $USER is not defined and milter-greylist won't start on initial boot.  It seems to start after the system has been booted.

For cosmetic reasons I've put `DESC=milter-greylist' at the bottom of the conf file.
Comment 31 Andreis Vinogradovs ( slepnoga ) 2010-09-05 02:41:44 UTC
Created attachment 246081 [details]
milter-greylist-4.3.8.ebuild
Comment 32 Thomas Beutin 2012-05-05 12:28:37 UTC
(In reply to comment #31)
> Created attachment 246081 [details]
> milter-greylist-4.3.8.ebuild

it needs to have openldap in the IUSE line - otherwise the command
ebuild milter-greylist-4.3.8.ebuild manifest
fails