yum -y install postfix cyrus-sasl-*
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
my
hostname = 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
注意,如果需要通过telnet方式来验证用户名和密码是否能成功登陆的时候,在使用perl -mmime::base64 -e 'print encode_base64("username or password")'
中的username需要加上myhostname,例如你的myhostname为mail.test.com.cn 那么用户名就应该为username@mail.test.com,特别需要注意的是在@前面需要加上“”不然验证是会失败的.