Cannot send emails with STMP Postfix on port 587

dovecotemailpostfix

I have followed this guide line by line: https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql

Finally got emails to be received but I cannot send them and all I get is connecting to mail.. I am using the Claws mail client and it lets me login and receive emails but just not send them. I set it to use port 587 but it just hangs on connecting when sending

Here is my master.cf:

##
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
submission inet n       -       -       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_reject_unlisted_recipient=no
  -o smtpd_client_restrictions=$mua_client_restrictions
  -o smtpd_helo_restrictions=$mua_helo_restrictions
  -o smtpd_sender_restrictions=$mua_sender_restrictions
  -o smtpd_recipient_restrictions=
  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
smtps     inet  n       -       -       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_reject_unlisted_recipient=no
  -o smtpd_client_restrictions=$mua_client_restrictions
  -o smtpd_helo_restrictions=$mua_helo_restrictions
  -o smtpd_sender_restrictions=$mua_sender_restrictions
  -o smtpd_recipient_restrictions=
  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       -       -       -       qmqpd
pickup    unix  n       -       -       60      1       pickup

and I cannot see anything in the logs /var/log/mail.log which says what is going on. Port 587, 465 and 25 are open in the firewall as well.

Where do I go from here to debug this?

UPDATE:
I am able to connect via telnet on the server using port 587, postfix is running but I just cannot connect using the Claws Mail client when sending, it receives mail fine, even if I send an email from a Gmail account.

Best Answer

Your router or your isp is blocking outgoing connections to port 587. As you did "iptables -P OUTPUT ACCEPT", its not the local firewall for sure. I don't think disabling selinux might help as even telent returns a connection timeout.