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

Bug 173759

Summary: mail-filter/spamassassin: postgres useflag support is too limited
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: New packagesAssignee: Gentoo Perl team <perl>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: pgsql-bugs, xenoterracide
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Ebuild patch
Init script patch

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2007-04-08 12:23:32 UTC
(CCing pgsql herd so they can say their opinion about init.d script)

I just finished setting up SpamAssassin with PostgreSQL support locally; currently the postgres useflag does not really help much, beside installing the proper Perl modules needed for PostgreSQL access. (Probably the same holds true for mysql, but I haven't looked that up.)

First of all, the ebuild should probably warn that the useflag alone won't enable any pgsql feature (okay this is trivial to know if you know Gentoo, but anyway).

Plus, with it enabled (and configured) and berkdb disabled, Bayesian filtering works just as well, so the warning about missing DB_File is then moot.

The init.d script does not currently require pgsql so spamd could be started without postgresql; as it can use a remote postgresql server it might not be a good idea to "need postgresql", but maybe "use postgresql" can help to get it started in the correct order.

And most important, the doc useflag is currently opting-in for user documentation (which is not the usual use for it, as user documentation should be always available), which includes the SQL schemas needed to properly set up the PostgreSQL database.

If wanted, I can provide a couple of possible ways to improve the situation.
Comment 1 Tiziano Müller (RETIRED) gentoo-dev 2007-04-08 13:24:35 UTC
(In reply to comment #0)

> The init.d script does not currently require pgsql so spamd could be started
> without postgresql; as it can use a remote postgresql server it might not be a
> good idea to "need postgresql", but maybe "use postgresql" can help to get it
> started in the correct order.
Fully agree.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2007-04-08 15:21:01 UTC
Created attachment 115727 [details, diff]
Ebuild patch

This is a proposed ebuild patch; it changes the name of the init.d file from 3.0.0-spamd.init to 3.1.8-spamd.init, as I'll be attaching a patch to the init.d file, then manages the init script so that if the postgres or mysql useflags are enabled, the proper code is enabled on the init script. It also removes the conditional on doc useflag for the installation of text documentation; the doc useflag still exists for html documentation, that as far as I can see require an extra step during compile.

The SQL documentation is installed only if one of the three SQL backends is installed; more fine-grained installation could be achieved so that only the schemas for the enabled databases are installed, but I'm unsure how much does that help.

The note to look at the documentation is no more conditional to doc useflag either, and it doesn't point to the .gz file (as it's likely to be bz2 nowadays, but should also be configurable, so taking it generic should be fine). An added note tell users to set up their SQL database if they want Bayes support, before checking for DB_File.

Probably the remaining einfo calls should be changed to elog, by the way.
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2007-04-08 15:21:20 UTC
Created attachment 115728 [details, diff]
Init script patch
Comment 5 David Abbott (RETIRED) gentoo-dev 2009-11-26 17:53:54 UTC
*** Bug 216105 has been marked as a duplicate of this bug. ***
Comment 6 David Abbott (RETIRED) gentoo-dev 2010-04-19 10:30:20 UTC
Updated init.d script added to spamassassin-3.3.1-r1 please test.