postfix邮件测试.docVIP

  • 7
  • 0
  • 约3.92千字
  • 约 5页
  • 2016-09-20 发布于重庆
  • 举报
postfix邮件测试

RHEL5安装Postfix+CyrusSASL+dovecot [root@mail ~]# groupadd mail [root@mail ~]# useradd –g mail -s /sbin/nologin zpp001 [root@mail ~]# useradd -g mail -s /sbin/nologin zpp002 [root@mail ~]# passwd zpp001 [root@mail ~]# passwd zpp002   將postfix加入到root的组: # usermod -G root postfix   三、SMTP认证的配置   安装cyrus-sasl   1、确认cyrus-sasl是否安装了  [root@rhel5 Server]# rpm -qa|grep cyrus  cyrus-sasl-plain-2.1.22-4  cyrus-sasl-lib-2.1.22-4  cyrus-sasl-2.1.22-4  2、Cyrus-SASL V2的密码验证机制   [root@rhel5 ~]# saslauthd -v   saslauthd 2.1.22   authentication mechanisms: getpwent kerberos5 pam rimap shadow ldap   我们准备用的是shadow的密码验证机制。   vi /etc/sysconfig/saslauthd   MECH=shadow   3、启动sasl的daemon并测试:   # service saslauthd start   # /usr/sbin/testsaslauthd -u 帐号 -p 密码   0: OK Success. =帐号验证成功了   [root@rhel5 ~]# chkconfig saslauthd on   4、设置postfix启用SMTP认证   [root@rhel5 Server]# vi /etc/postfix/main.cf   smtpd_sasl_auth_enable = yes   smtpd_sasl_local_domain=   smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,   reject_unauth_destination   broken_sasl_auth_clients = yes   smtpd_client_restrictions = permit_sasl_authenticated   smtpd_sasl_security_options = noanonymous   wq!保存   此外,由于当postfix要使用SMTP认证时,会读取/usr/lib/sasl2/smtpd.conf文件的内容以确定所采用的认证方式,所以必须保证/usr/lib/sasl2/smtpd.conf文件的内容是: pwcheck_method: saslauthd 5、测试SMTP发送邮件 [root@mail ~]# telnet localhost 25 Trying ... Connected to localhost.localdomain (). Escape character is ^]. 220 ESMTP Postfix helo localhost //宣告客户端地址 250 mail from:zpp001@ //告知服务器发件人地址 250 2.1.0 Ok rcpt to:zpp002@ //告知服务器收件人地址 250 2.1.5 Ok data //告知服务器要传送数据了 354 End data with CRLF.CRLF subject:I Love You! //主题 hello! You are my super star! he he he ! //邮件内容以点结束 . //邮件结束 250 2.0.0 Ok: queued as 27ECCE01ED Quit //退出 221 2.0.0 Bye Connection closed by foreign host. 现在我们到邮件用户zpp002的宿主目录下进行查看,可以看到刚刚接收到的邮件保存在Maildir子目录中。 [root@mail~]# cat /home/zpp002/Maildir/new/1611777596.Vfd00I258020M2487

文档评论(0)

1亿VIP精品文档

相关文档