Chinaunix首页 | 论坛 | 博客
  • 博客访问: 227466
  • 博文数量: 30
  • 博客积分: 1617
  • 博客等级: 上尉
  • 技术积分: 317
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-02 10:32
文章分类

全部博文(30)

文章存档

2019年(1)

2016年(1)

2014年(1)

2012年(3)

2011年(4)

2010年(8)

2009年(5)

2008年(7)

我的朋友

分类: LINUX

2010-11-22 15:06:28

使用postfix架设SMTP只用来发邮件
系统环境:
centos 5.3 x64
1.安装postfix软件和cyrus-sasl软件

点击(此处)折叠或打开

  1. yum -y install postfix cyrus-sasl-*
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
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
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服务
阅读(2673) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-11-23 15:41:41

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com