# postfix/amavisd-new/spamassassin/dovecot (?)problem -- FIXED

## Fred Krogh

Mail has stopped being delivered seemingly at a time with nothing changed.   This is the second time this has happened to me, see https://forums.gentoo.org/viewtopic-t-815620-highlight-postfix.html.  The problem this time seems different.  When I run postqueue -f, I'm getting errors like *Quote:*   

> Apr  9 22:33:34 mon postfix/error[308]: DBD3D228E66: to=<fkrogh@mathalacarte.com>, relay=none, delay=28205, delays=28205/0.14/0/0.01, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)

   My configuration files are unchanged.

I've re-emerged amavisd-new and spamassassin.  At the end of the latter I get *Quote:*   

> >>> Completed installing spamassassin-3.3.1-r1 into /var/tmp/portage/mail-filter/spamassassin-3.3.1-r1/image/
> 
>  * QA Notice: make jobserver unavailable:
> 
>  * 
> ...

 Mail::DKIM is installed.

I am at a loss and am going to bed.  Any ideas I will check out in the morning.  Many thanks,

Fred

PS: The problem may have occurred after my last emerge.  Here is the output from that including the multiple emerges of spamassassin.  Might the diagnostics on tdb indicate the problem. *Quote:*   

> ####### ./sys-libs:tdb-1.2.0-r2:20100409-213643.log ###########
> 
> ERROR: preinst
> 
> This package will overwrite one or more files that may belong to other
> ...

 Last edited by Fred Krogh on Sat Apr 10, 2010 4:49 pm; edited 1 time in total

----------

## nativemad

Hi, 

 *Quote:*   

> connect to 127.0.0.1[127.0.0.1]:10024: Connection refused

 

This looks like your amavisd has problems...

Check if it is running and listens to 10024 ("netstat --inet -nap" should mention port 10024!)

Maybe just restarting that service could help!?  :Wink: 

Hope that helps a bit

Cheers

----------

## Fred Krogh

I had stopped and started amavisd several times, but it had not started.  Your post convinced me of that - thanks.  It seems I had to run sa-update.  And in order to get that to run I had to re-emerge libwww-perl.  (Perl has not been my best friend when it comes to mail.)  The mail is now coming in, but I'm getting lots of messages in the log file like *Quote:*   

> Apr 10 05:38:32 mon amavis[3047]: (03047-01-4) (!!)WARN: all primary virus scanners failed, considering backups

   If anyone has an idea why I'm getting this message I'd appreciate seeing them.  I just sent a test message after re-emerging clamav, and I'm still getting the message.  Thanks,

Fred

----------

## nativemad

 *Quote:*   

> all primary virus scanners failed, considering backups

 

I would say that either clamd isn't running or amavis hasn't got enough rights to use it's socket.... 

I configured clamd to run as amavis-user... watch out that the path to the socket is correct in both configs...

----------

## Fred Krogh

I think you are correct about the problem.  Unfortunately, if in clamd.conf I have "user amavis" or "user amavis-user" clamd refuses to start.  I don't seem to have any details on the reason.  Thanks,

Fred

----------

## nativemad

It is long ago since i've set that up, but i think i just moved the pid and socket option in clamd.conf to reside in /var/amavis.

Maybe you also have to chown the logfile of clamd!? 

```
smtp ~ # diff -ru  /etc/._cfg0000_clamd.conf /etc/clamd.conf | grep amav

-LogFile /var/log/clamav/clamd.log

-PidFile /var/run/clamav/clamd.pid

+PidFile /var/amavis/clamd.pid

-LocalSocket /var/run/clamav/clamd.sock

+LocalSocket /var/amavis/clamd

-User clamav

+User amavis

```

----------

## Fred Krogh

Your replies are helpful, but I'm still getting the diagnostic *Quote:*   

> Apr 10 08:09:45 mon amavis[3817]: (03817-03) (!!)WARN: all primary virus scanners failed, considering backups

 .  It clamd is running as user amavis with the pid, sock, and log files all there with user amavis.

----------

## nativemad

I have the following within /etc/amavisd.conf (the bold part is the path to the socket!  :Wink:  )

 *Quote:*   

> # ### http://www.clamav.net/
> 
>  ['ClamAV-clamd',
> 
>    \&ask_daemon, ["CONTSCAN {}\n", "/var/amavis/clamd"],
> ...

 

----------

## Fred Krogh

Thanks for your persistence.  The four lines you gave that were not commented out, were commented out in my amavisd.conf.  After uncommenting them, I get a new diagnostic. *Quote:*   

> Apr 10 08:58:40 mon amavis[1135]: (01135-01) (!)ClamAV-clamd: Can't connect to UNIX socket /var/amavis/clamd: 2, retrying (2)
> 
> Apr 10 08:58:46 mon amavis[1135]: (01135-01) (!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/amavis/clamd (Can't connect to UNIX socket /var/amavis/clamd: No such file or directory) at (eval 101) line 373.\n
> 
> 

 The directory listing of /var/amavisd look like this *Quote:*   

> -rw-r-----   1 amavis amavis     0 Apr 10 08:58 amavisd.lock
> 
> -rw-r-----   1 amavis amavis     5 Apr 10 08:58 amavisd.pid
> 
> srwxr-x---   1 amavis amavis     0 Apr 10 08:58 amavisd.sock=
> ...

 I'm still stumped!

----------

## nativemad

 *Quote:*   

> mkfifo /var/amavis/clamd
> 
> chown amavis:amavis /var/amavis/clamd
> 
> 

 

Cheers!   :Razz: 

--edit: 

corrected the spelling!  :Wink: 

----------

## Fred Krogh

That was too cryptic for me.  I don't have mkfio and don't know where to get it.  I have /usr/sbin/clamd, and /var/amavis/amavisd.sock.  Could you expand a little on you reply.  Thanks,

Fred

----------

## nativemad

Ok, sorry...  :Rolling Eyes: 

You just dont have the configured socket-file, as i didn't took it's original name in my examples....

mkfifo would create a socket file..(its in the coreutils) -I just need to look twice for syntax errors, if i write shell commands directly in a post next time!!  :Rolling Eyes: 

Also watch out that you set "LocalSocket /var/amavis/clamd" in /etc/clamd.conf...

----------

## Fred Krogh

That fixed it.  I don't understand why using *Quote:*   

> srw-rw-rw-   1 amavis pulse      0 Apr 10 09:44 clamd=

 and *Quote:*   

> srw-rw-rw-   1 amavis pulse      0 Apr 10 09:17 clamd.sock=

 doesn't.  But I'm very happy to have it working.  Thanks,

Fred

----------

## nativemad

Cool!  :Razz: 

Actually both would work... you can name the socket like you want it.... The only thing is that amavis has to know it!  :Wink: 

I know, the amavis config is very huge and to find the right place is quite hard... At least it's quite well documented (the part i quoted earlier is the relevant documentation for what exactly your problem was!   :Wink:  )

----------

## Fred Krogh

Well actually using /var/amavisd/clamd.sock did not work.  But I'm tired of this and just happy to have something working.  I did have this set in clamd.conf, and changed it to /var/amavisd/clamd when I created the new socket.

----------

