%20.png)
나는 매우 리눅스 초보적인 사람이고 당신이 제공할 수 있는 도움과 인내심에 크게 감사드립니다.
우분투 21.04를 실행 중입니다.
postfix를 통해 메일을 보낼 수 있도록 설정하려고 합니다.
이것은 내 구성입니다.
nano /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 = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = <mydomain>.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, mail.<mydomain>.com, <computer name>, localhost.localdomain, localhost
relayhost = [mail.<mydomain>.com]:465
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
# Enable SASL authentication
smtp_sasl_auth_enable = yes
# Disallow methods that allow anonymous authentication
smtp_sasl_security_options = noanonymous
# Location of sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
# Enable STARTTLS encryption
smtp_use_tls = yes
# where to find CA certificates
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_wrappermode = yes
smtp_tls_security_level = encrypt
다음을 실행하여 테스트 이메일을 보냅니다.
echo "Test Mail" | mail -s "Test Email" <[email protected]>
그런데 이메일을 받지 못했습니다(스팸메일함도 확인했습니다).
다음은
nano /var/log/mail.log
Aug 22 01:01:13 <computername> postfix/pickup[1396540]: 1F77980FA1: uid=1000 from=<<user>@<computername>>
Aug 22 01:01:13 <computername> postfix/cleanup[1396964]: 1F77980FA1: message-id=<20210822050113.1F77980FA1@<mydomain>.com
Aug 22 01:01:13 <computername> postfix/qmgr[1396541]: 1F77980FA1: from=<user>@<computername>, size=347, nrcpt=1 (queue active)
Aug 22 01:01:13 <computername> postfix/smtp[1396966]: warning: database /etc/postfix/sasl_passwd.db is older than source file /etc/postfix/sasl_passwd
Aug 22 01:01:14 <computername> postfix/smtp[1396966]: 1F77980FA1: to=<[email protected]>, relay=mail.<mydomain>.com[<ip address>]:465, delay=1.2, delays=0.07/0.08/0.74/0.27, dsn=2.0.0, status=sent (250 OK id=1mHfbe-001L4X-3a)
Aug 22 01:01:14 <computername> postfix/qmgr[1396541]: 1F77980FA1: removed
귀하가 제공할 수 있는 도움에 미리 감사드립니다.
답변1
예, 이 구성이 맞습니다.