Я установил SMTP-сервер во внутренней сети, но я хочу полностью удалить порт 25, поскольку мой поставщик услуг ограничивает доступ к порту 25.
Однако, даже используя порт 587 на моем сервере для аутентификации, сервер всегда переходит на ретранслятор на порт 25, например, если я отправляю электронное письмо на учетную запись gmail, это то, что я получаю.
Oct 14 07:18:03 smtp postfix/smtp[12902]: connect to alt4.gmail-smtp-in.l.google.com[74.125.136.27]:25: Connection timed out
Oct 14 07:18:03 smtp postfix/smtp[12905]: connect to alt4.gmail-smtp-in.l.google.com[74.125.136.27]:25: Connection timed out
Oct 14 07:18:03 smtp postfix/smtp[12903]: 6DA571015A3: to=<ericopfusco@gmail.com>, relay=none, delay=2825, delays=2188/488/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.136.27]:25: Connection timed out)
Oct 14 07:18:03 smtp postfix/smtp[12904]: 501161015A9: to=<ericopfusco@gmail.com>, relay=none, delay=1601, delays=964/488/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.136.27]:25: Connection timed out)
Oct 14 07:18:03 smtp postfix/smtp[12905]: AE1711015A7: to=<ericopfusco@gmail.com>, relay=none, delay=2516, delays=1878/488/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.136.27]:25: Connection timed out)
Oct 14 07:18:03 smtp postfix/smtp[12902]: EADD310159F: to=<ericopfusco@gmail.com>, relay=none, delay=4595, delays=3957/488/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.136.27]:25: Connection timed out)
Я уверен, что мне здесь не хватает некоторых базовых концепций SMTP, но я не знаю, что это такое. Но мне в основном нужно перестать использовать порт 25 для исходящей электронной почты из моей внутренней сети на реле.
# TLS parameters
smtpd_use_tls = yes
smtpd_tls_CAfile = /etc/ssl/certs/ca.crt
smtpd_tls_cert_file = /etc/postfix/ssl/smtp.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtp.key
smtpd_tls_auth_only = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_sasl_auth_enable = yes
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
mydomain = iriscrm.com
myhostname = smtp.example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = smtp.example.com, smtp, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.0.0.0/16 10.10.0.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
home_mailbox = Maildir/
mailbox_command =
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
tls_random_source = dev:/dev/urandom
# DKIM
milter_default_action = accept
milter_protocol = 2
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891
Чтобы сделать то, что вы сказали, вам нужно было установить транспорт по умолчанию на порт 587. Это можно сделать с помощью default_transport = smtp:587
Но это не сработает, потому что у большинства SMTP-серверов в мире просто нет открытого порта 587.
Что вы могли сделать: вам нужно было получить ретранслятор SMTP, который принимал вашу почту (на порту, отличном от 25) и позволял им выходить за пределы мира. К счастью, Gmail также может это сделать, но он будет работать только в том случае, если у вас не слишком большой трафик (в противном случае он рассмотрит ты спамер), и его настройка может быть немного сложной.
Лучше всего было, если у вас был какой-то сервер от поставщика услуг хостинга, который не ограничивает такие порты, и использовал его в качестве почтового ретранслятора.