POSTFIX를 사용하여 이메일을 전달하는 데 문제가 있습니다.

POSTFIX를 사용하여 이메일을 전달하는 데 문제가 있습니다.

외부 이메일에서 이메일을 보내야 합니다(예: "user@external_domain.com"), 내 서버의 이메일 계정으로 전송됨(예: "root@my_domain.com"), 다른 외부 주소로 전달됨(예: "[이메일 보호됨]"). 하지만 작동하지 않고 로그 파일에 오류도 없습니다.

도메인 주소, 이메일, IP는 고객 개인정보 보호를 위해서만 변경됩니다.

외부 이메일에서 메시지를 보내는 경우의 예user@external_domain.com, 내 서버의 이메일 계정으로 전송되었습니다. 예:root@my_domain.com, 루트 이메일 상자에 올바르게 도달합니다.

다음과 같이 로그인하세요.

May 24 18:47:58 mail postfix/smtpd[1711]: connect from a4-salsa4-1.my_domain.com[62.14.x.x] 
May 24 18:47:58 mail postfix/smtpd[1711]: 6C776419DE: client=a4-salsa4-1.my_domain.com[62.14.x.x] 
May 24 18:47:58 mail postfix/cleanup[1715]: 6C776419DE: message-id=<[email protected]> 
May 24 18:47:58 mail postfix/qmgr[1415]: 6C776419DE: from=<exemplo user@external_domain.com>, size=2087, nrcpt=1 (queue active) 
May 24 18:47:58 mail postfix/smtpd[1711]: disconnect from a4-salsa4-1.my_domain.com[62.14.x.x] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5 
May 24 18:47:58 mail postfix/local[1716]: 6C776419DE: to=<root@my_domain.com>, relay=local, delay=0.07, delays=0.06/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox) 
May 24 18:47:58 mail postfix/qmgr[1415]: 6C776419DE: removed

"루트" 계정(root@my_domain.com) 를 향해서 "[이메일 보호됨]” 그래서 라우팅을 구성했습니다.

전달 활성화(셸에서 루트로):

# echo "\ root [email protected]"> ~ / .forward

이 라우팅 설정을 통해 "보낸 이메일"에서user@external_domain.com"이메일 주소로 보내기"root@my_domain.com", 로컬 메일 계정(내 vps)에 도달하지만 "[이메일 보호됨]".

그러나 로그에는 "[이메일 보호됨]”, 아래 로그를 참조하세요.

May 24 17:58:14 mail postfix/smtpd[32297]: connect from a4-salsa4-1.my_domain.com[62.14.x.x]
May 24 17:58:14 mail postfix/smtpd[32297]: 7A43B41A02: client=a4-salsa4-1.my_domain.com[62.14.x.x]
May 24 17:58:14 mail postfix/cleanup[32301]: 7A43B41A02: message-id=<[email protected]>
May 24 17:58:14 mail postfix/qmgr[30879]: 7A43B41A02: from=<user@external_domain.com>, size=2087, nrcpt=1 (queue active)
May 24 17:58:14 mail postfix/smtpd[32297]: disconnect from a4-salsa4-1.my_domain.com[62.14.x.x] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
May 24 17:58:14 mail postfix/cleanup[32301]: 7FD4D41A08: message-id=<[email protected]>
May 24 17:58:14 mail postfix/qmgr[30879]: 7FD4D41A08: from=<user@external_domain.com>, size=2231, nrcpt=1 (queue active)
May 24 17:58:14 mail postfix/local[32302]: 7A43B41A02: to=<root@my_domain.com>, relay=local, delay=0.03, delays=0.02/0.01/0/0, dsn=2.0.0, status=sent (forwarded as 7FD4D41A08)
May 24 17:58:14 mail postfix/qmgr[30879]: 7A43B41A02: removed
May 24 17:58:14 mail postfix/smtp[32303]: 7FD4D41A08: to=<[email protected]>, orig_to=<root@my_domain.com>, relay=relay.my_vps_host.com[177.153.9.96]:25, delay=0.33, delays=0/0.01/0.31/0.01, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as CE14D777DC134)
May 24 17:58:14 mail postfix/qmgr[30879]: 7FD4D41A08: removed

로컬 이메일을 루트(예: crontab 작업)로 보낼 때 이메일은 성공적으로 로컬 계정에 도달하고 "[이메일 보호됨]", 로그 보기:

May 24 17:55:03 mail postfix/smtp[32250]: 6E08B41A02: to=<[email protected]>, orig_to=<root>, relay=relay.my_vps_host.com[177.153.9.96]:25, delay=1.2, delays=0.01/0.02/0.93/0.28, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 6732B777D6711)
May 24 17:55:03 mail postfix/qmgr[30879]: 6E08B41A02: removed

필터가 있는 것 같아요."Relay.my_vps_host.com“메시지를 차단하세요.

그래서 서버 지원팀에 확인 요청을 열었는데 릴레이에 어떤 종류의 잠금 장치도 없다고 하더군요("Relay.my_vps_host.com").

전달되어야 할 이메일이 도착하지 않습니다."[이메일 보호됨]".

/etc/postfix/main.cf:

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated 
defer_unauth_destination
myhostname = mail.my_domain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, my_domain.com,  mail.my_domain.com, localhost.my_domain.com, , localhost
relayhost = relay.my_vps_host.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

/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)   (no)    (never) (100)
# ==========================================================================
smtp      inet  n       -       y       -       -       smtpd
#smtp      inet  n       -       y       -       1       postscreen
#smtpd     pass  -       -       y       -       -       smtpd
#dnsblog   unix  -       -       y       -       0       dnsblog
#tlsproxy  unix  -       -       y       -       0       tlsproxy
submission inet n       -       y       -       -       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       -       y       -       -       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       -       y       -       -       qmqpd
pickup    unix  n       -       y       60      1       pickup
cleanup   unix  n       -       y       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       y       1000?   1       tlsmgr
rewrite   unix  -       -       y       -       -       trivial-rewrite
bounce    unix  -       -       y       -       0       bounce
defer     unix  -       -       y       -       0       bounce
trace     unix  -       -       y       -       0       bounce
verify    unix  -       -       y       -       1       verify
flush     unix  n       -       y       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       y       -       -       smtp
relay     unix  -       -       y       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       y       -       -       showq
error     unix  -       -       y       -       -       error
retry     unix  -       -       y       -       -       error
discard   unix  -       -       y       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       y       -       -       lmtp
anvil     unix  -       -       y       -       1       anvil
scache    unix  -       -       y       -       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 ${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=/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}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

my_domain.com용 SPF:

  • v=spf1 +a +mx +ptr:my_vps_host.com 포함:_spf.google.com -all

나는 다음을 사용하고 있습니다 :

  • 데비안 9(확장).
  • 접미사 3.1.8.

"root@my_domain.com"으로 이메일을 전달하는 데 도움을 줄 수 있는 사람이 있나요?

매우 감사합니다!

관련 정보