如何設定 PostFix 發送郵件

如何設定 PostFix 發送郵件

我正在為一個網站製作電子郵件確認,對此我真的很陌生。因此,如果有人請告訴我如何設定 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

相關內容