Недавно я установил postfix, openssl, настроил SMTP и все записи на cloudflare, но по какой-то причине я не могу узнать Это не работает
Когда я пытаюсь подключиться с помощью telnet
[root@reputation ~]# telnet reputation.help
Trying 104.219.235.10...
telnet: connect to address 104.219.235.10: Connection refused
Вот мой main.cf
[root@reputation ~]# cat /etc/postfix/main.cf
myhostname = reputation.help
mydomain = reputation.help
myorigin = $mydomain
home_mailbox = mail/
mynetworks = 127.0.0.0/8
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_key_file = /etc/postfix/ssl/server.key
smtpd_tls_cert_file = /etc/postfix/ssl/server.crt
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtpd_milters = inet:127.0.0.1:8891, inet:127.0.0.1:8893
non_smtpd_milters = $smtpd_milters
milter_default_action = accept
milter_protocol = 2
smtp_generic_maps = hash:/etc/postfix/generic
smtp_generic_maps = hash:/etc/postfix/generic
Также master.cf
[root@reputation ~]# cat /etc/postfix/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").
#
# 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 - n - - smtpd
submission inet n - n - - smtpd
-o syslog_name=postfix/submission
-o smtpd_sasl_auth_enable=yes
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
smtps inet n - n - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_sasl_auth_enable=yes
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
#smtp inet n - n - 1 postscreen
#smtpd pass - - n - - smtpd
#dnsblog unix - - n - 0 dnsblog
#tlsproxy unix - - n - 0 tlsproxy
#submission inet n - 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
#smtps inet n - 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=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - n - - qmqpd
pickup unix n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr unix n - n 300 1 qmgr
#qmgr unix n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent. See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
#maildrop unix - n n - - pipe
# flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
# mailbox_transport = lmtp:inet:localhost
# virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus unix - n n - - pipe
# user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
#
# Old example of delivery via Cyrus.
#
#old-cyrus unix - n n - - pipe
# flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
#uucp unix - n n - - pipe
# flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# ====================================================================
#
# Other external delivery methods.
#
#ifmail unix - n n - - pipe
# flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
#
#bsmtp unix - n n - - pipe
# flags=Fq. user=bsmtp argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
#
#scalemail-backend unix - n n - 2 pipe
# flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
# ${nexthop} ${user} ${extension}
#
#mailman unix - n n - - pipe
# flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
# ${nexthop} ${user}
Вот вывод netstat -pln
[root@reputation ~]# netstat -pln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 4695/master
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 4695/master
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 2171/named
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 999/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 4695/master
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 2171/named
tcp 0 0 127.0.0.1:8891 0.0.0.0:* LISTEN 1648/opendkim
tcp 0 0 127.0.0.1:8893 0.0.0.0:* LISTEN 1996/opendmarc
tcp6 0 0 :::587 :::* LISTEN 4695/master
tcp6 0 0 :::80 :::* LISTEN 2719/httpd
tcp6 0 0 :::465 :::* LISTEN 4695/master
tcp6 0 0 ::1:53 :::* LISTEN 2171/named
tcp6 0 0 :::22 :::* LISTEN 999/sshd
tcp6 0 0 :::25 :::* LISTEN 4695/master
tcp6 0 0 ::1:953 :::* LISTEN 2171/named
udp 0 0 127.0.0.1:53 0.0.0.0:* 2171/named
udp6 0 0 ::1:53 :::* 2171/named
raw6 0 0 :::58 :::* 7 787/NetworkManager
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 67671 4695/master public/cleanup
unix 2 [ ACC ] STREAM LISTENING 67674 4695/master public/qmgr
unix 2 [ ACC ] STREAM LISTENING 67678 4695/master private/tlsmgr
unix 2 [ ACC ] STREAM LISTENING 67681 4695/master private/rewrite
unix 2 [ ACC ] STREAM LISTENING 67684 4695/master private/bounce
unix 2 [ ACC ] STREAM LISTENING 67687 4695/master private/defer
unix 2 [ ACC ] STREAM LISTENING 67690 4695/master private/trace
unix 2 [ ACC ] STREAM LISTENING 67693 4695/master private/verify
unix 2 [ ACC ] STREAM LISTENING 67696 4695/master public/flush
unix 2 [ ACC ] STREAM LISTENING 67699 4695/master private/proxymap
unix 2 [ ACC ] STREAM LISTENING 67702 4695/master private/proxywrite
unix 2 [ ACC ] STREAM LISTENING 67705 4695/master private/smtp
unix 2 [ ACC ] STREAM LISTENING 67708 4695/master private/relay
unix 2 [ ACC ] STREAM LISTENING 67711 4695/master public/showq
unix 2 [ ACC ] STREAM LISTENING 67714 4695/master private/error
unix 2 [ ACC ] STREAM LISTENING 67717 4695/master private/retry
unix 2 [ ACC ] STREAM LISTENING 67720 4695/master private/discard
unix 2 [ ACC ] STREAM LISTENING 67723 4695/master private/local
unix 2 [ ACC ] STREAM LISTENING 67726 4695/master private/virtual
unix 2 [ ACC ] STREAM LISTENING 67729 4695/master private/lmtp
unix 2 [ ACC ] STREAM LISTENING 67732 4695/master private/anvil
unix 2 [ ACC ] STREAM LISTENING 67735 4695/master private/scache
unix 2 [ ACC ] STREAM LISTENING 2952 1/systemd /run/systemd/private
unix 2 [ ACC ] STREAM LISTENING 2987 1/systemd /run/lvm/lvmetad.socket
unix 2 [ ACC ] STREAM LISTENING 2479 1/systemd /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 14531 1/systemd /var/run/dbus/system_bus_socket
unix 2 [ ACC ] SEQPACKET LISTENING 3047 1/systemd /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 3049 1/systemd /run/lvm/lvmpolld.socket
unix 2 [ ACC ] STREAM LISTENING 67667 4695/master public/pickup
Я не могу понять, в чем проблема с mailx. Он работает без проблем?
При использовании telnet необходимо указать номер порта. В противном случае он будет подключаться к порту по умолчанию для протокола telnet, 23. Чтобы проверить, что почтовый сервер отвечает на запросы SMTP, вы должны указать порт 25:
telnet reputation.help 25
Убедитесь, что имя хоста соответствует IP-адресу сети. интерфейс, который прослушивает Postfix (все должно соответствовать main.cf
), убедитесь, что сетевой интерфейс включен и что порт 25 на почтовом сервере не фильтруется брандмауэром. После успешного подключения к порту 25 проверьте почтовый журнал сервера на наличие соответствующих записей.
Можете ли вы подключиться по Telnet к известным рабочим серверам? Например, host gmail.com
предоставляет несколько mx-серверов, затем telnet на gmail-smtp-in.l.google.com 25
, если это не удается, скорее всего, это брандмауэр выше вашего исп. Тестируйте с сервера, который МОЖЕТ открывать tcp / 25, например VPS, который не ограничивает исходящие порты или сеть бизнес-класса. Вы также можете использовать сторонние инструменты, такие как https://www.wormly.com/test-smtp-server , если предоставленная вами информация актуальна. похоже, проблема с брандмауэром / сокетом на вашем сервере или вышестоящим брандмауэром вышла из-под вашего контроля, МНОГИЕ VPS-СЕРВЕРЫ ТРЕБУЮТ СПЕЦИАЛЬНОЕ РАЗРЕШЕНИЕ НА ОТКРЫТЬ ПОРТ 25 ДЛЯ ЗЛОУПОТРЕБЛЕНИЯ.
Устранение имени хоста ...
Подключение ...
Подключение: открытие к репутации.help:25, тайм-аут = 300, параметры = массив (
)
Ошибка отправки сообщения.
mailx локально не будет иметь проблем с вышестоящими межсетевыми экранами.