Postfix
如何將使用者添加到後綴?
我用 davecot 創建和配置了後綴,一切似乎都正常:
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 嗎?
後綴配置:
# 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
大致有兩種創建電子郵件使用者的途徑:
- PAM 集成,其中 OS (Linux) 使用者(也可以登錄到例如桌面的使用者,使用 ssh,具有唯一的主目錄和 UID 號等)也使用相同的帳戶/憑據來發送電子郵件。除了“
login@[hostname.]example.com
”樣式的電子郵件地址之外,您還可以關聯特定的附加電子郵件地址。- 僅用於發送和接收電子郵件但沒有作業系統帳戶的“虛擬使用者”。參見例如https://doc.dovecot.org/configuration_manual/howto/simple_virtual_install/