Cyrus-SASL 安装
来源:互联网 发布:淘宝是如何盈利的 编辑:程序博客网 时间:2024/06/07 05:19
一 安装 cyrus-sasl
将系统自带的sasl先备份
1.mv /usr/lib/sasl /usr/lib/sasl.OFF
2.mv /usr/lib/sasl2 /usr/lib/sasl2.OFF
取源码安装
1. wget http://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.21.tar.gz
2. tar zxvf cyrus-sasl-2.1.21.tar.gz
3. cd cyrus-sasl-2.1.21
4. ./configure /
--disable-anon -enable-plain --enable-login /
--enable-sql --with-mysql=/usr/local/mysql /
--with-mysql-includes=/usr/local/mysql/include/mysql /
--with-mysql-libs=/usr/local/mysql/lib/mysql /
--with-authdaemond
5. make
6. make install
更新lib库
1. echo "/usr/local/lib" >> /etc/ld.so.conf
2. ldconfig
建立符号连接
1. ln -s /usr/local/lib/sasl2 /usr/lib/sasl2
二 配置 Cyrus-SASL
1. vi /usr/local/lib/sasl2/smtpd.conf
(加入一行:pwcheck_method: auxprop)
这种方式建立独立的用户跟密码对应的加密文件,用于验证客户端是否有使用此smtp的权限
其中 auxprop (Auxiliary Property Plug-ins 辅助性的专署外挂模块),起外挂模块使用Cyrus Sasl的 sasldb程序。这种方法不需要
saslauthd daemon.但是必须把所有的client 的帐户,密码放到一个专用的外部密码文件中。
2. 加入一个测试的帐户 ayla/pass (其中的 mail.test.com 与 PostFix 的主配文件main.cf中的myhostname要保持一致)
/usr/sbin/saslpasswd2 -c -u mail.test.com ayla
(两次输入密码: 123456)
3. 这个存放client的文件,默认的位置在 /etc/sasldb2
三 重装 PostFix
(先停掉使用的postfix : postfix stop)
1.make tidy
2.% make makefiles CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL /
-I/usr/local/include/sasl" AUXLIBS="-L/usr/local/lib -lsasl2"
3.make && make install
四 配置Postfix,让客户端使用验证通过才能发邮件
1. vi /etc/postfix/main.cf
在最后加上:
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated permit_auth_destination reject
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
五 测试
1.telnet mail.test.com 25
>
250-mail.test.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH DIGEST-MD5 LOGIN GSSAPI PLAIN CRAM-MD5 OTP
250-AUTH=DIGEST-MD5 LOGIN GSSAPI PLAIN CRAM-MD5 OTP
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
2.程序测试
使用Net::SMTP_AUTH 这个模块,下载解压,其中的README文件里说:
This module requires:
- Net::SMTP (should be obvious)
- MIME::Base64
- Digest::HMAC_MD5
- Authen::SASL
- Authen::NTLM (optional for NTLM)
所以就就把没有装的模块先装上。($perl -MCPAN -e 'install Net::SMTP_auth' 安装更简单,但是成功与否取决于网络,
有时国内的CPAN镜像速度奇慢无比)
3. 安装
perl Makefile.PL
make test
make install
4.测试脚本 test.pl
#!/usr/bin/perl
use Net::SMTP_auth;
$smtp = Net::SMTP_auth->new('mail.test.com');
$smtp->auth('CRAM-MD5', 'test', '13456'); ### ===>> 这里就是第二步配置的用户名跟密码
$smtp->mail('ayla@test.com');
$smtp->to('ayla@test.com');
$smtp->data();
$smtp->datasend("To: postmaster/n");
$smtp->datasend("/n");
$smtp->datasend("A test message/n");
$smtp->dataend();
$smtp->quit;
5. 检验发送结果。收信客户端 跟 /var/log/maillog
http://blog.csdn.net/Aylazhang/article/details/1678790
- Cyrus-SASL 安装
- Cyrus-SASL 安装
- Cyrus-SASL 安装
- postfix安装(四)-- cyrus-sasl安装
- RedHat AS 4.1 + Postfix + Dovecot + Cyrus-sasl 安装笔记
- ubuntu14.04下安装postfix+cyrus-sasl经验
- Cyrus SASL Libary 学习
- Cyrus SASL Libary学习
- postfix + dovecot + cyrus-sasl
- Postfix邮件系统安装与配置:Postfix,Cyrus-IMAP,Cyrus-sasl,Dovecot和SPF
- Postfix + Cyrus-IMAP + Cyrus-SASL + MySQL + IMP
- Postfix + Cyrus-IMAP + Cyrus-SASL + MySQL + IMP
- Postfix + Cyrus-IMAP + Cyrus-SASL + MySQL + IMP
- Postfix + Cyrus-IMAP + Cyrus-SASL + MySQL + IMP
- windows下编译cyrus-sasl
- courier-authlib、courier-imap、maildrop、cyrus-sasl的编译安装及与postfix的关联
- Ubuntu 12.04安装配置Postfix dovecot cyrus sasl(mysql虚拟用户)
- Postfix+Cyrus-IMAP + Cyrus-SASL + MySQL + IMP 配置指南
- 对几个问题的思考
- T-SQL 计算固定资产折旧(双倍余额法)
- mongodb集群搭建
- eclipse3.7安装maven插件失败问题解决
- postfix sasl身份验证
- Cyrus-SASL 安装
- hdu 4308 Saving Princess claire_ 广搜 多校联合赛第七题
- linux中如何重新获取丢失的密码
- POJ-2823单调队列
- CentOS下搭建DNS详细版
- 初学汇编之CPU类型识别
- 什么是SMTP协议?SMTP端口号是多少?什么是SMTP服务器?免费smtp服务器?
- 前端 _本地存储问题
- Oracle中关于查看角色与角色间权限的差异的SQL语句