Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 189086 - clamd configuration example incomplete and produces daemon failure
Summary: clamd configuration example incomplete and produces daemon failure
Status: RESOLVED WONTFIX
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Docs Team
URL: http://www.gentoo.org/doc/en/mailfilt...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-16 09:27 UTC by Vieri
Modified: 2007-10-17 19:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vieri 2007-08-16 09:27:58 UTC
If the user wants to use a local socket then one should edit /etc/clamd.conf:

LocalSocket /var/amavis/clamd.sock

otherwise the following error will appear in clamd's log and the daemon will die:

ERROR: Socket file /var/run/clamav/clamd.sock could not be bound: Permission denied

Also, the guide says to add this to clamd.conf:

PidFile /var/run/amavis/clamd.pid

but it should be:

PidFile /var/amavis/clamd.pid

otherwise the clamd log will report:

ERROR: Can't save PID in file /var/run/amavis/clamd.pid


Reproducible: Always
Comment 1 nm (RETIRED) gentoo-dev 2007-08-16 09:29:34 UTC
CCing the author for some feedback on the report.
Comment 2 Vieri 2007-08-16 10:09:05 UTC
Also clamav's socket name in amavisd.conf must be like the one specified by
LocalSocket in clamd.conf.

So Code Listing 2.12 (Modifying /etc/amavisd.conf) should show something like:

['ClamAV-clamd',
\&ask_daemon, ["CONTSCAN {}\n", "/var/amavis/clamd.sock"],
Comment 3 Vieri 2007-08-16 22:11:12 UTC
/var/amavis/virusmails doesn't seem to be used or should be specified how to(by default /var/amavis/quarantine is used instead).
Comment 4 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-08-17 22:10:39 UTC
I've been meaning to update the guide for long time now. 

In general clamd should either be running as the clamav user and place it's socket and pid file in /var/run/clamav or it should run with amavis permissions and put the files in /var/amavis/

>If the user wants to use a local socket then one should edit /etc/clamd.conf:
>LocalSocket /var/amavis/clamd.sock
>otherwise the following error will appear in clamd's log and the daemon will
>die:
>ERROR: Socket file /var/run/clamav/clamd.sock could not be bound: Permission
>denied

The guide already says to change the socket to:

LocalSocket /var/amavis/clamd

It appears that the LocalSocket option was set to /var/run/clamav/clamd.sock.

>PidFile /var/run/amavis/clamd.pid
>but it should be:
>PidFile /var/amavis/clamd.pid

Agreed. putting the clamd pid file in /var/amavis is cleaner than /var/run/amavis/

As for comment #2 I think the clamd part of amavisd.conf is fine.

I'm going to build another anti spam box soon so I'll try to update most of the guide soon.
Comment 5 Vieri 2007-08-19 11:55:12 UTC
(In reply to comment #4)
> The guide already says to change the socket to:
> LocalSocket /var/amavis/clamd

You're right. My bad. I overlooked that... So that part is fine.

Also, it appears that the latest clamav releases have the following options already set by default:
ScanMail
ScanArchive
They could be removed to make it tidier although it doesn't hurt to leave them there.

While you setup a new mailfiltering box maybe you could also include RBL lookup stuff. For example, one thing I'm not really sure of is whether RBL lookups should be performed before or after graylisting. So my smtpd_recipient_restrictions looks like this:

    permit_mynetworks,
    reject_unauth_destination,
    reject_unknown_client_hostname,
    reject_rbl_client zen.spamhaus.org,
    reject_rbl_client bl.spamcop.net,
    reject_rbl_client combined.njabl.org,
    reject_rhsbl_client blackhole.securitysage.com,
    reject_rhsbl_sender blackhole.securitysage.com,
    check_policy_service inet:127.0.0.1:2501  # SQLgrey

On another Gentoo box I have a qmail system where greylisting is performed before RBL lookups. Maybe this is a better approach because it could save Internet bandwidth.

It would be nice if you could study that too and compile it into the guide. ;-)

Thanks.
Comment 6 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-08-19 18:53:22 UTC
Thx for the feedback.

I would probably do the RBL checks with policyd-weight as mails can be rejected before being accepted by Postfix. Then I would greylist with policyd before finally running mails through amavisd-new. I don't wether running qmail give you the same range of options.
Comment 7 Vieri 2007-08-20 15:16:58 UTC
(In reply to comment #6)
> do the RBL checks with policyd-weight Then greylist with policyd

Sounds good.

> I don't wether running qmail give you the same range of options.

qmail is quite powerful but isn't that easily extensible.
I'm gradually moving to postfix and/or exim but I guess I'll end up having all three on different MX hosts.
Comment 8 nm (RETIRED) gentoo-dev 2007-09-20 18:38:06 UTC
...so, what exactly should be changed? jaervosz?
Comment 9 nm (RETIRED) gentoo-dev 2007-10-08 20:11:10 UTC
We'll have to mark this as CANTFIX or LATER or some other variation if this times out any more. Any news?
Comment 10 Jan Kundrát (RETIRED) gentoo-dev 2007-10-08 23:31:46 UTC
(In reply to comment #9)
> We'll have to mark this as CANTFIX or LATER or some other variation if this
> times out any more. Any news?

I don't see the need to close valid bug with a bit unclear solution as LATER.
Comment 11 nm (RETIRED) gentoo-dev 2007-10-09 03:19:15 UTC
(In reply to comment #10)
> I don't see the need to close valid bug with a bit unclear solution as LATER.

It's been two months since it was open, and there's no solution in sight. jaervosz, does anything *really* need to happen for this bug? Also, can we get an ETA for the other changes you said you'd be working on?
Comment 12 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-10-17 19:02:30 UTC
Sorry for my lack of action on this one. I still plan to clean up the guide as soon as possible, but I don't believe this to be a bug per se. So I think it can be safely closed.
Comment 13 nm (RETIRED) gentoo-dev 2007-10-17 19:46:44 UTC
(In reply to comment #12)
> Sorry for my lack of action on this one. I still plan to clean up the guide as
> soon as possible, but I don't believe this to be a bug per se. So I think it
> can be safely closed.

Okay. When you've got some patches ready for us, feel free to reopen this bug or create a new one with your improvements for the guide.