I recently set up smtp-vilter 1.1.4, SpamAssassin, and ClamAv 0.75 on Fedora Core 2, I am having problems with the three programs working together. smtp-vilter seems to be working and I can send/receive mail, but clamd and spamd don't seem to be configured right, or they don't have the proper permissions. Here is a section of my mail log file with the errors:

Aug 19 15:33:53 pma smtp-vilter[20173]: clamd: unable to connect socket, Connection refused
Aug 19 15:33:53 pma smtp-vilter[20173]: error during virus scan of file /tmp/vilter.XXXXlVgJIQ
Aug 19 15:33:53 pma smtp-vilter[20173]: marking message (but deliver anyway)
Aug 19 15:33:53 pma sendmail[20176]: i7JKXk0h020176: Milter add: header: X-Virus-Scan: smtp-vilter
Aug 19 15:33:53 pma sendmail[20176]: i7JKXk0h020176: Milter add: header: X-SMTP-Vilter-Version: 1.1.4
Aug 19 15:33:53 pma sendmail[20176]: i7JKXk0h020176: Milter add: header: X-SMTP-Vilter-Backend: vilter-clamd
Aug 19 15:33:53 pma sendmail[20176]: i7JKXk0h020176: Milter add: header: X-SMTP-Vilter-Status: unchecked
Aug 19 15:33:53 pma spamd[20114]: connection from localhost.localdomain [127.0.0.1] at port 36154
Aug 19 15:33:53 pma spamd[20178]: Still running as root: user not specified with -u, not found, or set to root. Fall back to nobody.
Aug 19 15:33:53 pma spamd[20178]: checking message <> for (unknown):99.
Aug 19 15:33:53 pma spamd[20178]: bad protocol: header error: (Content-Length mismatch: Expected 49346064674759899 bytes, got 42203 bytes)
Aug 19 15:33:53 pma smtp-vilter[20173]: spamd: no response to STREAM cmd, Success
Aug 19 15:33:53 pma smtp-vilter[20173]: error during spam scan of file /tmp/vilter.XXXXlVgJIQ
Aug 19 15:33:53 pma smtp-vilter[20173]: marking message (but deliver anyway)
Aug 19 15:33:53 pma sendmail[20176]: i7JKXk0h020176: Milter add: header: X-Spam-Checker: smtp-vilter
Aug 19 15:33:53 pma sendmail[20176]: i7JKXk0h020176: Milter add: header: X-SMTP-Vilter-Version: 1.1.4
Aug 19 15:33:53 pma sendmail[20176]: i7JKXk0h020176: Milter add: header: X-SMTP-Vilter-Backend: vilter-spamd
Aug 19 15:33:53 pma sendmail[20176]: i7JKXk0h020176: Milter add: header: X-Spam-Score: 0.0
Aug 19 15:33:53 pma sendmail[20176]: i7JKXk0h020176: Milter add: header: X-Spam-Status: unchecked

Could there be a problem with user or group permissions on any of the directories used by smtp-vilter or clamd? What user should spamassassin be running as, and what permissions are needed on the /tmp folder?

Thanks in advance for any help with this.

Dani AI

Generated

Short diagnostic & fix checklist based on ’s log and ’s comments — two separate problems are likely: clamd isn’t listening where smtp‑vilter expects, and spamd is either running with wrong privileges or there’s a spamd/spamc protocol mismatch.

First, confirm clamd is actually running and which socket it exposes (Unix socket vs TCP). Check the process, the listening socket and clamd logs:

ps -ef | grep -i clamd
netstat -lnp | egrep '3310|clamd'
ls -l /var/run/clamav /tmp/clamd* 2>/dev/null
tail -n50 /var/log/clamav/clamd.log

If clamd uses a Unix socket, ensure smtp‑vilter is pointed to the same path; if using TCP set TCPSocket and TCPAddr in clamd.conf so it listens on 127.0.0.1:3310. ()

If using a Unix socket, set socket ownership/mode so the milter user can connect (LocalSocketGroup / LocalSocketMode in clamd.conf), or add the smtp‑vilter user to that group. Example clamd.conf entries:

TCPSocket 3310
TCPAddr 127.0.0.1

# OR for unix socket
LocalSocket /var/run/clamav/clamd.sock
LocalSocketGroup mail
LocalSocketMode 660

Then chgrp/chmod the socket (or restart clamd to recreate it). (manpages.debian.org)

For SpamAssassin: run spamd as a dedicated non‑root user (pass -u <user> on startup) and confirm spamd and your client use compatible protocol/versions. The “Content‑Length mismatch” is spamd detecting the client’s advertised length doesn’t match the actual bytes received — commonly a protocol/version or client usage issue when STREAM is used. Check spamd’s startup options and versions:

spamd --version
spamc -V
getent passwd spamd   # confirm the -u user exists

Start spamd with something like spamd --daemonize -u spamd -H /var/spool/spamassassin -i 127.0.0.1 -p 783. (spamassassin.apache.org)

Finally, verify /tmp is the standard sticky world‑writable mode (drwxrwxrwt) and that temp files smtp‑vilter writes are readable by the clamd/spamd processes; if not, put smtp‑vilter temp files in a dedicated directory with controlled group perms (add smtp‑vilter and clamd to that group). (unix.stackexchange.com)

If problems persist, capture exact clamd/spamd startup logs and the socket path and post them (init script or /etc/clamd.conf and the spamd command line) so the socket/permission mismatch can be pinpointed.

Aug 19 15:33:53 pma smtp-vilter[20173]: clamd: unable to connect socket, Connection refused

clamav seems to not be able to connect. (probably to an external host for updates
then fails the scan without virus definitions, or the port could be in use already)
check the clamav documentation for which ports to allow/deny for clamav.

I usually run spamassassin as the postfix user. (but then I use postfix for my MTA)

file permissions could indeed play a part..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.