# Good DSPAM howto for Gentoo?

## mariourk

Does anyone know a good dspam howto for Gentoo?

I've been struggling with dspam for a while now, following various howto's. However,

it seems the emails aren't being put throught dspam and reinjected in postfix. When I send a test mail,

I see no X-DSPAM headers.

Any help will be most welcome.

----------

## magic919

The current Gentoo wiki has a howto that's basically a rip of my old wiki article.  Is your install based on the same method?  If it's Postfix/DSPAM/ClamAV kind of set-up then folk here will be able to help.

If you are following 'my' method then bear in mind that it only scans incoming email and you won't see DSPAM headers if you email yourself from your LAN.

----------

## mariourk

All I can find is a howto that explains how to relay to another server. That is not what I'm looking for. Could you perhaps provide a link to the howto you are refering to?

----------

## magic919

That's one looks fine.  I recognise much of the text  :Smile: 

Just leave off the relaying and the transports bit and you're done.

Assuming you start with a working Postfix install then it's not too bad.  Emerge DSPAM and config to suit your database (MySQL in my case).  Config DSPAM and get that working before adding ClamAv.  Then a few headaches to get the WebUI working. Then a re-train script for work on a Spam folder.

----------

## mariourk

In that case, it should be working. However, I see no X-Dspam headers in my testmails. Maybe you can give me some pointers why it doesn't seem to be worling?   :Confused: 

----------

## magic919

Shouldn't be a huge mystery.  The DSPAM stuff gets written to the Postfix logs.  Check your mail logs as the test message comes in.

Like this:

```

May 11 08:27:06 myserver postfix/smtpd[17118]: connect from smtp.gentoo.org[140.211.166.183]

May 11 08:27:07 myserver postfix/smtpd[17118]: NOQUEUE: filter: RCPT from smtp.gentoo.org[140.211.166.183]: <gentoo@domain.com>: Recipient address triggers FILTER dspam:unix:/var/run/dspam/dspam.sock; from=<apache@gentoo.org> to=<gentoo@domain.com> proto=ESMTP helo=<smtp.gentoo.org>

May 11 08:27:07 myserver postfix/smtpd[17118]: 732BAC164: client=smtp.gentoo.org[140.211.166.183]

May 11 08:27:07 myserver postfix/cleanup[17124]: 732BAC164: message-id=<8ce6963aa96b576524bdaffb37b4bec2@forums.gentoo.org>

May 11 08:27:07 myserver postfix/qmgr[24066]: 732BAC164: from=<apache@gentoo.org>, size=1734, nrcpt=1 (queue active)

May 11 08:27:07 myserver postfix/smtpd[17118]: disconnect from smtp.gentoo.org[140.211.166.183]

May 11 08:27:07 myserver dspam[13049]: innocent message from 140.211.166.183

May 11 08:27:07 myserver postfix/smtpd[17128]: connect from myserver.example.com[127.0.0.1]

May 11 08:27:07 myserver postfix/smtpd[17128]: C29A224D261: client=myserver.example.com[127.0.0.1]

May 11 08:27:07 myserver postfix/cleanup[17124]: C29A224D261: message-id=<8ce6963aa96b576524bdaffb37b4bec2@forums.gentoo.org>

May 11 08:27:07 myserver postfix/qmgr[24066]: C29A224D261: from=<apache@gentoo.org>, size=2142, nrcpt=1 (queue active)

May 11 08:27:07 myserver postfix/virtual[17129]: C29A224D261: to=<magic@domain.com>, relay=virtual, delay=0.15, delays=0.13/0/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)

May 11 08:27:07 myserver postfix/qmgr[24066]: C29A224D261: removed

May 11 08:27:07 myserver postfix/smtpd[17128]: disconnect from myserver.example.com[127.0.0.1]

May 11 08:27:07 myserver postfix/lmtp[17125]: 732BAC164: to=<magic@domain.com>, orig_to=<gentoo@domain.com>, relay=myserver.example.com[/var/run/dspam/dspam.sock], delay=0.58, delays=0.31/0/0/0.26, dsn=2.6.0, status=sent (250 2.6.0 <magic@domain.com> Message accepted for delivery)

May 11 08:27:07 myserver postfix/qmgr[24066]: 732BAC164: removed

```

----------

## mariourk

After dropping the MySQL database and running

```

emerge --config =dspam-3.8.0-r15

```

Things started working. I quess the problem was in a wrong database setup.

Anyway, it seems to work properly now.

Thank you for your help.  :Very Happy: 

----------

## magic919

Good to see it's working out.

----------

