I'm not denying that it's klugey, I'm just saying it works.  I can tell
something is strange with my installation from people's questions but I
can't figure out how or where my installation went bad.  This is how I
installed everything:

Downloaded images of Red Hat 7.1, burned them to disk, and installed on a
Dell Server with nothing else on it that was freshly raided for the
occasion.  I did a vanilla install that was a little light on packages as I
didn't want too much clutter on the box, but nothing weird was added to the
machine I simply chose not to install any package that didn't seem needed.

I installed ncftp, and ssh2 and they both work fine.

I installed qmail and it worked flawlessly running and the install went
exactly as the docs explain it.  Had zero problems setting up my virtual
domains and mailboxes either.

I set-up qmail-scanner and that worked just as expected as well.  I planned
on installing Sophos Sweep at this point, but got side tracked for a week
and forgot.  When I installed SA, I thought I already had sweep installed
but it turns out I don't so Sweep will be my next install.

Installing SA also was by the book.  I downloaded the tarball and dumped
into a /src directory.  I used the make file and everything went well.  My
tests all worked fine, except I did have a little problem sometimes.  When I
ran the two tests listed in the docs using spamassassin -t I would get this:
        Failed to run A_FROM_IN_AUTO_WLIST SpamAssassin test, skipping:
          (Cannot open auto_whitelist_path
/root/.spamassassin/auto-whitelist: 
        )
Now despite this goofy error, the output from the command looked how it
should.  The test spam was caught the non-spam was not.  I posted this error
to this mail-list but only got 1 reply that mentioned permissions, but my
permissions on this file and directory seem fine.  This is the one odd part
of my install.

I setup spamd so that it would load as a daemon when the system started.
Then I fired up spamd and then I reinstalled qmail-scanner.  During
installation of qmail-scanner I could see that it saw SA and it added it to
it's script.  After install I could also see the SA code as part of the
qmail-scanner-queue.pl file.

Then I tested. I sent all manner of spam-a-rific e-mails to myself.  Nothing
got caught as spam.  When I piped these same e-mails in to spamc at the
command line, however, they got caught as spam.

So I realised that mailing it and piping it are different, since perhaps the
missing mail header from just piping it would cause the spam alarm.  Just to
remove that as a possibility, I set my spam threshold score to 0.1, now just
about anything would set off the alarm.  I made a test file that was just a
collection of words from the 40_spam_phrase file.  I'm certain what I'm
using is grade A certified spam.

Still when I piped it into spamc it would get detected, when I mailed it to
myself it would not.

I checked my mail and scanner settings to make sure I actually was using the
scanner and not the standard qmail-queue and all was as it should be.

I checked the qmail-scanner-queue logs and I could see that it was marking
off where it called SA and that it reported no errors.  Still mails didn't
get marked as spam.

I ran various tests where I would mess around with the scanner-queue to see
if it would react to my changes as expected and it did.  There was nothing
going on that I couldn't see.  I had it log the results of $? from the call
to spamc and it never showed errors.  

I remarked out the part the moves the working file that spamc creates to the
mail file that the queue sends.  I wanted to see if maybe spamc was working,
but if the problem were elsewhere.  If spamc were working, then these files
should have been marked as spam and I would have known that the problem was
elsewhere.  These files were not marked as spam, so I knew spamc was just
failing to identify them as such.

I did a reinstall of qmail-scanner, just to make sure (never hurts) and also
to remove all the little changes I made trying to locate my problem.

So this is what I was left with: 
1) spamc worked fine when i ran it from the command line
2) spamc did not work when it was called from qmail-scanner-queue

Up until this point I hadn't thought of users and permissions, I'm a new guy
to the wonderful world of unix, but I considered it now since it was the
biggest thing I could think of that was different between when I ran it and
when the scanner ran it.  So I tracked down what user runs
qmail-scanner-queue and I found qmailq.  So I logged in as qmailq.

As qmailq, spamc catches nothing.  It doesn't give any errors, but I could
send it the transcripts of a days programming of the home shopping club and
it wouldn't get marked as spam.  I thought the -f might be muddying the
waters, so I checked the error code after each spamc run and it was clean.
I stopped using -f and nothing changed.  I got no errors and nothing got
marked as spam.

So for kicks, and this might be where I'm making a mistake, I killed spamd
and then tried to run spamd as qmailq user.  I got this:
bind: Permission denied at /usr/local/bin/spamd line 143.

Everytime I try to run spamd I would get this error.  The only thing that
would change is the line number.  Sometimes it would be line 143, sometimes
it would be line 140.  This is where I figured I was having trouble with
bind because if you look at spamd at the line that's giving me trouble,
that's whats trying to happen there.

So at this point I edited the qmail-scanner-queue and added the -u root
option.  Now everything works as expected.  My test spams all get caught as
spam when I mail them to myself.  


So that's my story, hope I didn't bore you.  So I don't know why I needed to
add -u root, could be something goofy with my setup, but I couldn't find it
and -u root works.  I tried everything I could think of to test my
installtion.  I spent a couple days thinking about it and trying different
things.  I'm open to suggestions or ideas for improvement, but so far my
install now works, and the only change I needed to make was adding -u root.

Aside from being non-standard, is adding -u root a bad thing in any way?


-----Original Message-----
From: Dallas Engelken [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 10:17 AM
To: Woodworth, Eric
Cc: [EMAIL PROTECTED]
Subject: Re: [SAtalk] Has anybody gotten SA to work with Qmail and Qmail
s canner?


> Well in my installation, I did in fact have to add -u root to get it to
> work.

Then your setup is flaky.

> It would not work otherwise.  When I just ran spamc -f it failed, when I
> added spamc -f -u root it worked.  I can't argue with results.

It probably has something to do with creating user preference files... and
since spamc is called from qmail-scanner as qmailq, it is unable to create
user prefs for qmailq.
There are alot of things I dont know here about your setup, but that would
be my first guess.  Do you launch your spamd with the -c flag?  Just
curious.

> I don't know why my installation seems to be different, but I have seen
> other people with posts like mine on the qmail-scanner mail list so I know
> I'm not alone.

I'm sure there is an answer for this, and adding -u root is not the correct
one, because like I said, -u root has nothing to do with what user is
binding.  Also, spamc cannot increase it's permission level to root if ran
by qmailq unless it was SETUID.... which it is not.

I'll tell you 100% that -u root is NOT the correct fix....
Dallas


>
> -----Original Message-----
> From: Dallas Engelken
> To: Woodworth, Eric
> Cc: [EMAIL PROTECTED]
> Sent: 2/11/02 8:14 PM
> Subject: Re: [SAtalk] Has anybody gotten SA to work with Qmail and Qmail s
> canner?
>
> > Well for the record, just adding "-u root" into the line in the
> scanner
> > script that calls spamc fixed the problem.  Qmailq couldn't bind to
> ports.
> > It's odd because it should bind to the port while still running as
> root
> and
> > only change to qmailq after that point (at least that's how the code
> looks
> > to me) but as long as it's working I'm happy.
> >
> > Thanks for the help and suggestions.
> >
>
> qmailq doesnt need to bind a port.  the port is binded when run spamd,
> not
> spamc.  spamc is just the client that makes a socket to the open port
> spamd
> runs on.
>
> i launch spamd as root with
> root@localhost#  spamd -d
>
> then, i call spamc with the -f flag only from qmail-scanner which
> everyone
> knows runs as qmailq.  you do not need to add a -u root to spamc to make
> this work...
>
> > -u username: specify the username for spamd to process this message
> under
> this basically tells spamd which user is calling it, that way spamd know
> which .spamassassin files to process.  now if you look at your logs,
> it'll
> look like every message was processed for root if you do it that way.
>
> Dallas
>
>
> _______________________________________________
> Spamassassin-talk mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to