# Problems with postfix mail queue -- RESOLVED

## Fred Krogh

I have lots of deferred messages.  When I run postqueue -f, I get errors like *Quote:*   

> Sep 19 21:30:35 mon1 postfix/smtp[4643]: 9F0D59EAE22: to=<fkrogh@mathalacarte.com>, relay=none, delay=36812, delays=36812/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)

 in /var/log/messages.  I've commented our references to amavis as follows *Quote:*   

> # grep amavis /etc/postfix/main.cf /etc/postfix/master.cf
> 
> /etc/postfix/main.cf:#content_filter=smtp-amavis:[127.0.0.1]:10024
> 
> /etc/postfix/master.cf:smtp-amavis unix -	-	n	-	2  smtp
> ...

 as in my searching I found that these kinds of problems may be due to amavis.  I'd love to have some suggestions on how to get the mail working again.  Thanks,

FredLast edited by Fred Krogh on Thu Sep 20, 2018 6:02 pm; edited 1 time in total

----------

## freke

 *Quote:*   

> I have lots of deferred messages. When I run postqueue -f, I get errors like
> 
> Quote:
> 
> Sep 19 21:30:35 mon1 postfix/smtp[4643]: 9F0D59EAE22: to=<fkrogh@mathalacarte.com>, relay=none, delay=36812, delays=36812/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)

 It's the handoff to amavis for scanning - Is amavis running?

Is amavis listining on that port (it's the default - but still)

Any error messages from amavis in logs?

----------

## Fred Krogh

It seems that at least I'm getting mail this morning.  But postqueue -f is giving the same errors, and amavis is not running.  Looking back in the logs I found *Quote:*   

> Sep 19 21:29:08 mon1 amavis[2375]: Net::Server: Group Not Defined.  Defaulting t
> 
> o EGID '102 102'
> 
> Sep 19 21:29:08 mon1 amavis[2375]: Net::Server: User Not Defined.  Defaulting to
> ...

 I think these were the result of my playing around with different ways of removing amavis from the configuration files for postfix.

I just ran sa-update, but that makes no difference, but then amavis is not currently running.  Many thanks for looking into this.

----------

## freke

If you want to remove amavis from configuration that's simply a question of removing the content-filter line in main.cf and the smtp-amavis reference in master.cf.

Oth. if you want to get amavis running;

is $daemon_user and $daemon_group set in /etc/amavisd.conf ?

you can increase log level of amavis setting the $log_level variable in /etc/amavisd.conf

You tried to restart amavisd after sa-update? - still same error?

----------

## Fred Krogh

In amavisd.conf I have *Quote:*   

> $daemon_user  = 'amavis';     # (no default;  customary: vscan or amavis), -u
> 
> $daemon_group = 'amavis';     # (no default;  customary: vscan or amavis), -g

 Iniitially amavis was not running.

I tried to run it and I can best show what happened by showing the commands. (psg is an alias that runs ps together wirh grep) *Quote:*   

> mon1 ~ # /etc/init.d/amavisd start
> 
>  * WARNING: amavisd has already been started
> 
> mon1 ~ # /etc/init.d/amavisd restart
> ...

 At least to me, this seems like strange behavior.  In the log files the one time amavis started, I have *Quote:*   

> Sep 20 09:01:09 mon1 amavis[28272]: starting. /usr/sbin/amavisd at mon1.mathalac
> 
> arte.com amavisd-new-2.11.0 (20160426), Unicode aware, LANG="en_US.utf8"
> 
> Sep 20 09:01:09 mon1 amavis[28276]: Net::Server: Group Not Defined.  Defaulting 
> ...

 I'm hopeful that this means more to you than to me.  Many thanks!

----------

## freke

Is amavis installed via portage/emerge?

ie. is perl-dependecies installed?

is it using the correct/expected config-file?

You can try starting it with *Quote:*   

> /etc/init.d/amavisd debug

  instead of start - to see if that gives something additional info.

I get all this output with loglevel set to 2 in the amavisd.conf *Quote:*   

> Sep 20 18:43:52 mail amavis[14418]: logging initialized, log level 2, syslog: amavis.mail
> 
> Sep 20 18:43:52 mail amavis[14418]: sd_notify (no socket): STATUS=Config files have been read, modules loaded.
> 
> Sep 20 18:43:52 mail amavis[14418]: starting. /usr/sbin/amavisd at mail.vlh.dk amavisd-new-2.11.0 (20160426), Unicode aware, LANG="en_US.utf8"
> ...

 So the few lines you get seems quite... sparse.Last edited by freke on Thu Sep 20, 2018 4:59 pm; edited 2 times in total

----------

## Fred Krogh

Everything on my system has been installed using portage/emerge.  equery g amavisd-new gives a long list (150 of them) of perl modules

----------

## freke

Starting with /etc/init.d/amavisd debug probably creates quite some output so use wgetpaste or something similar  :Wink: 

----------

## Fred Krogh

I'm mystified.  I could post the debug print, but with that running, postqueue -f gave no errors.  And a little mail arrived, unfortunately it was spam and got deleted before I bothered to look at the dates.  So maybe things are wroking now.   It seems that /etc/init.d/amavisd stop does not really stop things, but using zap instead of stop seems to do the job.  I'm going to try running with amavis enabled in the configuration files and send some mail to myself.  However that turns out, I'll postl the results here.  Many thanks.

Just tried this and it worked!!  Another thing that I did when having problems was to back out of the latest postfix.  I will now try that and see what happens.

And now postfix-3.3.1-r1 seems to work for me as well.  At least to me all of this will just remain a mystery!  Thanks for the help.

----------

