Hello, I got postfix/smtp[9837]: connect to[]:10024: Connection refused

September 23, 2014 11.5k views

Hello :)

I just followed the mail server setup tutorial on DigitalOcean. I got this error after trying to send a mail via Command-Line 'mail' command

Sep 23 03:16:56 suebphatt postfix/pickup[9824]: 2CABAC4B25: uid=0 from=<>
Sep 23 03:16:56 suebphatt postfix/cleanup[9833]: 2CABAC4B25: message-id=<>
Sep 23 03:16:56 suebphatt postfix/qmgr[9825]: 2CABAC4B25: from=<>, size=368, nrcpt=1 (queue active)
Sep 23 03:16:56 suebphatt postfix/smtp[9837]: connect to[]:10024: Connection refused
Sep 23 03:16:56 suebphatt postfix/smtp[9837]: 2CABAC4B25: to=<>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=4.4.1, status=deferred (connect to[]:10024: Connection refused)

Here is my postconf -n, if needed:

alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
append_dot_mydomain = no
biff = no
body_checks = regexp:/etc/postfix/body_checks
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavis:[]:10024
dovecot_destination_recipient_limit = 1
header_checks = regexp:/etc/postfix/header_checks
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
maildrop_destination_concurrency_limit = 1
maildrop_destination_recipient_limit = 1
mime_header_checks = regexp:/etc/postfix/mime_header_checks
mydestination =, localhost, localhost.localdomain
myhostname =
mynetworks = [::1]/128
myorigin = /etc/mailname
nested_header_checks = regexp:/etc/postfix/nested_header_checks
owner_request_special = no
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
readme_directory = /usr/share/doc/postfix
receive_override_options = no_address_mappings
recipient_delimiter = +
relay_domains = mysql:/etc/postfix/
relay_recipient_maps = mysql:/etc/postfix/
relayhost =
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_message_rate_limit = 100
smtpd_client_restrictions = check_client_access mysql:/etc/postfix/
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/
virtual_alias_domains =
virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:/etc/postfix/, proxy:mysql:/etc/postfix/
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/
virtual_mailbox_maps = proxy:mysql:/etc/postfix/
virtual_transport = dovecot
virtual_uid_maps = static:5000

Thank you very much in advanced :)

Best Regards,

1 Answer

Looks like amavis isn't running on your system.

Try restarting it.

sudo service amavis restart

  • Hello, thank you very much in advance :)

    I think you're right. Amavis isn't running.
    But when I tried to run Amavia via command line. I got an error:

    Starting amavisd: (failed).

    Then this line appears in my /var/log/mail.log

    Sep 23 07:31:58 rocketwearthailand amavis[15839]: (!)Net::Server: 2014/09/23-07:31:58 Couldn't fork: [Cannot allocate memory] at /usr/share/perl5/Net/Server/ line 182.\n\n  at line 159 in file /usr/share/perl5/Net/

    Please suggest what to do.
    I have no idea what happened.

    Thank you!!

  • Has this every worked?

    How big is your droplet? Did you create swap file?

  • This is my first droplet and currently using the smallest (cheapest) one.

    I am totally newbie. I don't even know what swapping files is....

    Do I need to upgrade my droplet to get this working?

    Thank you.

  • Depends on load if you need bigger droplet.

    I have been running a 512m droplet for personal mail server on DO for almost a year. Its low volume and only websites are Horde and roundcube webmail.

    Run "free" or "top" to see if you are using all your memory.

    To setup swap file see:

    For my system I setup a 1024 meg swap file. It holds at about 50% used so I probably should move to a larger droplet.

    But for now I would try getting the swap file working to make sure its a memory problem. Then you can decide if a larger droplet would be in order.

    by Etel Sverdlov
    Linux swaps allow a system to harness more memory than was originally physically available. Here's how to set up a linux swap file on Ubuntu 12.04
  • Really appreciate your help!

    I will follow swapping files tutorial soon and see if it will work.

    Thank you :)

  • uh, I'm here to tell you that your solution solved my problem, thank you!

  • had the same problem it is the spam filter need a lot of memory. you will need a 1G droplet or grater to get it to work. or you can turn off the spam filter as show in the FAQ of ISPconfig

    How to disable spamfilter- and antivirus functions in ISPConfig 3

    If you use a mailserver wil very low ram (< 500 MB) and a slow CPU then it might be nescessary to disable the spam- and antivirus filter functions in ISPConfig 3 as amavisd and clamav might be too heavy for your server hardware. The steps to disable clamav and amavisd are:

    Edit postfix file

    vi /etc/postfix/

    and comment out these lines by adding a "#" in front of them:

    # contentfilter = amavis:[]:10024
    # receive
    overrideoptions = noaddress_mappings

    Then restart postfix:

    /etc/init.d/postfix restart

    Now stop and disable the services. The following commands are for Debian and Ubuntu, the commands for other Linux distributions may vary

    /etc/init.d/clamav-daemon stop
    /etc/init.d/clamav-freshclam stop
    /etc/init.d/amavis stop

    update-rc.d -f clamav-daemon remove
    update-rc.d -f clamav-freshclam remove
    update-rc.d -f amavis remove

    P The normal mail receive and send functions will still work after this modification. But please be aware that disabling amavisd and clamav will disable all spam- and antivirus filtering so that the spamfiltering options that can be configured in the ispconfig interface will have any effect on mail delivery and no spam and viruses will get filtered.

    The changes in postfix will get overwitten by a ispconfig software update when you select to reconfigure services during upadte, so you should comment out the lines again after you install a ispconfig update.

Have another answer? Share your knowledge.