![如何设置 PostFix 发送邮件](https://linux22.com/image/534063/%E5%A6%82%E4%BD%95%E8%AE%BE%E7%BD%AE%20PostFix%20%E5%8F%91%E9%80%81%E9%82%AE%E4%BB%B6.png)
我正在为一个网站编写电子邮件确认,我对此真的很陌生。所以如果有人请告诉我如何设置 postfix 来发送邮件。我只需要发送邮件(纯文本就可以了,尽管加密邮件会更好)。我正在使用 Java 发送邮件。请帮忙
答案1
要与其他主机上的 SMTP 身份验证进行交互,您需要 dovecot。使用类似于下面指定的配置示例,并根据需要修改 mydomain 和 myhostname。这应该允许基本的邮件发送功能。使用 gnupg 加密电子邮件,我认为应该有一些 Java 绑定。
mydomain = yourdomain.com
myhostname = yourdomain.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 127.0.0.0/8, 10.0.0.0/24
home_mailbox = Maildir/
header_checks = regexp:/etc/postfix/header_checks
body_checks = regexp:/etc/postfix/body_checks
smtpd_banner = $myhostname ESMTP
# limit an email size 10M
message_size_limit = 10485760
# limit mailbox 1G
mailbox_size_limit = 1073741824
# for SMTP-Auth settings
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_client_restrictions = permit_mynetworks,reject_unknown_client,permit
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/pki/tls/certs/server.crt
smtpd_tls_key_file = /etc/pki/tls/certs/server.key
smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache
如果您需要更多信息,这是一个有用的链接: http://www.server-world.info/en/note?os=Fedora_14&p=mail