> > it "hangs" on trying to open the auto-whitelist db, and after the default > > 30 tries it gives up with the message "Cannot open > > ~/.spamassassin/auto-whitelist: permission denied" or similar. I've tried > > to set permissions of files and directories without luck. > > One cause of this message is if you have multiple major versions of > libdb installed simultaneously. They tend to `fight'; libdb2 ends up > calling some libdb3 internal functions when opening or creating > databases, and you end up getting a nonsensical error passed up to the > upper layers. (In addition to EPERM, I got EEXIST, which was really > stupid: you can't create this database file because it doesn't exist?!) > > The solution is to arrange for Perl to only use one major version of > libdb at once (and note that Perl tries to dlopen() libdb, so it can be > hard to do: I did it here by upgrading to libdb4 and rebuilding > everything that used libdb against that version).
Hmm... I thought that this would be the solution, but it seems I was mistaken... The funny thing is that when I'm starting spamd, it can actually tie to root's auto_whitelist just fine, and it also modifies it as it should. But when I connect with spamc as myself, spamd can't use my own auto_whitelist for some reason. But it does create it in my .spamassassin folder, and it does get the lock on it. Debug output follows, and a list of my homedir. [root@holger egge]# spamd -D -c -a -p 2000 debug: ignore: test message to precompile patterns and load modules debug: using "/usr/share/spamassassin" for default rules dir debug: using "/etc/mail/spamassassin" for site rules dir debug: running header regexp tests; score so far=0 debug: running body-text per-line regexp tests; score so far=0.8 debug: running uri tests; score so far=0.8 debug: running raw-body-text per-line regexp tests; score so far=0.8 debug: running full-text regexp tests; score so far=0.8 debug: Razor is not available debug: is Net::DNS::Resolver unavailable? 1 debug: is DNS available? 0 debug: checking RBL orbs.dorkslayers.com., set relay debug: checking RBL relays.osirusoft.com., set relay debug: checking RBL relays.ordb.org., set relay debug: checking RBL ipwhois.rfc-ignorant.org., set rfci debug: checking RBL relays.visi.com., set relay debug: checking RBL results in set relay for 127.0.0.6 debug: checking RBL results in set relay for 127.0.0.4 debug: 30667 Trying to get lock on /root/.spamassassin/auto-whitelist pass 0 debug: Tie-ing to DB file R/W in /root/.spamassassin/auto-whitelist debug: auto-whitelist (db-based): [EMAIL PROTECTED] scores 8/32.8 ### Here you see it works just fine... debug: AWL active, pre-score: 4.1, mean: 4.1 debug: Post AWL score: 4.1 debug: add_score: New count: 9, new totscore: 36.9 debug: DB addr list: untie-ing and destroying lockfile. debug: DB addr list: file locked, breaking lock. debug: is spam? score=4.1 required=5 server started on port 2000 server pid: 30667 logmsg: server started on port 2000 ### And here I send a mail through spamc logmsg: connection from localhost.localdomain [ 127.0.0.1 ] at port 4520 debug: running header regexp tests; score so far=0 debug: running body-text per-line regexp tests; score so far=9.4 debug: running uri tests; score so far=15 debug: running raw-body-text per-line regexp tests; score so far=15 debug: running full-text regexp tests; score so far=15 debug: Razor is not available debug: trying Received header date for real time: Mon, 22 Jan 2001 12:36:21 +0000 debug: trying Received header date for real time: Mon, 22 Jan 2001 12:36:21 GMT debug: trying Received header date for real time: Mon, 22 Jan 2001 12:36:16 GMT debug: trying Received header date for real time: Mon, 22 Jan 2001 04:38:11 -0800 debug: trying Received header date for real time: Sun, 21 Jan 2001 20:33:02 -0500 debug: trying Received header date for real time: Sun, 21 Jan 2001 22:21:26 -0400 debug: time_t from date=980035200, rcvd=980166981, diff=131781 debug: within time range, not raising flag debug: checking RBL orbs.dorkslayers.com., set relay debug: checking RBL relays.osirusoft.com., set relay debug: checking RBL relays.ordb.org., set relay debug: checking RBL ipwhois.rfc-ignorant.org., set rfci debug: checking RBL relays.visi.com., set relay debug: is Net::DNS::Resolver unavailable? 1 debug: round-the-world: mail relayed through ns.fundch.cl by 63.10.249.142 (HELO y068k3017, rev DNS says (unknown) debug: round-the-world: probably not debug: checking RBL results in set relay for 127.0.0.6 debug: checking RBL results in set relay for 127.0.0.4 debug: 30670 Trying to get lock on /home/egge/.spamassassin/auto-whitelist pass 0 debug: Tie-ing to DB file R/W in /home/egge/.spamassassin/auto-whitelist Cannot open auto_whitelist_path /home/egge/.spamassassin/auto-whitelist: Permission denied logmsg: server killed by SIGINT, shutting down [egge@holger Mail-SpamAssassin-2.20]$ ls -la ~/.spamassassin/ total 10 drwxr-xr-x 2 egge egge 1024 Apr 29 22:37 ./ drwx-----x 54 egge egge 6144 Apr 29 22:38 ../ -rw------- 1 egge root 0 Apr 29 22:37 auto-whitelist.db -rw-r--r-- 1 egge root 29 Apr 29 22:37 auto-whitelist.lock -rw------- 1 egge egge 1109 Apr 26 12:58 user_prefs If I run another test immediatly after this one, spamd will timeout when trying to open the DB R/W (the default 30 seconds) which I understand, as the lockfile is still there, and try to open it RO instead, which also fails with the same message, permission denied. (5 minutes later, the same happens as the first time, as the stale lockfile is killed as i should) So... if I try to start spamd with the argument "-u egge" to run as myself, it will also fail on the initial test that tries to open the auto_whitelist DB. Just as before when I passed a mail through spamc. BUT, if I start spamd as myself, ie not as root with the -u option, but running as myself and the command line "spamd -D -c -a -p 2000", it can open the db properly at startup: debug: 30861 Trying to get lock on /home/egge/.spamassassin/auto-whitelist pass 0 debug: Tie-ing to DB file R/W in /home/egge/.spamassassin/auto-whitelist debug: auto-whitelist (db-based): [EMAIL PROTECTED] scores 0/0 and also when I'm trying to send a mail through spamc debug: 30921 Trying to get lock on /home/egge/.spamassassin/auto-whitelist pass 0 debug: Tie-ing to DB file R/W in /home/egge/.spamassassin/auto-whitelist debug: auto-whitelist (db-based): [EMAIL PROTECTED] scores 0/0 debug: AWL active, pre-score: 15, mean: undef debug: Post AWL score: 15 debug: add_score: New count: 1, new totscore: 15 debug: DB addr list: untie-ing and destroying lockfile. debug: DB addr list: file locked, breaking lock. So... this tells me there's some kind of problem with the permissions here... as the file auto_whitelist.db is created with owner myself and group root, I guess root needs access to ~/.spamassassin all the way from / (even though one would think it would be able to get to the directory anyway... specially since this is a local filesystem) Let's try it. Added read rights for other on my homedir (had x already): Nope... didn't work. <some more testing> But now I have solved it! It turned out that the system was setting the TMP and TMPDIR variables to /root/tmp for root, and /tmp for other users. And other users doesn't have access to /root... If I set TMPDIR to /tmp when I start spamd, everything works just fine... so, after this long email (sorry for that) you all know what can happen to you if you are running Mandrake... ;-) Have fun! /Egge _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk