How to configure postfix to user other SMTP server

本文介绍如何在Redhat Fedora 2系统上配置Postfix 2.0.18版本使用外部SMTP服务器发送邮件。主要步骤包括创建客户端信息文件、设置权限、生成数据库并重启Postfix服务等。

How to configure postfix to user other SMTP server?

[Precondition]

OS         : Redhat Fedora 2

Postfix    : 2.0.18

 

[How to configure /etc/postfix/main.cf]

1) Create client-info file in /etc/postfix directory,

and input: your.isp.net your_user_name:your_password.

For example:

smtp.sina.com  hello_wyq:no_ways

Save and quit it.

#cd /etc/postfix

#vi ./client-info

2) Change mode of client-info only for root

#cd /etc/postfix

#chmod 600 ./client-info

3) Use ’postmap’ to generate client-info database

#cd /etc/postfix

#postmap hash:/etc/postfix/client-info

4) Remove client-info file

#cd /etc/postfix

#rm –f ./client-info

5) Open main.cf file and add seven directives.

# Use sina’s smtp to send emails

Relayhost = smtp.sina.com

# Enable authentication of SASL

smtp_sasl_auth_enable = yes

# Disable anonymous account

smtp_sasl_security_options = noanonymous

# Add client-info for authentication

smtp_sasl_password_maps = hash:/etc/postfix/client-info

# Add restrictions

smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,permit_auth_destination reject_unauth_destination

smtpd_client_restrictions = permit_mynetworks,permit_sasl_authenticated

broken_sasl_auth_clients = yes

6) Restart postfix server

#service postfix restart

If you have more questions to understand, please visit http://www.postfix.org/.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值