个人工具
登录
查看“Serverguide”的源代码 - Ubuntu中文
页面
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“Serverguide”的源代码
来自Ubuntu中文
←
Serverguide
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
====== 4.14.1.3. SMTP 认证 ====== 下一步是为 postfix 的 SMTP AUTH 配置使用 SASL。与其直接编辑配置,不如使用 postconf 命令配置所有 postfix 参数。配置参数被保存在 /etc/postfix/main.cf 文件中。如果您希望更新配置一项参数,您可以运行命令或手工在文件中修改。 *** 配置 Postfix 使用 SASL (saslauthd) 的 SMTP AUTH : <pre><nowiki> postconf -e 'smtpd_sasl_local_domain =' postconf -e 'smtpd_sasl_auth_enable = yes' postconf -e 'smtpd_sasl_security_options = noanonymous' postconf -e 'broken_sasl_auth_clients = yes' postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination' postconf -e 'inet_interfaces = all' echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf</nowiki></pre> *** 接下来为 TLS 配置数字证书。当被询问问题时,按照提示并适当回答。 <pre><nowiki> openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024 chmod 600 smtpd.key openssl req -new -key smtpd.key -out smtpd.csr openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt openssl rsa -in smtpd.key -out smtpd.key.unencrypted mv -f smtpd.key.unencrypted smtpd.key openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650 mv smtpd.key /etc/ssl/private/ mv smtpd.crt /etc/ssl/certs/ mv cakey.pem /etc/ssl/private/ mv cacert.pem /etc/ssl/certs/</nowiki></pre> 您可以从证书颁发机构得到数字证书。或者您可以创建您自己的证书。详情参考 第4.10.3.4节 ― 创建一个自己签署的证书。 *** 配置 Postfix 对接收或发送邮件进行 TLS 加密: <pre><nowiki> postconf -e 'smtpd_tls_auth_only = no' postconf -e 'smtp_use_tls = yes' postconf -e 'smtpd_use_tls = yes' postconf -e 'smtp_tls_note_starttls_offer = yes' postconf -e 'smtpd_tls_key_file = /etc/ssl/private/smtpd.key' postconf -e 'smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt' postconf -e 'smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem' postconf -e 'smtpd_tls_loglevel = 1' postconf -e 'smtpd_tls_received_header = yes' postconf -e 'smtpd_tls_session_cache_timeout = 3600s' postconf -e 'tls_random_source = dev:/dev/urandom' postconf -e 'myhostname = mail.example.com'</nowiki></pre> 在您运行所有命令之后,postfix 的 SMTP AUTH 将被配置。将为 TLS 创建自己签署的证书并与 postfix 一起配置。 现在文件 /etc/postfix/main.cf 看上去就象 这样。 postfix 初始配置完成。运行下列命令以开始 postfix 守护程序: <pre><nowiki> sudo /etc/init.d/postfix start</nowiki></pre> 现在 postfix 已经被安装、配置及成功运行。Postfix 支持在 RFC2554 中定义的 SMTP AUTH。它基于 SASL。无论如何在您使用 SMTP 之前必须设置 SASL 认证。
返回至
Serverguide
。