내 서버는 메일을 받을 수 없지만 보낼 수는 있습니다.
로그에서 볼 수 있듯이 시간 초과에 대해 불평합니다. PC에서 텔넷을 이용하여 외부 연결을 확인해 보니 25번 포트에 정상적으로 접속이 됩니다.
mysql을 사용하면 특정 작업을 수행할 수 없다는 이야기도 있어서 시간 초과 제한을 조금 연장하고 myphpadmin을 사용하여 연결할 수 있는지 확인했습니다. 그런 면에서는 모든 것이 잘 되어가는 것 같은데, 거기서 왜 불평을 하는지 모르겠습니다.
@roaima의 도움으로 이제 메시지를 반환하지만 "내 자신에게 루프백"한다고 주장합니다. postfix의 my.cnf를 보면 mydestination에 대해 여러 가지 방향을 시도했다는 것을 알 수 있습니다. 루프백이라고 말하는 사람도 있고 릴레이 호스트가 아니라고 말하는 사람도 있습니다. 발생한 오류를 조사한 후 FQDN을 제거하거나 추가하면 문제가 해결될 것이라고 주장했지만 두 경우 모두 실패했습니다.
리눅스는 잘 쓸 수 있는데 postfix 때문에 죽겠어요.
로그:/var/log/mail.log
Apr 22 15:26:37 webserver postfix/smtpd[36202]: connect from mail-wi0-f172.google.com[209.85.212.172]
Apr 22 15:26:38 webserver postfix/trivial-rewrite[36209]: warning: do not list domain zomgaming.net in BOTH mydestination and virtual_mailbox_domains
Apr 22 15:26:38 webserver postfix/smtpd[36202]: 20547C0E08: client=mail-wi0-f172.google.com[209.85.212.172]
Apr 22 15:26:38 webserver postfix/cleanup[36212]: 20547C0E08: message-id=<CAF++Fz1DrsMktsZ4k=FMRtjwfHP3mfPbVL2QoXxemqX_M69wkQ@mail.gmail.com>
Apr 22 15:26:38 webserver postfix/qmgr[36200]: 20547C0E08: from=<[email protected]>, size=1677, nrcpt=1 (queue active)
Apr 22 15:26:38 webserver amavis[50731]: (50731-11) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 136) line 170, <GEN31> line 770.
Apr 22 15:26:38 webserver postfix/smtpd[36202]: disconnect from mail-wi0-f172.google.com[209.85.212.172]
Apr 22 15:26:41 webserver postfix/smtpd[36216]: connect from localhost[127.0.0.1]
Apr 22 15:26:41 webserver postfix/smtpd[36216]: 7FBF9C0E3B: client=localhost[127.0.0.1]
Apr 22 15:26:41 webserver postfix/cleanup[36212]: 7FBF9C0E3B: message-id=<CAF++Fz1DrsMktsZ4k=FMRtjwfHP3mfPbVL2QoXxemqX_M69wkQ@mail.gmail.com>
Apr 22 15:26:41 webserver postfix/qmgr[36200]: 7FBF9C0E3B: from=<[email protected]>, size=2151, nrcpt=1 (queue active)
Apr 22 15:26:41 webserver postfix/smtpd[36216]: disconnect from localhost[127.0.0.1]
Apr 22 15:26:41 webserver amavis[50731]: (50731-11) Passed CLEAN {RelayedOpenRelay}, [209.85.212.172]:36328 [209.85.212.172] <[email protected]> -> <[email protected]>, Queue-ID: 20547C0E08, Message-ID: <CAF++Fz1DrsMktsZ4k=FMRtjwfH$
Apr 22 15:26:41 webserver postfix/smtp[36213]: 20547C0E08: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=3.5, delays=0.25/0.01/0.01/3.2, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 $
Apr 22 15:26:41 webserver postfix/qmgr[36200]: 20547C0E08: removed
Apr 22 15:26:41 webserver postfix/smtp[36217]: 7FBF9C0E3B: to=<[email protected]>, relay=none, delay=0.28, delays=0.02/0.04/0.23/0, dsn=5.4.6, status=bounced (mail for mail.zomgaming.net loops back to myself)
Apr 22 15:26:41 webserver postfix/cleanup[36212]: C7091C16D3: message-id=<[email protected]>
Apr 22 15:26:41 webserver postfix/qmgr[36200]: C7091C16D3: from=<>, size=4101, nrcpt=1 (queue active)
Apr 22 15:26:41 webserver postfix/bounce[36218]: 7FBF9C0E3B: sender non-delivery notification: C7091C16D3
Apr 22 15:26:41 webserver postfix/qmgr[36200]: 7FBF9C0E3B: removed
Apr 22 15:26:42 webserver postfix/smtp[36217]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400d:c06::1b]:25: Network is unreachable
Apr 22 15:26:43 webserver postfix/smtp[36217]: C7091C16D3: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[74.125.22.27]:25, delay=1.5, delays=0.01/0.01/0.62/0.85, dsn=2.0.0, status=sent (250 2.0.0 OK 1429716403 gn1si5368338$
Apr 22 15:26:43 webserver postfix/qmgr[36200]: C7091C16D3: removed
Apr 22 15:29:58 webserver postfix/anvil[36205]: statistics: max connection rate 1/60s for (smtp:209.85.212.172) at Apr 22 15:26:37
Apr 22 15:29:58 webserver postfix/anvil[36205]: statistics: max connection count 1 for (smtp:209.85.212.172) at Apr 22 15:26:37
Apr 22 15:29:58 webserver postfix/anvil[36205]: statistics: max message rate 1/60s for (smtp:209.85.212.172) at Apr 22 15:26:38
Apr 22 15:29:58 webserver postfix/anvil[36205]: statistics: max cache size 1 at Apr 22 15:26:37
Apr 22 15:30:02 webserver postfix/smtpd[36282]: connect from localhost[127.0.0.1]
Apr 22 15:30:02 webserver dovecot: imap-login: Disconnected (disconnected before auth was ready, waited 0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, secured, session=<zbw01lEUXgB/AAAB>
Apr 22 15:30:02 webserver dovecot: pop3-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, secured, session=<kQk11lEUFAB/AAAB>
Apr 22 15:30:02 webserver postfix/smtpd[36282]: lost connection after CONNECT from localhost[127.0.0.1]
Apr 22 15:30:02 webserver postfix/smtpd[36282]: disconnect from localhost[127.0.0.1]
출력: dig mx zomgaming.net
; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> mx zomgaming.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44151
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;zomgaming.net. IN MX
;; ANSWER SECTION:
zomgaming.net. 3599 IN MX 1 zomgaming.net.
;; Query time: 66 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Apr 13 10:34:04 UTC 2015
;; MSG SIZE rcvd: 58
내 godaddy의 MX 기록은 다음과 같습니다.
MX 1 zomgamgin.net.
MX 5 mail.zomgaming.net.
출력: /etc/hosts
127.0.0.1 localhost
#192.168.1.204 webserver.zomgaming.com webserver
192.168.1.204 zomgaming.net
#192.168.1.204 mail.zomgaming.net
73.172.71.230 webserver.zomgaming.com webserver
#73.172.71.230 zomgaming.net
127.0.0.1 mail.zomgaming.net
/etc/postfix/main.cf의 출력:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = /usr/share/doc/postfix
# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# 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
myhostname = webserver.zomgaming.com
mydomain = zomgaming.net
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
myorigin = /etc/mailname
#mydestination = webserver.zomgaming.com, localhost, localhost.localdomain
#mydestination = $myhostname localhost.$mydomain localhost $mydomain mail.$mydomain
#mydestination = webserver.zomgaming.com localhost.webserver.zomgaming.com localhost zomgaming.net mail.zomgaming.net
#mydestination = $mydomain, localhost.localdomain, localhost
#mydestination = $myhostname, localhost, localhost.localdomain
mydestination = webserver.zomgaming.com zomgaming.net
#relayhost =
mynetworks = 127.0.0.0/8 [::1]/128 192.168.1.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
html_directory = /usr/share/doc/postfix/html
#virtual_alias_domains =
virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /var/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf
smtpd_tls_security_level = may
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
relay_domains =
relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_can$
smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
smtpd_client_message_rate_limit = 100
maildrop_destination_concurrency_limit = 1
maildrop_destination_recipient_limit = 1
virtual_transport = dovecot
header_checks = regexp:/etc/postfix/header_checks
mime_header_checks = regexp:/etc/postfix/mime_header_checks
nested_header_checks = regexp:/etc/postfix/nested_header_checks
body_checks = regexp:/etc/postfix/body_checks
owner_request_special = no
smtp_tls_security_level = may
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_protocols = !SSLv2,!SSLv3
smtp_tls_protocols = !SSLv2,!SSLv3
dovecot_destination_recipient_limit = 1
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
message_size_limit = 0
smtp_host_lookup = native
/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" 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_client_restrictions=permit_sasl_authenticated,reject
-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_client_restrictions=permit_sasl_authenticated,reject
# -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
cleanup unix n - - - 0 cleanup
qmgr unix n - n 300 1 qmgr
#qmgr unix n - n 300 1 oqmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 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/bin/maildrop -d vmail ${extension} ${recipient} ${user} ${nexthop} ${sender}
#
# ====================================================================
#
# 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=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix - n n - - pipe
# flags=R user=cyrus argv=/cyrus/bin/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/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
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}
dovecot unix - n n - - pipe
flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
amavis unix - - - - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
127.0.0.1:10025 inet n - - - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
"호스트 이름"에 대한 출력:
webserver.zomgaming.com
"hostname -f"의 출력:
webserver.zomgaming.com
외부 소스로부터의 연결:
220 webserver.zomgaming.com ESMTP Postfix (Ubuntu)
>ehlo zomgaming.net
250-webserver.zomgaming.com
250-PIPELINING
250-SIZE
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
>mail from:<[email protected]>
501 5.5.4 Syntax: MAIL FROM:<address>
>mail from:<[email protected]>
250 2.1.0 Ok
>rcpt to:<[email protected]>
502 5.5.2 Error: command not recognized
>mail to:<[email protected]>
503 5.5.1 Error: nested MAIL command
>rcpt to:<[email protected]>
250 2.1.5 Ok
>data
354 End data with <CR><LF>.<CR><LF>
>this is a test
>.
250 2.0.0 Ok: queued as 648FFC128A
>quit
통나무:
Apr 13 09:17:28 webserver postfix/qmgr[31156]: 648FFC128A: from=<[email protected]>, size=329, nrcpt=1 (queue active)
Apr 13 09:17:43 webserver postfix/smtpd[34632]: connect from localhost[127.0.0.1]
Apr 13 09:17:43 webserver postfix/smtpd[34632]: 950C9C39CC: client=localhost[127.0.0.1]
Apr 13 09:17:43 webserver postfix/cleanup[34617]: 950C9C39CC: message-id=<[email protected]>
Apr 13 09:17:43 webserver postfix/qmgr[31156]: 950C9C39CC: from=<[email protected]>, size=1013, nrcpt=1 (queue active)
Apr 13 09:17:43 webserver postfix/smtpd[34632]: disconnect from localhost[127.0.0.1]
Apr 13 09:17:43 webserver amavis[1254]: (01254-18) Passed BAD-HEADER-7 {RelayedOpenRelay,Quarantined}, [24.210.201.75]:12825 [24.210.201.75] <steve@exam$
Apr 13 09:17:43 webserver postfix/smtp[34629]: 648FFC128A: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=165, delays=150/0.01/0.01/1$
Apr 13 09:17:43 webserver postfix/qmgr[31156]: 648FFC128A: removed
Apr 13 09:17:57 webserver postfix/smtpd[34531]: disconnect from cpe-24-210-201-75.neo.res.rr.com[24.210.201.75]
Apr 13 09:18:54 webserver postfix/smtp[34633]: connect to zomgaming.net[73.172.71.230]:25: Connection timed out
Apr 13 09:18:54 webserver postfix/smtp[34633]: 950C9C39CC: to=<[email protected]>, relay=none, delay=70, delays=0.02/0.04/70/0, dsn=4.4.1, status=deferred (connect to zomgaming.net[73.172.71.230]:25: Connection timed out)
글쎄, 나는 내부적으로 나 자신과 연결하려고 노력합니다.
root@webserver:/home/admin# telnet zomgaming.net 25
Trying 127.0.0.1...
Connected to mail.zomgaming.net.
Escape character is '^]'.
220 webserver.zomgaming.com ESMTP Postfix (Ubuntu)
/etc/nsswitch.conf의 출력:
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat
group: compat
shadow: compat
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
답변1
귀하의 웹 서버가 메일 서버이기도 webserver.zomgaming.com
하며 zomgaming.net
.
webserver.zomgaming.com
인바운드 SMTP 연결에 대한 220 배너에서 알 수 있듯이 Postfix는 실행 중임을 알고 있습니다 . 그러나 Postfix는 zomgaming.net
(문서에 따르면 ) 둘 중 하나도 모르는 것 같습니다 /etc/hosts
. 따라서 이메일을 받으면 [email protected]
해당 "원격" 호스트에 연결하여 전달하려고 시도합니다. 대부분의 정상 메일러는 자신과의 대화를 거부하므로 127.0.0.1을 통해 자신과 대화할 수 있더라도 시도는 실패할 수밖에 없습니다.
mydestination
구성 옵션을 살펴보세요main.cf
mydestination = webserver.zomgaming.com zomgaming.net