PostFix에서 수신 이메일을 받는 데 문제가 있습니다

PostFix에서 수신 이메일을 받는 데 문제가 있습니다

이 사이트(수퍼유저/stackoverflow/serverfault)에 질문을 하면 괜히 뒹굴거리는 것 같아서 제 질문이 잘못된 위치에 있는 경우 양해해 주시고 지적해 주시면 기꺼이 다른 곳으로 옮기겠습니다. .

내 Gmail 계정에서 내 우분투 서버로 보내는 이메일은 평생 동안 받을 수 없습니다. 나는 MTA로 postfix를 사용하고 있으며 처음에는 이 지침이 가장 간단하고 일반적인 접근 방식인 것처럼 보였기 때문에 정확하게 따랐습니다. 그러나 이 지침을 사용하면 내 Gmail 계정으로 이메일을 보낼 수도 없는 것 같습니다(실패): https://help.ubuntu.com/lts/serverguide/postfix.html

여러 시간 동안 검색하고 다시 시도한 끝에 우연히 이 질문을 발견하게 되었고 답변에 대한 댓글에 있는 많은 사람들이 이 질문이 정말 도움이 되었다고 주장했기 때문에 한번 시도해 볼까 하는 생각이 들었습니다. 그의 지시가 작동하지 않았을 때 나는 그의 지시와 비슷한 오류 메시지를 받았고 결국 다음 지시를 받았습니다. https://serverfault.com/questions/119278/configure-postfix-to-send-relay-emails-gmail-smtp-gmail-com-via-port-587

불행하게도 위의 지침은 내 Linux/ubuntu에서 내 Gmail로 이메일만 보냅니다. 나의 가장 큰 소망은 내 Gmail에서 내 Linux/ubuntu로 보낸 이메일을 받는 것입니다.참고하시면 도움이 될 것 같습니다내 Ubuntu는 내 Macintosh 노트북에서 실행되는 로컬 웹 서버입니다.

편집하다:나는 이것이 개발 설정이기 때문에 고정 IP가 없기 때문에 동적 DNS(freedns.afraid.org) 서비스가 가리키는 VM에서 우분투를 사용하고 있다고 말하는 것이 중요하다고 생각합니다.

여기에 귀하가 선택할 수 있는 main.cf 및 master.cf 파일이 있습니다. 나에게 제공하고 싶은 도움이 있으면 크게 감사하겠습니다.

메인.cf :

참고: #smtpd_tls_key_file 및 #smtpd_tls_cert_file 행이 주석 처리되어 있음을 알 수 있습니다. 처음에는 이것이 지겨웠지만 내가 따른 지침의 답변자는 단순성을 위해 생략할 수 있는 이유를 설명합니다.

그의 설명은 다음과 같습니다.

이제 시스템 관리자로 일한 13년이 낭비되지 않았음을 보여주었기 때문에 다른 사람들이 말하는 것처럼 자체 서명된 x.509 인증서를 생성할 필요 없이 Gmail을 통해 내 노트북에서 이메일을 보낼 수 있습니다. /etc/postfix/main.cf에 추가된 주요 사항은 TLS를 지원하는 경우 다른 MTA에 연결할 때 STARTTLS 명령을 실행해도 괜찮다는 것을 Postfix에 알리기 위한 smtp_tls_security_level 설정입니다.

나는 그것들을 주석 처리하는 것에 집착하지 않고 키와 인증서를 사용할 의향이 있지만 당분간은 그것들 없이도 작동하고 일을 단순하게 유지합니다. 나는 단지 효과가 있었던 것을 가지고 가고있었습니다.

# 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 = no

# TLS parameters
#smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
#smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.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
smtp_tls_security_level = may

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = < my FQDN >
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = < my FQDN >
relayhost = smtp.gmail.com:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =

여기 내 master.cf 파일이 있습니다. 이 파일에서 제가 변경한 유일한 내용은 다음과 같습니다.

smtp      inet  n       -       n       -       -       smtpd

^ 그 줄은 원래 이랬어요

smtp      inet  n       -       -       -       -       smtpd

솔직히 말해서 그 작은 차이가 무엇인지는 잘 모르겠지만 제가 살펴본 많은 지침에서 권장되었으며 메일 보내기/받기 조합에서는 아직 아무런 차이가 없었습니다.

약속대로 내 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       -       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=
#  -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_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
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 ${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}

당신에게 효과가 있었던 것에 대한 도움이나 깨달음이 있으면 좋을 것입니다. 감사합니다!

관련 정보