我使用 davecot 创建并配置了 postfix,一切似乎正常:
Dec 20 10:31:32 mailer dovecot: master: Warning: Killed with signal 15 (by pid=8470 uid=0 code=kill)
Dec 20 10:33:03 mailer dovecot: master: Dovecot v2.3.7.2 (3c910f64b) starting up for imap, pop3, imap, lmtp, pop3 (core dumps disabled)
Dec 20 10:36:26 mailer dovecot: master: Warning: SIGHUP received - reloading configuration
Dec 20 10:38:18 mailer postfix/postfix-script[8513]: stopping the Postfix mail system
Dec 20 10:38:18 mailer postfix/master[8282]: terminating on signal 15
Dec 20 10:38:24 mailer postfix/postfix-script[9155]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Dec 20 10:38:24 mailer postfix/postfix-script[9320]: starting the Postfix mail system
Dec 20 10:38:24 mailer postfix/master[9322]: daemon started -- version 3.4.13, configuration /etc/postfix
Dec 20 10:38:29 mailer dovecot: master: Warning: Killed with signal 15 (by pid=9328 uid=0 code=kill)
Dec 20 10:40:01 mailer dovecot: master: Dovecot v2.3.7.2 (3c910f64b) starting up for imap, pop3, lmtp, imap, lmtp, pop3 (core dumps disabled)
配置了 mx 记录和域本身的记录。检查了所有内容https://mxtoolbox.com
如何测试发送和接收电子邮件?
如何创建用户?
我可以向其他服务器发送消息吗,例如 Gmail?
Postfix 配置:
# 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
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/certificate.crt
smtpd_tls_key_file=/etc/ssl/private/private.key
smtpd_tls_security_level=may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mydomain.xyz
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mydomain.xyz, mailer.mydomain.xyz, localhost.mydomain.xyz, , localhost
relayhost =
#mynetworks = 127.0.0.0/8 10.0.0.0/8 172.0.0.0/8 [::]/128 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks = 0.0.0.0/0 , 127.0.0.0/8
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
home_mailbox = Maildir/
virtual_alias_maps = hash:/etc/postfix/virtual
smtpd_use_tls = yes
mynetworks_style = subnet
答案1
大致来说,创建电子邮件用户有两种途径:
PAM 集成,其中 OS (Linux) 用户(也可以使用 ssh 登录到桌面等的用户,具有唯一的主目录和 UID 号等)也使用相同的帐户/凭据来发送电子邮件。除了“
login@[hostname.]example.com
”样式的电子邮件地址外,您还可以关联特定的其他电子邮件地址。“虚拟用户”仅用于发送和接收电子邮件,但没有操作系统帐户。例如,请参阅https://doc.dovecot.org/configuration_manual/howto/simple_virtual_install/