5

My ISP blocks port 25. So, I cannot connect to my server and send emails. I've tried changing it to 465. And it works! However, after this change, I cannot receive emails anymore.

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# 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)
# ==========================================================================
465 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=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
  -o smtpd_sasl_type=dovecot
  -o smtpd_sasl_path=private/auth
#smtps     inet  n       -       -       -       -       smtpd
#  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=no
#  -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=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING

The above is my master file after the 465 change. (notice the first line).

I cannot receive emails anymore after this change. Please help! Thanks!

1
  • 4
    Call the ISP and tell them to unblock it. Blocking incoming port 25 is absurd for a business class connection. Apr 21, 2014 at 23:08

4 Answers 4

6

You won't receive any mails, because the SMTP servers send mails between each other on port 25. ISP's block the outgoing port 25 to stop spam and this is now almost "an industry standard". Port 465 and 587 should be used for client - server connections only, so 99% of SMTP servers which will send mails to your server will do it on port 25. As you have changed the port from 25 to 465, they won't be able to connect to your server.

Most probably you would need some kind of relay host which will forward mails to your server on different port.

0
3

Don't remove the SMTP default configuration, just add the port you want Postfix to listen to perform the appropriate SMTPd action:

smtp inet  n       -       -       -       -       smtpd
465  inet  n       -       -       -       -       smtpd
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
submission inet n       -       -       -       -       smtpd

This way, you'll be able to send mails through port 465, and receive mails from the SMTP port (25).

1

Actually you have enabled the submission port by uncommenting it It is port 587. You have not enabled port 465 as it is not uncommented ( below the submission settings) 465 as a service postfix doesn't know. You need to change that back to smtp as it was. That defaults to port 25. Sound like you won't use it but port 25 is used for other communications. So in short 1) Change 465 back to smtp 2) uncomment the config settings on the smtps to enable port 465

0

Leave Postfix running on port 25 and create a port redirect on another port, say 2525, for you to connect to it:

iptables -t nat -I PREROUTING -p tcp --dport 2525 -j REDIRECT --to-port 25

(remember to save the rule)

1
  • 3
    Sorry, this doesn't make any sense. Your solution is redirecting incoming mail from port 2525 to port 25, when no one is going to be sending mail to port 2525 in the first place.
    – pgoetz
    May 14, 2015 at 9:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .