CentOS postfix smtp server connection refused from outside

10,993

You should be sending outgoing mail from your desktop on port 587, the submission port, not port 25 (which is meant for transferring mail between SMTP servers). Make sure your /etc/postfix/master.cf has the submission section enabled.

Share:
10,993

Related videos on Youtube

user968898
Author by

user968898

Updated on September 18, 2022

Comments

  • user968898
    user968898 almost 2 years

    I am quite stuck with my postfix/smtp configuration on my CentOS machine.

    I setup a mail dns mail.domain.tld, configured in the postfix main.conf file and tested locally on the server by connecting to

    $telent mail.domain.tld 25

    This gives me a response and it's possible to send e-mails from the mail server it self. Now, I want to use the mail server in my e-mail client but I cant get a connection with the server, if i test a telnet connection from my local desktop it's been refused by the server.

    I know this should be something like a firewall, there is iptables running but I added ports to be accepted, I added + saved + restarted iptables but no port 25 or 587 (also configured from the postfix master.conf) wont work from outside the server.

    (telnet 587 also not working from the server locally).

    # lsof -ni tcp:25
    COMMAND   PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
    master  27179 root   12u  IPv4 52473467      0t0  TCP *:smtp (LISTEN)
    master  27179 root   13u  IPv6 52473469      0t0  TCP *:smtp (LISTEN)
    
    # netstat -an | grep LIST
    ...    
    tcp        0      0 0.0.0.0:465                 0.0.0.0:*                   LISTEN      
    tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      
    ...   
    
    
    # iptables -L
    Chain INPUT (policy DROP)
    target     prot opt source               destination         
    ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:smtp  
    

    I can deliver more outputs if needed!

    Thanks in advance

    • Jenny D
      Jenny D over 10 years
      Does your local ISP filter outgoing port 25?
    • Gabriel Talavera
      Gabriel Talavera over 10 years
      Check that the line starting with submission is uncommented in /etc/postfix/master.cf
    • user968898
      user968898 over 10 years
      I fixed by taking over it to port 578! like Gabriel talavera says