Connection refused from remote computers on port 25 with postfix

6,904

Multiple possibilities

  1. Antivirus software is blocking traffic going to port 25
  2. Gateway/firewall is blocking
  3. ISP is blocking

All the above are common causes.

If you are trying to use that server as your out going smtp, use port 587 or 465.

You may have to modify postfix configuration file your email server to enable the above ports.

In /etc/postfix/master.cf, look for following lines

#submission inet n       -       -       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING

#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING

Un-comment them (remove the # in the beginning of each line) and restart postfix.

The submission section enable port 587.

the smtps section enable port 465.

Share:
6,904

Related videos on Youtube

Nick Duffell
Author by

Nick Duffell

Updated on September 18, 2022

Comments

  • Nick Duffell
    Nick Duffell almost 2 years

    I have a postfix / dovecot mail server setup using TLS.

    The IMAP / POP side of the server works perfectly, but I cannot connect to it for SMTP.

    Even telnetting it from a remote computer I get Connection refused.

    Calling telnet localhost 25 from the server itself works fine though, and if I look at the open ports one of them is 0.0.0.0:25, which looks like it is listening on port 25 for incoming connections.

    Any ideas?

  • Nick Duffell
    Nick Duffell over 11 years
    You sir, are a legend.