Bug 2374 - SA looking for local.cf in a different directory
Summary: SA looking for local.cf in a different directory
Status: RESOLVED DUPLICATE of bug 2388
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: 2.60
Hardware: All All
: P1 minor
Target Milestone: 2.60
Assignee: Malte S. Stretz
URL:
Whiteboard:
Keywords:
Depends on: 2388
Blocks:
  Show dependency tree
 
Reported: 2003-08-29 06:57 UTC by Rod Begbie
Modified: 2003-09-01 00:43 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
proposed patch against Makefile.PL patch None Malte S. Stretz [HasCLA]
new patch (not final) against Makefile.PL patch None Malte S. Stretz [HasCLA]
(I hope) final patch against Makefile.PL patch None Malte S. Stretz [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Rod Begbie 2003-08-29 06:57:22 UTC
Installed rc3 last night.  This morning, I found all my spam was wrapped in
lovely MIME attachments.  I didn't touch my config.  I have "report_safe 0"
defined in my local.cf.  Fails for both spamd and spamassassin.

Anyone else seeing this?
Comment 1 Theo Van Dinter 2003-08-29 07:00:25 UTC
Subject: Re: [SAdev]  New: "report_safe 0" being ignored in 2.60rc3

On Fri, Aug 29, 2003 at 07:03:42AM -0700, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> Installed rc3 last night.  This morning, I found all my spam was wrapped in
> lovely MIME attachments.  I didn't touch my config.  I have "report_safe 0"
> defined in my local.cf.  Fails for both spamd and spamassassin.
> 
> Anyone else seeing this?

Nope.  Works beautifully for me.

Comment 2 Al Smith 2003-08-29 07:13:47 UTC
Me neither. Installed rc3 30 minutes ago, and everything is fine.
Comment 3 Rod Begbie 2003-08-29 07:44:26 UTC
Actually -- just realised -- My entire local.cf file is being ignored.  (Spotted
the symptom, not the cause).

Has something changed in the defining of my /etc folder?  spamassassin -d shows:

debug: using "/usr/local/etc/mail/spamassassin" for site rules dir
Comment 4 Malte S. Stretz 2003-08-29 08:29:26 UTC
Yeah, the behaviour of the Makefile has changed a bit since 2.5x: SA will only 
look for config files in /etc if it got installed to /usr. Else it looks in 
$PREFIX/etc. You can change the dir via  
  perl Makefile.PL PREFIX=/usr/local SYSCONFDIR=/etc 
(this was fixed in bug 2359 for RC3). 
 
That's the behaviour as it is described in the head of Makefile.PL; I'm not 
too sure if its really a good idea though. (Esp. because somebody else, 
Christopher X. Candreva on sa-talk, stumbled over this, too.) This might give 
us some headaches from upgrading people. Maybe we should take the SYSCONFDIR 
only as *additional* config dir, so SA looks both in /etc and $PREFIX/etc? 
 
I dunno. Comments, devs? 
Comment 5 Rod Begbie 2003-08-29 08:49:27 UTC
Bloody windows users -- ruining it for the rest of us ;)

This definitely needs to be handled more gracefully -- My config has been in
/etc since I started using SA.
Comment 6 Malte S. Stretz 2003-08-29 09:26:16 UTC
Please leave the meta alone :) 
 
I think putting stuff into /usr/local/etc when /usr/local is the PREFIX is 
correct according to the FHS. And you can always override it with SYSCONFDIR. 
I'm just not sure if we should really change this behaviour, however correct 
and easy to "fix" it is :) 
Comment 7 Justin Mason 2003-08-29 10:38:26 UTC
urgh, that is messy.

Perhaps we should use /etc if PREFIX==/usr/local, as well.

Rod, how did you run Makefile.PL?  Just "perl Makefile.PL"?
Comment 8 Rod Begbie 2003-08-29 10:56:10 UTC
Yeah, I just followed the same install procedure I've used since forever.

perl Makefile.PL
make
make test
sudo make install
Comment 9 Malte S. Stretz 2003-08-29 10:58:41 UTC
Created attachment 1295 [details]
proposed patch against Makefile.PL

This patch makes it default to /etc for /usr/local, too. Also updates the
description for the command line vars. I think I'll rewrite that description
though, it's not very easy to grok (patch will follow).

SA is also installed in /usr/local if Perl was put there.
Comment 10 Malte S. Stretz 2003-08-29 11:06:35 UTC
rod, PLEASE don't change the meta infos on this bug (priority, milestone, 
etc.) all the time. I guess you still have an old version in your browser 
cache, please hit reload before you add the next comment. 
Comment 11 Justin Mason 2003-08-29 13:24:12 UTC
ok, let's consider the situation.

PREFIX     etc-dir
/usr       /etc
/usr/local /etc
/home/jm/usr /home/jm/etc    (good)
/usr/sa260 /usr/etc  (I think.  in this case the user would probably have chosen
an etc dir to go along with the wierd install location.)
/opt/sa    /opt/etc  (I think?)

I'm not sure if this is the correct way to do it. hmm.  Hey Dan -- you're the
FHS guy!
Comment 12 Malte S. Stretz 2003-08-29 13:51:13 UTC
I'd say: 
 
PREFIX        SYSCONFDIR 
/usr          /etc 
/usr/local    /etc            *grmbl* FHS 2.2 4.9.2 says "No other 
                              directories, except those listed below, may be 
                              in /usr/local after first installing a 
                              FHS-compliant system." But isn't very clear 
                              about the corresponding etc. seems like this is 
                              the correct way though 
/home/jm/usr  /home/jm/etc    hmmm... why not 
/usr/sa260    /usr/sa260/etc  just put it below there so the etc is where the 
                              bin is 
/opt/sa       /etc/opt/sa     according to FHS 2.2 3.12.2 
 
Comment 13 Malte S. Stretz 2003-08-29 13:51:57 UTC
assigning to me, got a nice patch :) 
Comment 14 Malte S. Stretz 2003-08-29 13:54:33 UTC
Created attachment 1296 [details]
new patch (not final) against Makefile.PL

ok, added *loads* more docu about the command line vars. this patch still isn't
FHS-complaint though (will create a new one when we foudn a consensus).
Comment 15 Malte S. Stretz 2003-08-29 14:07:17 UTC
/home/jm/usr -> /home/jm/etc is too complicated, code-wise. 
Will be /home/jm/usr/etc. 
Comment 16 Malte S. Stretz 2003-08-29 14:16:50 UTC
Created attachment 1297 [details]
(I hope) final patch against Makefile.PL

ok. now it does the following conversions:
PREFIX		SYSCONFDIR
/usr		/etc
/usr/local	/etc
/opt/foo	/etc/opt       # not 100% FHS but should be ok
/foo/bar	/foo/bar/etc
/foo/bar/usr	/foo/bar/usr/etc
Comment 17 Kai Sch 2003-08-29 14:24:43 UTC
I'm puzzled. I installed the same way as Rod and sa -D tells me this:
debug: using "/etc/mail/spamassassin" for site rules dir
How can this be?
Also, I would like to draw attention to the fact that the traditional site 
rules dir is "/etc/mail/spamassassin", so all this talking about paths
/usr       /etc
/usr/local /etc
/home/jm/usr  /home/jm/etc
/opt/sa       /etc/opt/sa
makes me wonder. Where do you put it for 
/home/jm/usr or /opt/sa ?
In /home/jm/etc/mail/spamassassin and /etc/opt/sa/mail/spamassassin?
It also makes me wonder what the proposed 
SYSCONFDIR=/etc switch would do. Configure for /etc/spamassassin or the 
traditional /etc/mail/spamassassin ?
Comment 18 Malte S. Stretz 2003-08-29 14:30:07 UTC
The problem only occurend if you have a Perl which is has a prefix of 
/usr/local itself. So I guess you've got yours in /usr. 
 
For the rest: RTFM in that patch :) Short: SYSCONFDIR is only the base name 
for the config dir, there's always /mail/spamassassin added. If you want 
something else, you can set LOCAL_RULES_DIR to a full path instead. 
Comment 19 Malte S. Stretz 2003-09-01 08:43:48 UTC
I attached a patch to bug 2388 (attachment 1304 [details]) which will hopefully fix all 
this stuff. Please test it. 

*** This bug has been marked as a duplicate of 2388 ***