使用postfix架设SMTP只用来发邮件
来源:互联网 发布:ubuntu升级网卡驱动 编辑:程序博客网 时间:2024/06/05 08:51
使用postfix架设SMTP只用来发邮件
系统环境:
centos 5.3 x64
系统环境:
centos 5.3 x64
1.安装postfix软件
yum -y install postfix
yum -y install postfix
2.修改postfix的配置文件
mv /etc/postfix/main.cf /etc/postfix/main.cf.bak
vi /etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = mail.test.com.cn
mydomain = test.com.cn
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost,$mydomain
unknown_local_recipient_reject_code = 550
mynetworks = 192.168.100.0/24,192.168.0.0/24,127.0.0.0/8
relay_domains = $mydestination
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
smtpd_banner = $myhostname ESMTP unknow
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
mv /etc/postfix/main.cf /etc/postfix/main.cf.bak
vi /etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = mail.test.com.cn
mydomain = test.com.cn
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost,$mydomain
unknown_local_recipient_reject_code = 550
mynetworks = 192.168.100.0/24,192.168.0.0/24,127.0.0.0/8
relay_domains = $mydestination
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
smtpd_banner = $myhostname ESMTP unknow
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
message_size_limit = 15728640
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
message_size_limit = 15728640
3.修改或者创建sasl的配置文件
vi /usr/lib64/sasl2/smtpd.conf
pwcheck_method: auxprop
vi /etc/sysconfig/saslauthd
MECH=pam ----> #MECH=pam
FLAGS= ------> FLAGS=sasldb
4.添加用户名和密码
saslpasswd2 -u `postconf -h myhostname` -c username
输入两次密码
这里需要注意的是如果你是想需要通过telnet方式来验证用户名和密码是否能成功登陆的时候,在使用perl -MMIME::Base64 -e 'print encode_base64("username or password")'
中的username需要加上myhostname,例如你的myhostname为mail.test.com.cn 那么用户名就应该为,特别需要注意的是在@前面需要加上“\”不然验证是会失败的.
5.启动postfix服务
vi /usr/lib64/sasl2/smtpd.conf
pwcheck_method: auxprop
vi /etc/sysconfig/saslauthd
MECH=pam ----> #MECH=pam
FLAGS= ------> FLAGS=sasldb
4.添加用户名和密码
saslpasswd2 -u `postconf -h myhostname` -c username
输入两次密码
这里需要注意的是如果你是想需要通过telnet方式来验证用户名和密码是否能成功登陆的时候,在使用perl -MMIME::Base64 -e 'print encode_base64("username or password")'
中的username需要加上myhostname,例如你的myhostname为mail.test.com.cn 那么用户名就应该为,特别需要注意的是在@前面需要加上“\”不然验证是会失败的.
5.启动postfix服务
- 使用postfix架设SMTP只用来发邮件
- SMTP邮件服务器postfix配置与使用
- Postfix邮件服务器架设
- SMTP邮件postfix
- flex使用smtp协议发邮件
- 使用python smtp发邮件代码
- perl 使用Net::SMTP 发邮件
- 使用telnet登陆smtp服务发邮件
- Python 使用SMTP 实现发邮件功能
- 使用telnet登录smtp服务发邮件
- 使用telnet登陆smtp服务发邮件
- suse架设postfix邮件服务器
- LINUX下通过外部SMTP发邮件 (直接抛弃sendmail和postfix)
- LINUX下通过外部SMTP发邮件 (直接抛弃sendmail和postfix)
- LINUX下通过外部SMTP发邮件 (直接抛弃sendmail和postfix)
- 在linux下利用Google的SMTP来发邮件
- smtp发邮件
- SMTP发邮件
- 更新证书错误Code Sign error: Provisioning profile ‘XXXX'can't be found
- arm的七种运行模式
- iphone开发之SQLite使用详解
- Flex学习笔记(零)
- 简单字符设备驱动代码+注释(ldd3第三章例子)
- 使用postfix架设SMTP只用来发邮件
- 如何用photoshop更改一张动态图片上的文字
- Creating custom iOS UIButtons
- JSON的C语言编解码器——cJSON和json-c
- 线程与fork(2) (进程):把它们一起使用前,请谨慎考虑 (翻译)[转载]
- 线程编程知识[转载]
- Download png picture
- 大明北伐討元檄文
- swfupload介绍