# connect to transport smtp-amavis: Connection refused

## G|N|

i tried amavis, but i removed it and now my syslog gives every minute this line:

```
warning: connect to transport smtp-amavis: Connection refused

```

i have nothing like amavis or so in my /etc/postfix/main.cf or master.cf anymore.

i allready tried postmap /etc/postfix/transport, but that dind't work either.

----------

## adaptr

Have you restarted Postfix ?

----------

## G|N|

yes i did!

here's the syslog:

```

Mar 10 14:32:00 server postfix/postfix-script: starting the Postfix mail system

Mar 10 14:32:00 server postfix/master[9395]: daemon started

Mar 10 14:32:03 server postfix/qmgr[9398]: warning: connect to transport spamc_f

ilter: Connection refused

Mar 10 14:32:06 server postfix/qmgr[9398]: warning: connect to transport smtp-am

avis: Connection refused

```

/etc/postfix/main.cf

```
# see /usr/share/postfix/main.cf.dist for a commented, fuller

# version of this file.

# Do not change these directory settings - they are critical to Postfix

# operation.

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

program_directory = /usr/lib/postfix

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)

setgid_group = postdrop

biff = no

# appending .domain is the MUA's job.

append_dot_mydomain = no

myhostname = thuis.lan

alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

myorigin = /etc/mailname

mydestination =  server.thuis.lan, localhost.thuis.lan, localhost

relayhost = smtp.scarlet.be

mynetworks = 127.0.0.0/8 192.168.0.0/8 #relay range invullen

mailbox_command =  /usr/bin/procmail

mailbox_size_limit = 0

recipient_delimiter = +

```

master.cf

```
# ==========================================================================

# service type  private unpriv  chroot  wakeup  maxproc command + args

#               (yes)   (yes)   (yes)   (never) (50)

# ==========================================================================

smtp      inet  n       -       -       -       -       smtpd

#628      inet  n       -       -       -       -       qmqpd

pickup    fifo  n       -       -       60      1       pickup

cleanup   unix  n       -       -       -       0       cleanup

qmgr      fifo  n       -       -       300     1       qmgr

#qmgr     fifo  n       -       -       300     1       nqmgr

rewrite   unix  -       -       -       -       -       trivial-rewrite

bounce    unix  -       -       -       -       0       bounce

defer     unix  -       -       -       -       0       bounce

flush     unix  n       -       -       1000?   0       flush

smtp      unix  -       -       -       -       -       smtp

showq     unix  n       -       -       -       -       showq

error     unix  -       -       -       -       -       error

local     unix  -       n       n       -       -       local

virtual   unix  -       n       n       -       -       virtual

lmtp      unix  -       -       n       -       -       lmtp

#

# Interfaces to non-Postfix software. Be sure to examine the manual

# pages of the non-Postfix software to find out what options it wants.

# The Cyrus deliver program has changed incompatibly.

#

cyrus     unix  -       n       n       -       -       pipe

  flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m ${extension} ${user}

uucp      unix  -       n       n       -       -       pipe

  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

ifmail    unix  -       n       n       -       -       pipe

  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp     unix  -       n       n       -       -       pipe

  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -d -t$nexthop -f$sender $recipient

scalemail-backend unix  -       n       n       -       2       pipe

  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}

# only used by postfix-tls

#smtps    inet  n       -       n       -       -       smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes

#587      inet  n       -       n       -       -       smtpd -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes

```

----------

## adaptr

 *Quote:*   

> /etc/postfix/main.cf

 

Horrible!  :Wink: 

```
myhostname = thuis.lan
```

This is, in fact, a domain name, not a hostname.

```
myorigin = /etc/mailname
```

This should be a domain name, or a hostname if the machine is not the authoritative MX for the domain.

```
mydestination =  server.thuis.lan, localhost.thuis.lan, localhost
```

This, on the other hand, should  include a domain name.

```
mynetworks = 127.0.0.0/8 192.168.0.0/8
```

Nope - 192.168.0.0/24 is what you want here.

Since the amavis and spamc transports are no longer present in master.cf I strongly suspect that you did not properly restart Postfix.

----------

## kbjorn

I have the exact problem as above. I had amavis installed and working but it seemed to crash after a while so until I solved that I unmerged amavis and cleaned main.cf and master.cf AND rebooted the server. I still get this:

```

warning: connect to transport smtp-amavis: Connection refused

```

Here is my main.cf:

```

queue_directory = /var/spool/postfix 

command_directory = /usr/sbin 

daemon_directory = /usr/lib/postfix 

mail_owner = postfix 

myhostname=Server.kbjorn.homelinux.org

mydomain=kbjorn.homelinux.org

myorigin = $myhostname 

mydestination = $myhostname, localhost.$mydomain $mydomain 

unknown_local_recipient_reject_code = 450 

mynetworks_style = subnet 

mynetworks = 127.0.0.0/8 192.168.0.0/24 

mailbox_command = /usr/bin/procmail 

debug_peer_level = 2 

debugger_command =

        PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:

        xxgdb = $daemon_directory/$process_name $process_id & sleep 5 

sendmail_path = /usr/sbin/sendmail 

newaliases_path = /usr/bin/newaliases 

mailq_path = /usr/bin/mailq 

setgid_group = postdrop 

manpage_directory = /usr/share/man 

sample_directory = /usr/share/doc/postfix-2.1.5-r2/sample 

readme_directory = /usr/share/doc/postfix-2.1.5-r2/readme

default_destination_concurrency_limit = 2 

alias_database = hash:/etc/mail/aliases 

local_destination_concurrency_limit = 2 

alias_maps = hash:/etc/mail/aliases 

home_mailbox =.maildir/

smtpd_sasl_auth_enable = yes 

smtpd_sasl_security_options = noanonymous 

smtpd_sasl_local_domain = 

broken_sasl_auth_clients = yes 

smtpd_client_restrictions = permit_sasl_authenticated, reject_unauth_destination

#smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination 

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject

smtpd_use_tls=yes 

smtpd_tls_auth_only = yes 

smtpd_tls_key_file = /etc/ssl/postfix/server.key 

smtpd_tls_cert_file = /etc/ssl/postfix/server.crt 

smtpd_tls_CAfile = /etc/ssl/postfix/server.pem 

smtpd_tls_loglevel = 3 

smtpd_tls_received_header = yes 

smtpd_tls_session_cache_timeout = 3600s 

tls_random_source = dev:/dev/urandom 

smtp_sasl_auth_enable = yes

smtp_sasl_password_maps = hash:/etc/postfix/saslpass

smtp_sasl_security_options = noanonymous

relayhost = mail.home.sol.se

```

and my master.cf:

```

smtp      inet  n       -       n       -       -       smtpd

#smtps    inet  n       -       n       -       -       smtpd

#  -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes

#submission   inet    n       -       n       -       -       smtpd

#  -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes -o smtpd_etrn_restrictions=reject

#628      inet  n       -       n       -       -       qmqpd

pickup    fifo  n       -       n       60      1       pickup

cleanup   unix  n       -       n       -       0       cleanup

qmgr      fifo  n       -       n       300     1       qmgr

#qmgr     fifo  n       -       n       300     1       oqmgr

#tlsmgr   fifo  -       -       n       300     1       tlsmgr

rewrite   unix  -       -       n       -       -       trivial-rewrite

bounce    unix  -       -       n       -       0       bounce

defer     unix  -       -       n       -       0       bounce

trace     unix  -       -       n       -       0       bounce

verify    unix  -       -       n       -       1       verify

flush     unix  n       -       n       1000?   0       flush

proxymap  unix  -       -       n       -       -       proxymap

smtp      unix  -       -       n       -       -       smtp

relay     unix  -       -       n       -       -       smtp

#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5

showq     unix  n       -       n       -       -       showq

error     unix  -       -       n       -       -       error

local     unix  -       n       n       -       -       local

virtual   unix  -       n       n       -       -       virtual

lmtp      unix  -       -       n       -       -       lmtp

anvil     unix  -       -       n       -       1       anvil

#

# Interfaces to non-Postfix software. Be sure to examine the manual

# pages of the non-Postfix software to find out what options it wants.

#

# maildrop. See the Postfix MAILDROP_README file for details.

#

maildrop  unix  -       n       n       -       -       pipe

  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

#

# The Cyrus deliver program has changed incompatibly, multiple times.

#

old-cyrus unix  -       n       n       -       -       pipe

  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}

# Cyrus 2.1.5 (Amos Gouaux)

# Also specify in main.cf: cyrus_destination_recipient_limit=1

cyrus     unix  -       n       n       -       -       pipe

  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}

uucp      unix  -       n       n       -       -       pipe

  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

ifmail    unix  -       n       n       -       -       pipe

  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp     unix  -       n       n       -       -       pipe

  flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

```

Last edited by kbjorn on Sun Apr 17, 2005 4:20 pm; edited 1 time in total

----------

## Janne Pikkarainen

Haven't seen a problem like this myself. Maybe Postfix includes some other config file which has that amavis-transport? Didn't seen that in the config files above, but anyway how about

```
grep -ir amavis /etc/postfix/
```

or 

```
grep -ir amavis /etc
```

----------

## kbjorn

 *Quote:*   

> 
> 
> Kod: grep -ir amavis /etc/postfix/
> 
> or 
> ...

 

Tried that doesn't give anything? This is really confusing me. It must be stored somewhere though !!!!

----------

## smithjd15

Can someone with the issue post the output of 'ps -A' after stopping Postfix with the init script?

----------

## kbjorn

Here it is

```

  PID TTY          TIME CMD

    1 ?        00:00:01 init

    2 ?        00:00:00 ksoftirqd/0

    3 ?        00:00:00 events/0

    4 ?        00:00:00 khelper

    9 ?        00:00:00 kthread

   18 ?        00:00:00 vesafb

   20 ?        00:00:00 kblockd/0

   51 ?        00:00:00 kapmd

   77 ?        00:00:00 aio/0

   76 ?        00:00:06 kswapd0

  666 ?        00:00:00 kseriod

 1964 ?        00:00:00 reiserfs/0

 2029 ?        00:00:00 udevd

 5595 ?        00:00:02 kjournald

 5606 ?        00:00:00 kjournald

 5744 ?        00:00:00 dhcpcd

 7310 ?        00:00:00 syslogd

 7321 ?        00:00:00 klogd

 7355 ?        00:00:02 server_linux

 7356 ?        00:00:00 server_linux

 7357 ?        00:00:01 server_linux

 7358 ?        00:00:01 server_linux

 7359 ?        00:00:00 server_linux

 7360 ?        00:00:00 server_linux

 7361 ?        00:00:00 server_linux

 7362 ?        00:00:00 server_linux

 7363 ?        00:00:02 server_linux

 7455 ?        00:00:00 mysqld_safe

 7537 ?        00:00:00 mysqld

 7541 ?        00:00:00 sshd

 7554 ?        00:00:00 mysqld

 7555 ?        00:00:00 mysqld

 7556 ?        00:00:00 mysqld

 7564 ?        00:00:01 apache2

 7596 ?        00:00:00 apache2

 7614 ?        00:00:00 freshclam

 7633 ?        00:00:00 apache2

 7634 ?        00:00:00 apache2

 7635 ?        00:00:00 apache2

 7637 ?        00:00:00 apache2

 7638 ?        00:00:00 apache2

 7643 ?        00:00:00 apache2

 7644 ?        00:00:00 apache2

 7645 ?        00:00:00 apache2

 7646 ?        00:00:00 apache2

 7647 ?        00:00:00 apache2

 7654 ?        00:00:00 apache2

 7655 ?        00:00:00 apache2

 7656 ?        00:00:00 apache2

 7657 ?        00:00:01 apache2

 7658 ?        00:00:00 apache2

 7659 ?        00:00:00 apache2

 7660 ?        00:00:00 apache2

 7661 ?        00:00:00 apache2

 7662 ?        00:00:00 apache2

 7663 ?        00:00:00 apache2

 7664 ?        00:00:00 apache2

 7665 ?        00:00:00 apache2

 7666 ?        00:00:00 apache2

 7667 ?        00:00:00 apache2

 7668 ?        00:00:00 apache2

 7669 ?        00:00:00 apache2

 7670 ?        00:00:00 apache2

 7671 ?        00:00:00 apache2

 7672 ?        00:00:00 apache2

 7673 ?        00:00:00 apache2

 7674 ?        00:00:00 apache2

 7675 ?        00:00:00 apache2

 7676 ?        00:00:00 apache2

 7677 ?        00:00:00 apache2

 7678 ?        00:00:00 apache2

 7679 ?        00:00:00 apache2

 7680 ?        00:00:01 apache2

 7681 ?        00:00:00 apache2

 7682 ?        00:00:00 apache2

 7683 ?        00:00:00 apache2

 7684 ?        00:00:00 apache2

 7699 ?        00:00:00 apache2

 7700 ?        00:00:00 apache2

 7701 ?        00:00:00 apache2

 7702 ?        00:00:00 apache2

 7703 ?        00:00:00 apache2

 7704 ?        00:00:00 apache2

 7705 ?        00:00:00 apache2

 7706 ?        00:00:00 apache2

 7707 ?        00:00:00 apache2

 7708 ?        00:00:00 apache2

 7709 ?        00:00:00 apache2

 7710 ?        00:00:00 apache2

 7711 ?        00:00:00 apache2

 7712 ?        00:00:00 apache2

 7713 ?        00:00:00 apache2

 8112 ?        00:00:00 courierlogger

 8113 ?        00:00:00 authdaemond

 8139 ?        00:00:00 couriertcpd

 8147 ?        00:00:00 courierlogger

 8152 ?        00:00:00 authdaemond

 8265 ?        00:00:00 gpm

 8375 ?        00:00:00 portmap

 8400 ?        00:00:00 rpc.statd

 8408 ?        00:00:04 nfsd

 8409 ?        00:00:09 nfsd

 8410 ?        00:00:10 nfsd

 8411 ?        00:00:04 nfsd

 8412 ?        00:00:04 nfsd

 8413 ?        00:00:04 nfsd

 8414 ?        00:00:10 nfsd

 8415 ?        00:00:11 nfsd

 8418 ?        00:00:00 lockd

 8419 ?        00:00:00 rpciod/0

 8420 ?        00:00:00 rpc.mountd

 8879 ?        00:00:13 spamd

 8932 ?        00:00:00 sshd

 8995 ?        00:00:00 smbd

 8998 ?        00:00:00 smbd

 8999 ?        00:00:00 nmbd

 9049 pts/0    00:00:00 bash

 9097 ?        00:00:00 cron

 9145 ?        00:00:00 miniserv.pl

 9197 pts/0    00:00:00 tail

 9199 ?        00:00:00 xinetd

 9214 tty1     00:00:00 agetty

 9215 tty2     00:00:00 agetty

 9216 tty3     00:00:00 agetty

 9217 tty4     00:00:00 agetty

 9238 tty5     00:00:00 agetty

 9253 tty6     00:00:00 agetty

 9300 ?        00:00:05 spamd

 9301 ?        00:00:04 spamd

 9302 ?        00:00:02 spamd

 9303 ?        00:00:06 spamd

 9304 ?        00:00:03 spamd

 9322 ?        00:00:02 couriertls

 9323 ?        00:00:16 courier-imapd

 9378 ?        00:00:02 sshd

 9384 pts/2    00:00:00 bash

 9876 pts/2    00:00:19 emerge

12704 pts/2    00:00:00 sandbox

12705 pts/2    00:00:02 ebuild.sh

17405 ?        00:00:00 saslauthd

17407 ?        00:00:00 saslauthd

17408 ?        00:00:00 saslauthd

17409 ?        00:00:00 saslauthd

17410 ?        00:00:00 saslauthd

19000 pts/2    00:00:00 emake

19001 pts/2    00:00:00 make

19486 pts/2    00:00:00 sh

19541 pts/2    00:00:00 make

22564 pts/2    00:00:02 make

23056 ?        00:00:00 pdflush

23129 ?        00:00:00 pdflush

23422 ?        00:00:00 sshd

23428 pts/1    00:00:00 bash

23512 ?        00:00:00 sshd

23526 ?        00:00:00 sftp-server

23534 pts/2    00:00:00 xgcc

23535 pts/2    00:00:01 cc1

23536 pts/2    00:00:00 as

23537 pts/2    00:00:00 xgcc

23538 pts/2    00:00:01 cc1

23539 pts/2    00:00:00 as

23540 pts/1    00:00:00 ps

```

----------

## trossachs

Did anyone ever manage to resolve this issue? The problem still persists even after you have reinstalled both PF and Amavis:

```
warning: connect to transport smtp-amavis: Connection refused
```

----------

## fitzy

I have the same problem!  I've tried all the suggestions above plus more with no luck.  Did anyone make any progress with it?

----------

## magic919

As there is no Postfix prefix in the syslog I'd say it's not Postfix itself.  Both the main.cf files suggest Procmail is being used.  I'd suggest checking there to see if amavis is being invoked.

----------

## fitzy

Mmm.  I managed to solve this problem by commenting out local_transport as follows:

(from /etc/postfix/main.cf)

```
alias_maps                      =       mysql:/etc/postfix/mysql-aliases.cf

relocated_maps                  =       mysql:/etc/postfix/mysql-relocated.cf

#local_transport                =       local

local_recipient_maps            =       $alias_maps $virtual_mailbox_maps unix:passwd.byname

virtual_transport               =       virtual

virtual_mailbox_domains         =       [mydomain].co.nz

virtual_minimum_uid             =       1000

virtual_gid_maps                =       static:1002

virtual_mailbox_maps            =       mysql:/etc/postfix/mysql-virtual-maps.cf

virtual_alias_maps              =       mysql:/etc/postfix/mysql-virtual.cf

virtual_uid_maps                =       static:1002

virtual_mailbox_base            =       /

#virtual_mailbox_limit
```

Perhaps since I am using mysql for my virtual transport maps, I should have commented this out in the first place.

----------

## trossachs

Did this work for anyone else? I no longer have the prob, but don't know what resolved it.

----------

## magic919

Many of the others are using procmail as an LDA, so this solution could not really apply to them.

----------

## trossachs

LDA = local delivery agent?

----------

## magic919

Yep.

----------

## gmichels

Stumped into this problem today while trying to follow the mailfilter guide available at gentoo's docs.

As things didn't turn out as expected, I rolled back to my old configuration, deleted all traces of amavis/spamassassin/clamav from my system, and yet I was still receiving those warning messages, even after restarting postfix. It turned out I had a few e-mails on postfix's queue, which were added while the smtp-amavis transport was active. After I deleted those e-mails from the queue, the warning messages were gone.

See your mail queue with "postqueue -p" and delete unwanted e-mails with "postsuper -d <id>".

----------

## trossachs

Have you tried amavisd/zap and then starting again? I restarted Spamd this morning and Amavis stopped working. So I zapped it and restarted. All ok.

----------

