Sending and receiving email is refused

Posted September 9, 2014 29.7k views

Hello I have a Ubuntu 14.04 TLS server with iRedMail installed. When just installed it worked okay but after the first 4 emails I get a error message

Sep  9 12:24:18 hostname postfix/smtp[9907]: connect to[]:10024: Connection refused
Sep  9 12:24:18 hostname postfix/smtp[9907]: D97C720A31: to=<>, relay=none, delay=1.1, delays=1.1/0.02/0/0, dsn=4.4.1, status=deferred (connect to[]:10024: Connection refused)
Sep  9 12:24:19 hostname postfix/smtpd[9892]: disconnect from localhost[]

I don’t know where the problem is. Can someone help me out here?

  • I had many problems with mail traffic on D.O.
    You will have to open a ticket to the support team open the traffic for you.
    I don’t know why they block mail traffic. =D


  • Hea? What do u mean is this because they block my mail traffic?

  • @reshadar if you want to check this, you can try to telnet your IP on port 25 from your laptop :

    telnet IP_OF_YOUR_MAIL_SERVER 25

    If this works, your incoming traffic is not blocked.

    To check the same for outgoing traffic, you can try to telnet google mail servers on port 25 from your VPS, and you should have the following result :

    telnet 25
    Connected to
    Escape character is '^]'.
    220 ESMTP va3si18034745wjc.67 - gsmtp

    Considering guys on DO are providing containers (or VPS ?), they may block mail traffic running standalone. I would clearly understand if they have an internal relay smtp to provide mail service, but it doesn’t seems to be the case.


  • They need some additional information about you to open the mail traffic. Because of junkmail / spam senders. Just to confirm you’re not using it to send spam messages around the world. Open a ticket to the support

  • Show 2 more comments

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Hi Reshadfar,

It looks like the service on port 10024 is not running :

Sep 9 12:24:18 hostname postfix/smtp[9907]: connect to[]:10024: Connection refused

On mail servers, this port is usually used for amavis : did you try to run amavis first ?

service amavis start

You should see a service running on port 10024 if that command succeeds with netstat -tunlp

Hope this could help,

Best regards,


  • Thanks for your answer. It seemed to work but after a while it stops itself again. The errors that I get are

    Sep 9 12:54:13 hostname postfix/anvil[10237]: statistics: max connection rate 1/60s for (submission: at Sep 9 12:50:51
    Sep 9 12:54:13 hostname postfix/anvil[10237]: statistics: max connection count 1 for (submission: at Sep 9 12:50:51
    Sep 9 12:54:13 hostname postfix/anvil[10237]: statistics: max cache size 1 at Sep 9 12:50:51

    And the stuff above of course.

  • It looks like you are having many connexions from smtp clients.
    But those messages are not error messages, just statistics.

    Could you gimme the output of :

    ps fax
    netstat -tunlp
    postqueue -p

    Those results may help me to find out what happens,


  • OK thank you.

    From what I see here, I would say that all services are running fine (the netstat -tunlp confirms this to me), and I also see that some mails remained in the postque.

    You can flush the queue to try re-sending the emails, and see if some errors appears in mail.log file :

    postqueue -f

    Flushing the mailq will force postfix to deliver mail again. As amavis is running now, the error you had in queue should not appear again :

    (connect to[]:10024: Connection refused)

    If the error message changes on call at postqueue -p, then you made a step forward ;)

    Feel free to let me know if everything is fine after flushing the queue :)


  • Thanks I think its fixed now.. I also get a warning
    warning: unknown[]: SASL LOGIN authentication failed: UGFzc3dvcmQ6

    Is it something I need to solve for the emails to work or does it not have to anything with that?

  • Ok now it stopped working again. I think its not blocked though because when I use the telnet command you gave it says

    Connected to
    Escape character is ’^]’.
    220 ESMTP Postfix (Ubuntu)

  • Glad to see you could move forward with the support and your mail server installation.

    First, this trouble has nothing to see with the port blocking from DO, as the service is runing inside your droplet
    Seeing the warning you show me, I understand you want to use Sasl authentication for login. But, from the paste you showed me before, I did not see saslauthd running.

    You may try :

    service saslauthd start

    But saslauthd need to be configured properly, and relied to your postfix installation.

    Did you configure saslauthd using a Mysql database to retrieve password ?

    If it is the case, you will need to enable saslauthd by default when ubuntu is starting :

    OPTIONS="-r -c -m /var/spool/postfix/var/run/saslauthd"

    Then, you will need to create a /etc/postfix/sasl/smtpd.conf file containing credentials to make a query in your database, and retrieve user authentication.

    Feel free to tell me if you need more help on that setup.


  • Fine.
    I can confirm your SMTP is working fine, as I could run a telnet on your mail server, and send and email to root ;)

    Here is what I did :

    Connected to
    Escape character is '^]'.
    220 ESMTP Postfix (Ubuntu)
    250-SIZE 15728640
    250 DSN
    mail from:<>
    250 2.1.0 Ok
    rcpt to: <>
    250 2.1.5 Ok
    354 End data with <CR><LF>.<CR><LF>
    subject: test
    mail testing from rustx
    250 2.0.0 Ok: queued as DD08420A2F

    This means the SMTP accepted the message for delivery, and it will transfers it to dovecot for delivery. If it worked well, you can log in as root and type mail in your shell : you will see my private message. :)

    You should check in your logs that I did send you an email successfully.

    There are many things to know about mail servers, as the DNS configuration needs to be extremely well done for it works well. If you need more information, I can help you with that setup.

    See ya !

  • It says mail is not installed?

    The program ‘mail’ is currently not installed. You can install it by typing:
    apt-get install mailutils

  • @reshadfar : run apt-get install mailutils and then type mail and that will read that mail … :)

  • Ok the root account doesn’t have mail.. As I never created it. What else could the problem be for the connection breaking all the time?

  • IMHO, the problem is not on DO side. Setting a good and secured mail server up and running needs lot of knowledge about mail service, as it is a real complex setup. I advise you to have a look at the famous flurdy tutorials for mail servers setup : Flurdy

    Once you will have configured all services needed, you should be fine with your mail server.

    Have a good continuation on your setup !

  • Ah I Found the problem. The problem it was shutting down itself was because there was not enough space left on the ram ( Don’t ask my how that was possible ) hmm got rid of some stuff and gonna check if it works now :) Thanks for the help so far

  • You’re welcome ! amavis and spamassassin uses a LOT of Ram … You will maybe need to upsize your container to have all those services working fine with the resources of your cloud. Enjoy and see ya !

  • @reshadfar : my mail to root had been bounced back, i’ve just received the bounce with the following error :

    Status: 5.1.1
    Diagnostic-Code: x-unix; user unknown

    All is good then, it’s time to create your first mail user ;)


Hi Reshadfar,

Have you enabled mail traffic in your cloud?
By default D.O. blocks Mail related ports to avoid SPAM related servers to run.

Fill this questions above and send via ticket to D.O. support in your account:

- Your Name 
- Location 
- Phone Number 
- The reason you are requesting the removal of the SMTP block

Also, please provide as many of the following as you can to help us verify your identity:

- Your public Twitter handle 
- Your blog 
- Your company or personal website 
- Your public Facebook profile

Its a very simple process. After confirmed, your mail services will run just ok.


  • Thanks for this. I have sent a ticket :)

  • Hmm the port doesn’t seem blocked

    Connected to
    Escape character is ’^]’.
    220 ESMTP Postfix (Ubuntu)

    Could the problem be somewhere else?

  • @reshadfar : this texts only show an incoming test. Teams from DO may block outgoing traffic, and not incoming traffic onlly. So this is a half test in your case … Try to run the second one to see if you can connect to google smtp …

  • What command is that exactly?

    EDIT: I just received a email from them


    Thank you for contacting DigitalOcean Support.

    We can confirm that we are not blocking smtp for your account.

    We appreciate you being a Digital Ocean customer and please let us know if we can be of further assistance!


    So its not blocking the smtp ports. the problem should be elsewhere I guess