免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: marion
打印 上一主题 下一主题

[Mail] RHEL4上安装基于postfix的全功能邮件服务器(全部使用目前最新源码包构建) [复制链接]

论坛徽章:
0
701 [报告]
发表于 2008-07-14 16:25 |只看该作者
原帖由 safe.cn 于 2008-7-13 12:57 发表
DBD-Mysql目前最新的版本为DBD-mysql-4.005,但它和系统中的perl结合使用时会造成extmail无法正常使用,因此我们采用3的版本:
# tar zxvf DBD-mysql-3.0002_4.tar.gz  
# cd DBD-mysql-3.0002_4
# unset LA ...


RHEL5自带的也是
perl-DBD-MySQL-3.0007-1.fc6

我没有重新安装Mysql,直接使用RHEL5自带的MySQL、perl-DBD-MySQL

省了不少麻烦!

论坛徽章:
0
702 [报告]
发表于 2008-07-14 16:38 |只看该作者
以下添加smtp 的 tls 加密部分,欢迎楼主及各位指导,谢谢!

二十一、开启Postfix(smtp)的TLS功能
[2008-7-14 updated]

STARTTLS(TLS)介绍

TLS - Transport Layer Security ( 为网路 OSI 七层中的第四层加密技术,SSL - Secure Socket Layer 协定为之前身 )
       SASL - Simple Authentication and Security Layer ( 简易的安全认证,SASL 同时也提供 SMTP 认证,定义在 RFC-2554 http://www.ietf.org/rfc/rfc2554.txt )
       Key - 安全连线金钥 ( key-pair )  CA - 授权凭证 ( Certification Authority )

        网路上有些独立公正单位例如 VeriSign 及 GlobalSign 等等……它们就是专门贩卖安全金钥 Key 以及授权凭证 CA 的单位,我们这边採用自行製作安全金钥以及授权凭证,自行製作的安全金钥与授权凭证,在功能上与买来的相同,只是向独立公正单位购买来的 Key 跟 CA,会让 Client 使用者心理上觉得比较有保障,因为我们不做生意所以也不需要花钱买Key 跟 CA ,这边 Postfix + TLS 主要目的是保障我的连线加密防止帐号密码外洩。

(一)SMTP和STARTTLS

[转自Marion博客]
SMTP协议默认使用明文在网络传送用户名和密码,这是十分危险的。为此,Postfix使用TLS(Transport Layer Security)来解决这个潜在的危险问题。TLS不仅可以用来加密用户名和密码,还可以加密传送信件的内容。Sendmail使用starttls命令来启动一个SMTP会话加密进程(TLS会话)。Micorsoft的outlook软件和其它的许多MUA也支持STARTTLS。

STARTTLS能实现什么样的功能?
1.实现对一次E-MAIL通讯中server端以及client端彼此身份的校验;
2.加密传输信件(身份不能确认的情况下亦可以实现);
3.认证转发;

由于SMTP是一个存储转发协议,并且一封电子邮件的转交投递可能会涉及到多台SMTP服务器,因此,一个MUA就算能够通过认证并把E-MAIL加密传输至将要经过的第一台SMTP服务器,让最终用户的SMTP通过发送端的身份认证,并认为信件传送过程中没有被篡改也是不太可能的。故而,RFC文件声明说一个实现公共Email的SMTP服务器是不必苛求于在传送邮件中实现上述功能的。不过,对于一个私有网络中的邮件传输来讲,能够以要求必需提供有效证书来实现严格的身份认证和加密传输,因为我们可以将证书部署到需要传送EMAIL服务的每个客户端。

当然,尽管基于TLS的SMTP服务所提供的功能不像基于SSL的HTTP服务那样完美,但在服务器和客户端之间的一次认证会话间加密传输用户名和密码却是完全可以实现的。

(二)openssl简明使用手册

[转自Marion博客]
此处简要介绍了使用openssl来生成CA证书、申请证书、颁发证书以及撤销证书的过程,临时补上openssl一课。

1. 首先建立CA密钥:
openssl genrsa -des3 -out ca.key 1024 (创建密钥)
chmod 400 ca.key (修改权限为仅root能访问)
openssl rsa -noout -text -in ca.key (查看创建的证书)

2. 利用CA密钥自签署CA证书:
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
chmod 400 ca.crt (修改权限为仅root能访问)
openssl x509 -noout -text -in ca.crt (查看创建的证书)

3. 创建服务器证书签署申请:
openssl genrsa -des3 -out client.key 1024
chmod 400 server.key (修改权限为仅root能访问)
openssl rsa -noout -text -in client.key (查看创建的证书)

4. 利用证书签署申请生成请求:
openssl req -new -key client.key -out client.csr
openssl req -noout -text -in client.csr (查看创建的请求)

5.进行证书签署:
这时候需要先设置一下openssl的配置文件。
modify /usr/share/ssl/openssl.cnf并根据这个配置文件创建相应的目录和文件。
在创建了serial文件之后,还需要添加当前的八进制的serial number,如:01
然后执行:
openssl ca -keyfile ca.key -cert ca.crt -in client.csr -out client.pem

6.证书撤销:
openssl ca -keyfile ca.key -cert ca.crt -revoke client.pem
这时数据库被更新证书被标记上撤销的标志,需要生成新的证书撤销列表:
openssl ca -gencrl -keyfile ca.key -cert ca.crt -out crl/test.crl
查看证书撤销列表:
openssl crl -noout -text -in crl/test.crl
证书撤销列表文件要在WEB站点上可以使用,必须将crldays或crlhours和crlexts加到证书中:
openssl ca -gencrl -config /etc/openssl.cnf -crldays 7 -crlexts crl_ext -out crl/sopac-ca.crl


1.        制作CA证书与Private Key给Postfix SSL/TLS

#建立存放CA的文件夹(非必须)
  1. #mkdir /usr/local/postfix/CA  
  2. #cd /usr/local/postfix/CA/
复制代码

使用CA.pl这个脚本可以方便的制作证书,将此脚本复制到刚刚建立的CA目录下
  1. #cp /usr/local/ssl/misc/CA.pl ./
复制代码


a.        Become your own Certificate Authority, so that you can sign your own public key(官方原文)
执行perl脚本
  1. #perl CA.pl -newca [code]  

  2. 回车后出现如下代码:
  3. [code]CA certificate filename (or enter to create)         #此处我直接回车,保持默认证书名称

  4. Making CA certificate ...
  5. Generating a 1024 bit RSA private key
  6. .......++++++
  7. ...++++++
  8. writing new private key to './demoCA/private/cakey.pem'
  9. Enter PEM pass phrase:                        #输入密码
  10. Verifying - Enter PEM pass phrase:    #再次输入密码
  11. -----
  12. You are about to be asked to enter information that will be incorporated
  13. into your certificate request.
  14. What you are about to enter is what is called a Distinguished Name or a DN.
  15. There are quite a few fields but you can leave some blank
  16. For some fields there will be a default value,
  17. If you enter '.', the field will be left blank.
  18. -----
  19. Country Name (2 letter code) [AU]:CN                                             ←此处为国家名称代码
  20. State or Province Name (full name) [Some-State]:GD                   ←此处为地域(省)名称
  21. Locality Name (eg, city) []:DG                                                             ←此处为城市名称
  22. Organization Name (eg, company) [Internet Widgits Pty Ltd]:lanexpert             ←此处为单位名称
  23. Organizational Unit Name (eg, section) []:IT                                                              ←此处为部分名称
  24. Common Name (eg, YOUR name) []:lingping                                                             ←此处为你的名称或服务器名字或省略
  25. Email Address []:lpzeng@lanexpert.cn                                                                       ←此处为管理邮件

  26. Please enter the following 'extra' attributes
  27. to be sent with your certificate request
  28. A challenge password []:123456                                                                                 ←输入密码
  29. An optional company name []:                                                                                    ←输入公司名称或省略
  30. Using configuration from /usr/local/ssl/openssl.cnf
  31. Enter pass phrase for ./demoCA/private/cakey.pem:
  32. Check that the request matches the signature
  33. Signature ok
  34. Certificate Details:
  35.         Serial Number:
  36.             c9:46:33:18:b3:8d:33:d2
  37.         Validity
  38.             Not Before: Jul 14 03:17:09 2008 GMT
  39.             Not After : Jul 14 03:17:09 2011 GMT
  40.         Subject:
  41.             countryName               = CN
  42.             stateOrProvinceName       = GD
  43.             organizationName          = lanexpert
  44.             organizationalUnitName    = IT
  45.             commonName                = lingping
  46.             emailAddress              = [email]lpzeng@lanexpert.cn[/email]
  47.         X509v3 extensions:
  48.             X509v3 Subject Key Identifier:
  49.                 5F:5D:AB:C6:D1:8E:56:7E:01:24:12:16:70:3C:5F:F9:B2:FE:78:C7
  50.             X509v3 Authority Key Identifier:
  51.                 keyid:5F:5D:AB:C6:D1:8E:56:7E:01:24:12:16:70:3C:5F:F9:B2:FE:78:C7
  52.                 DirName:/C=CN/ST=GD/O=lanexpert/OU=IT/CN=lingping/emailAddress=lpzeng@lanexpert.cn
  53.                 serial:C9:46:33:18:B3:8D:33:D2

  54.             X509v3 Basic Constraints:
  55.                 CA:TRUE
  56. Certificate is to be certified until Jul 14 03:17:09 2011 GMT (1095 days)
复制代码


b.        Create an unpassworded private key for host mail.lanexpert.local and create an unsigned public key certificate.(官方原文,大意为创建一个没有密码的私有Key给主机和创建一个没有签名的公共Key证书)

  1. # openssl req -new -nodes -keyout lp-key.pem -out lp-req.pem -days 3650
  2. Generating a 1024 bit RSA private key
  3. .++++++
  4. ...........................++++++
  5. writing new private key to 'lp-key.pem'
  6. -----
  7. You are about to be asked to enter information that will be incorporated
  8. into your certificate request.
  9. What you are about to enter is what is called a Distinguished Name or a DN.
  10. There are quite a few fields but you can leave some blank
  11. For some fields there will be a default value,
  12. If you enter '.', the field will be left blank.
  13. -----
  14. Country Name (2 letter code) [AU]:CN
  15. State or Province Name (full name) [Some-State]:GD
  16. Locality Name (eg, city) []:DG
  17. Organization Name (eg, company) [Internet Widgits Pty Ltd]:lanexpert
  18. Organizational Unit Name (eg, section) []:IT
  19. Common Name (eg, YOUR name) []:lingping
  20. Email Address []:lpzeng@lanexpert.cn

  21. Please enter the following 'extra' attributes
  22. to be sent with your certificate request
  23. A challenge password []:123456
  24. An optional company name []:
复制代码


c.        Sign the public key certificate for host mail.lanexpert.local with the Certification Authority private key that we created a few steps ago.

  1. # openssl ca -out lp-cert.pem -infiles lp-req.pem
  2. Using configuration from /usr/local/ssl/openssl.cnf
  3. Enter pass phrase for ./demoCA/private/cakey.pem:
  4. Check that the request matches the signature
  5. Signature ok
  6. Certificate Details:
  7.         Serial Number:
  8.             c9:46:33:18:b3:8d:33:d3
  9.         Validity
  10.             Not Before: Jul 14 03:19:53 2008 GMT
  11.             Not After : Jul 14 03:19:53 2009 GMT
  12.         Subject:
  13.             countryName               = CN
  14.             stateOrProvinceName       = GD
  15.             organizationName          = lanexpert
  16.             organizationalUnitName    = IT
  17.             commonName                = lingping
  18.             emailAddress              = [email]lpzeng@lanexpert.cn[/email]
  19.         X509v3 extensions:
  20.             X509v3 Basic Constraints:
  21.                 CA:FALSE
  22.             Netscape Comment:
  23.                 OpenSSL Generated Certificate
  24.             X509v3 Subject Key Identifier:
  25.                 21:B8:4C:AB:8D:D6:E3:E8:E1:14:E4:50:8E:0B:AF:C7:0D:08:4C:86
  26.             X509v3 Authority Key Identifier:
  27.                 keyid:5F:5D:AB:C6:D1:8E:56:7E:01:24:12:16:70:3C:5F:F9:B2:FE:78:C7

  28. Certificate is to be certified until Jul 14 03:19:53 2009 GMT (365 days)
  29. Sign the certificate? [y/n]:y


  30. 1 out of 1 certificate requests certified, commit? [y/n]y
  31. Write out database with 1 new entries
  32. Data Base Updated
复制代码


d.        Install the host private key, the host public key certificate, and the Certification Authority certificate files. This requires super-user privileges.(官方原文)

为了管理方便,将以上创建的证书全部复制到/etc/postfix目录下,并设置相应的权限
  1. #cp demoCA/cacert.pem lp-key.pem lp-cert.pem /etc/postfix/
  2. #chmod 644 /etc/postfix/lp-cert.pem /etc/postfix/cacert.pem
  3. #chmod 400 /etc/postfix/lp-key.pem
复制代码


2.        修改Postfix配置文件,添加启用TLS选项

#nano /etc/postfix/main.cf
添加以下内容:
  1. # Smtp TLS config
  2. smtp_use_tls = yes
  3. smtp_tls_security_level  = may
  4. smtp_tls_session_cache_databases = btree:/var/lib/postfix/smtp_tls_session_cache
  5. smtpd_use_tls = yes
  6. smtp_tls_note_starttls_offer = yes
  7. smtpd_tls_key_file  = /etc/postfix/lp-key.pem     (注意路径是否正确)
  8. smtpd_tls_cert_file = /etc/postfix/lp-cert.pem    (注意路径是否正确)
  9. smtpd_tls_CAfile    = /etc/postfix/cacert.pem       (注意路径是否正确)
  10. smtpd_tls_loglevel  = 1
  11. smtpd_tls_received_header = yes
  12. smtpd_tls_session_cache_timeout = 3600s
  13. smtpd_tls_security_level = may
  14. smtpd_tls_session_cache_databases = btree:/var/lib/postfix/smtpd_tls_session_cache
  15. tls_random_source = dev:/dev/urandom
复制代码


#nano /etc/postfix/master.cf
启用以下选项:
  1. smtps     inet  n       -       n       -       -       smtpd
  2.   -o smtpd_tls_wrappermode=yes
  3.   -o smtpd_sasl_auth_enable=yes
复制代码

注意“-o”前面的空格

重新加载Postfix配置文件
  1. #postfix reload
复制代码


检查并测试TLS是否启动成功
Smtp默认SSL端口是465
  1. # netstat -tunlp |grep 465
  2. tcp        0      0 0.0.0.0:465                 0.0.0.0:*                   LISTEN      20559/master  
复制代码


#telnet localhost 25    #测试是否启动TLS加密
  1. Trying 127.0.0.1...
  2. Connected to localhost.localdomain (127.0.0.1).
  3. Escape character is '^]'.
  4. 220 Welcome to our mail.lanexpert.cn ESMTP,Warning:Version not Available!
  5. ehlo lanexpert.local
  6. 250-mail.lanexpert.local
  7. 250-PIPELINING
  8. 250-SIZE 14336000
  9. 250-VRFY
  10. 250-ETRN
  11. 250-STARTTLS      #多出一行
  12. 250-AUTH LOGIN PLAIN
  13. 250-AUTH=LOGIN PLAIN
  14. 250-ENHANCEDSTATUSCODES
  15. 250-8BITMIME
  16. 250 DSN
  17. Starttls        #手动输入
  18. 220 2.0.0 Ready to start TLS     #显示此字样为成功启用
  19. quit
  20. quit
  21. Connection closed by foreign host.
复制代码


在客户端(如Outlook)设置加密的smtp发信测试是否正常


经测试,使用加密后的smtp发送邮件是正常的。

配置文件部分参考资料:http://www.postfix.org/TLS_README.html
PS.开始时没有按照官方文档配置(参考此文档http://www.lihuawei.cn/FreeBSD/d ... 2_courier-imap.html),出现如下错误(未解决),后来按照官方文档重新配置,此问题解决:
Report:同样telnet localhost 25   ‘out’表示自动出现的,’In’表示手动输入的
  1. Out: 220 Welcome to our mail.lanexpert.cn ESMTP,Warning:Version not Available!
  2. In:  ehlo lanexpert.cn
  3. Out: 250-mail.lanexpert.local
  4. Out: 250-PIPELINING
  5. Out: 250-SIZE 14336000
  6. Out: 250-VRFY
  7. Out: 250-ETRN
  8. Out: 250-STARTTLS
  9. Out: 250-AUTH LOGIN PLAIN
  10. Out: 250-AUTH=LOGIN PLAIN
  11. Out: 250-ENHANCEDSTATUSCODES
  12. Out: 250-8BITMIME
  13. Out: 250 DSN
  14. In:  starttls
  15. Out: 454 4.7.0 TLS not available due to local problem
  16. In:  quit
  17. Out: 221 2.0.0 Bye
复制代码

[ 本帖最后由 zenglingping 于 2008-7-14 16:42 编辑 ]

论坛徽章:
0
703 [报告]
发表于 2008-07-14 16:45 |只看该作者
二十二、启用POP3及IMAP加密功能
[2008-7-14 updated]
1.设置POP3s  (Port:995)证书产生的配置文件

  1. # nano /usr/local/courier-imap/etc/pop3d.cnf
复制代码


根据自己的实据情况作出相应的修改:
  1. RANDFILE = /usr/local/courier-imap/share/pop3d.rand

  2. [ req ]
  3. default_bits = 1024
  4. encrypt_key = yes
  5. distinguished_name = req_dn
  6. x509_extensions = cert_type
  7. prompt = no

  8. [ req_dn ]
  9. C=CN      #国家代码
  10. ST=GD    #地域或省名称
  11. L=DG       #城市名称
  12. O=lanexpert    #组织名称
  13. OU=IT               #单位名称
  14. CN=localhost   
  15. emailAddress=lpzeng@lanexpert.cn      #管理邮件


  16. [ cert_type ]
  17. nsCertType = server
复制代码

2.设置IMAPs(Port:993)证书产生的配置文件

  1. # nano /usr/local/courier-imap/etc/imapd.cnf


  2. RANDFILE = /usr/local/courier-imap/share/imapd.rand

  3. [ req ]
  4. default_bits = 1024
  5. encrypt_key = yes
  6. distinguished_name = req_dn
  7. x509_extensions = cert_type
  8. prompt = no

  9. [ req_dn ]
  10. C=CN
  11. ST=GD
  12. L=DG
  13. O=lanexpert
  14. OU=IT
  15. CN=localhost
  16. emailAddress=lpzeng@lanexpert.cn


  17. [ cert_type ]
  18. nsCertType = server
复制代码

3.        运行以下命令生成安全登陆认证的金钥imapd.pem和pop3d.pem文件,存放于/usr/local/courier-imap/share/目录下

  1. #/usr/local/courier-imap/sbin/mkimapdcert
  2. #/usr/local/courier-imap/sbin/mkpop3dcert
复制代码


检查证书文件是否成功生成:
  1. # ll /usr/local/courier-imap/share/*.pem
  2. -rw------- 1 root root 1999 Jul 14 12:24 /usr/local/courier-imap/share/imapd.pem
  3. -rw------- 1 root root 2003 Jul 14 12:24 /usr/local/courier-imap/share/pop3d.pem
复制代码

4.        修改imapd-ssl及pop3d-ssl配置文件,启用imapd-ssl及pop3d-ssl

#nano /usr/local/courier-imap/etc/imapd-ssl
将 IMAPDSSLSTART=NO
改为:
  1. IMAPDSSLSTART=YES
复制代码

#nano /usr/local/courier-imap/etc/pop3d-ssl
将POP3_STARTTLS=NO
改为:
  1. POP3_STARTTLS=YES
复制代码


保存并退出,重启courier-imapd 服务
  1. service courier-imapd restart
复制代码

检查imapd-ssl及pop3d-ssl启动是否正常:
  1. # netstat -tunlp |grep :993
  2. tcp        0      0 0.0.0.0:993                 0.0.0.0:*                   LISTEN      21361/couriertcpd   

  3. # netstat -tunlp |grep :995
  4. tcp        0      0 0.0.0.0:995                 0.0.0.0:*                   LISTEN      21373/couriertcpd   
复制代码


从以上检查结果可知,993&995在正常监听状态中,基本上,imapd-ssl与pop3d-ssl正常启用并运行,以下在客户端(outlook)设置测试接收邮件是否正常:

Outlook POP3-ssl设置如下:



IMAP-ssl设置如下:


配置部分参考资料:http://www.lihuawei.cn/FreeBSD/d ... 2_courier-imap.html

经测试,以上配置OK,已成功启用IMAPs及POP3s.

论坛徽章:
0
704 [报告]
发表于 2008-07-14 16:57 |只看该作者

pop3d

Jul 14 16:04:07 weiguo pop3d: Connection, ip=[192.168.1.8]
Jul 14 16:04:07 weiguo authdaemond: received auth request, service=pop3, authtype=login
Jul 14 16:04:07 weiguo authdaemond: authmysql: trying this module
Jul 14 16:04:07 weiguo authdaemond: authmysqllib: connected. Versions: header 50045, client 50045, server 50045
Jul 14 16:04:07 weiguo authdaemond: SQL query: SELECT username, password, "", '1000', '1000', concat('/var/mailbox/',maildir), concat('/var/mailbox/',maildir), "", name, "" FROM mailbox WHERE username = 'weiguolau@weiguo.com'
Jul 14 16:04:07 weiguo authdaemond: password matches successfully
Jul 14 16:04:07 weiguo authdaemond: authmysql: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/var/mailbox/weiguo.com/weiguolau/Maildir/, address=weiguolau@weiguo.com, fullname=weiguolau, maildir=/var/mailbox/weiguo.com/weiguolau/Maildir/, quota=<null>, options=<null>
Jul 14 16:04:07 weiguo authdaemond: authmysql: clearpasswd=<null>, passwd=$1$YvUtyD8p$TIU4Gu3ngwazNz/LOZn1B0
Jul 14 16:04:07 weiguo authdaemond: Authenticated: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/var/mailbox/weiguo.com/weiguolau/Maildir/, address=weiguolau@weiguo.com, fullname=weiguolau, maildir=/var/mailbox/weiguo.com/weiguolau/Maildir/, quota=<null>, options=<null>
Jul 14 16:04:07 weiguo authdaemond: Authenticated: clearpasswd=weiguolau, passwd=$1$YvUtyD8p$TIU4Gu3ngwazNz/LOZn1B0
Jul 14 16:04:07 weiguo pop3d: LOGIN, user=weiguolau@weiguo.com, ip=[192.168.1.8], port=[1269]
Jul 14 16:04:07 weiguo pop3d: LOGOUT, user=weiguolau@weiguo.com, ip=[192.168.1.8], port=[1269], top=0, retr=0, rcvd=12, sent=39, time=0

[ 本帖最后由 Weikey 于 2008-7-14 17:05 编辑 ]

论坛徽章:
0
705 [报告]
发表于 2008-07-14 16:58 |只看该作者

pop3d-ssl

Jul 14 16:05:08 weiguo pop3d-ssl: Connection, ip=[192.168.1.8]
Jul 14 16:05:10 weiguo authdaemond: received auth request, service=pop3, authtype=login
Jul 14 16:05:10 weiguo authdaemond: authmysql: trying this module
Jul 14 16:05:10 weiguo authdaemond: authmysqllib: connected. Versions: header 50045, client 50045, server 50045
Jul 14 16:05:10 weiguo authdaemond: SQL query: SELECT username, password, "", '1000', '1000', concat('/var/mailbox/',maildir), concat('/var/mailbox/',maildir), "", name, "" FROM mailbox WHERE username = 'weiguolau@weiguo.com'
Jul 14 16:05:10 weiguo authdaemond: password matches successfully
Jul 14 16:05:10 weiguo pop3d-ssl: LOGIN, user=weiguolau@weiguo.com, ip=[192.168.1.8], port=[1276]
Jul 14 16:05:10 weiguo authdaemond: authmysql: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/var/mailbox/weiguo.com/weiguolau/Maildir/, address=weiguolau@weiguo.com, fullname=weiguolau, maildir=/var/mailbox/weiguo.com/weiguolau/Maildir/, quota=<null>, options=<null>
Jul 14 16:05:10 weiguo authdaemond: authmysql: clearpasswd=<null>, passwd=$1$YvUtyD8p$TIU4Gu3ngwazNz/LOZn1B0
Jul 14 16:05:10 weiguo authdaemond: Authenticated: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/var/mailbox/weiguo.com/weiguolau/Maildir/, address=weiguolau@weiguo.com, fullname=weiguolau, maildir=/var/mailbox/weiguo.com/weiguolau/Maildir/, quota=<null>, options=<null>
Jul 14 16:05:10 weiguo authdaemond: Authenticated: clearpasswd=weiguolau, passwd=$1$YvUtyD8p$TIU4Gu3ngwazNz/LOZn1B0
Jul 14 16:05:10 weiguo pop3d-ssl: LOGOUT, user=weiguolau@weiguo.com, ip=[192.168.1.8], port=[1276], top=0, retr=0, rcvd=12, sent=39, time=0

[ 本帖最后由 Weikey 于 2008-7-14 17:04 编辑 ]

论坛徽章:
0
706 [报告]
发表于 2008-07-14 17:06 |只看该作者
楼上的大哥太快了。。。。
我也正准备补充TLS相关的内容。。。。。
无巧不成拙阿。。。。。

论坛徽章:
0
707 [报告]
发表于 2008-07-14 17:09 |只看该作者

回复 #705 Weikey 的帖子

呵呵,我看了一下,你的配置有些不同,也可以共享一下呀。。。

  1. weiguo
复制代码

论坛徽章:
0
708 [报告]
发表于 2008-07-14 17:20 |只看该作者

启用TLS后发邮件日志文件

Jul 14 17:13:14 weiguo pop3d-ssl: Connection, ip=[192.168.1.8]
Jul 14 17:13:16 weiguo authdaemond: received auth request, service=pop3, authtype=login
Jul 14 17:13:16 weiguo authdaemond: authmysql: trying this module
Jul 14 17:13:16 weiguo authdaemond: authmysqllib: connected. Versions: header 50045, client 50045, server 50045
Jul 14 17:13:16 weiguo authdaemond: SQL query: SELECT username, password, "", '1000', '1000', concat('/var/mailbox/',maildir), concat('/var/mailbox/',maildir), "", name, "" FROM mailbox WHERE username = 'weiguolau@weiguo.com'
Jul 14 17:13:16 weiguo authdaemond: password matches successfully
Jul 14 17:13:16 weiguo authdaemond: authmysql: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/var/mailbox/weiguo.com/weiguolau/Maildir/, address=weiguolau@weiguo.com, fullname=weiguolau, maildir=/var/mailbox/weiguo.com/weiguolau/Maildir/, quota=<null>, options=<null>
Jul 14 17:13:16 weiguo authdaemond: authmysql: clearpasswd=<null>, passwd=$1$YvUtyD8p$TIU4Gu3ngwazNz/LOZn1B0
Jul 14 17:13:16 weiguo authdaemond: Authenticated: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/var/mailbox/weiguo.com/weiguolau/Maildir/, address=weiguolau@weiguo.com, fullname=weiguolau, maildir=/var/mailbox/weiguo.com/weiguolau/Maildir/, quota=<null>, options=<null>
Jul 14 17:13:16 weiguo authdaemond: Authenticated: clearpasswd=weiguolau, passwd=$1$YvUtyD8p$TIU4Gu3ngwazNz/LOZn1B0
Jul 14 17:13:16 weiguo pop3d-ssl: LOGIN, user=weiguolau@weiguo.com, ip=[192.168.1.8], port=[1297]
Jul 14 17:13:16 weiguo pop3d-ssl: LOGOUT, user=weiguolau@weiguo.com, ip=[192.168.1.8], port=[1297], top=0, retr=0, rcvd=12, sent=39, time=0
Jul 14 17:13:23 weiguo postfix/smtpd[6945]: connect from unknown[192.168.1.8]
Jul 14 17:13:23 weiguo authdaemond: received auth request, service=smtp, authtype=login
Jul 14 17:13:23 weiguo authdaemond: authmysql: trying this module
Jul 14 17:13:23 weiguo authdaemond: SQL query: SELECT username, password, "", '1000', '1000', concat('/var/mailbox/',maildir), concat('/var/mailbox/',maildir), "", name, "" FROM mailbox WHERE username = 'weiguolau@weiguo.com'
Jul 14 17:13:23 weiguo authdaemond: password matches successfully
Jul 14 17:13:23 weiguo authdaemond: authmysql: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/var/mailbox/weiguo.com/weiguolau/Maildir/, address=weiguolau@weiguo.com, fullname=weiguolau, maildir=/var/mailbox/weiguo.com/weiguolau/Maildir/, quota=<null>, options=<null>
Jul 14 17:13:23 weiguo authdaemond: authmysql: clearpasswd=<null>, passwd=$1$YvUtyD8p$TIU4Gu3ngwazNz/LOZn1B0
Jul 14 17:13:23 weiguo authdaemond: Authenticated: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/var/mailbox/weiguo.com/weiguolau/Maildir/, address=weiguolau@weiguo.com, fullname=weiguolau, maildir=/var/mailbox/weiguo.com/weiguolau/Maildir/, quota=<null>, options=<null>
Jul 14 17:13:23 weiguo authdaemond: Authenticated: clearpasswd=weiguolau, passwd=$1$YvUtyD8p$TIU4Gu3ngwazNz/LOZn1B0
Jul 14 17:13:23 weiguo postfix/smtpd[6945]: 6E33F217A7E: client=unknown[192.168.1.8], sasl_method=LOGIN, sasl_username=weiguolau@weiguo.com
Jul 14 17:13:23 weiguo postfix/cleanup[6953]: 6E33F217A7E: message-id=<000801c8e592$2265ec30$08a59384@cplkm20>
Jul 14 17:13:23 weiguo postfix/qmgr[6955]: 6E33F217A7E: from=<weiguolau@weiguo.com>, size=1424, nrcpt=1 (queue active)
Jul 14 17:13:23 weiguo postfix/smtpd[6945]: disconnect from unknown[192.168.1.8]
Jul 14 17:13:23 weiguo postfix/trivial-rewrite[6971]: warning: do not list domain weiguo.com in BOTH virtual_mailbox_domains and relay_domains
Jul 14 17:13:23 weiguo postfix/virtual[6956]: 6E33F217A7E: to=<hy_mis_liuwg@weiguo.com>, relay=virtual, delay=0.06, delays=0.05/0.01/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Jul 14 17:13:23 weiguo postfix/qmgr[6955]: 6E33F217A7E: removed
Jul 14 17:13:24 weiguo pop3d-ssl: Connection, ip=[192.168.1.8]
Jul 14 17:13:24 weiguo authdaemond: received auth request, service=pop3, authtype=login
Jul 14 17:13:24 weiguo authdaemond: authmysql: trying this module
Jul 14 17:13:24 weiguo authdaemond: SQL query: SELECT username, password, "", '1000', '1000', concat('/var/mailbox/',maildir), concat('/var/mailbox/',maildir), "", name, "" FROM mailbox WHERE username = 'weiguolau@weiguo.com'
Jul 14 17:13:24 weiguo authdaemond: password matches successfully
Jul 14 17:13:24 weiguo authdaemond: authmysql: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/var/mailbox/weiguo.com/weiguolau/Maildir/, address=weiguolau@weiguo.com, fullname=weiguolau, maildir=/var/mailbox/weiguo.com/weiguolau/Maildir/, quota=<null>, options=<null>
Jul 14 17:13:24 weiguo authdaemond: authmysql: clearpasswd=<null>, passwd=$1$YvUtyD8p$TIU4Gu3ngwazNz/LOZn1B0
Jul 14 17:13:24 weiguo authdaemond: Authenticated: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/var/mailbox/weiguo.com/weiguolau/Maildir/, address=weiguolau@weiguo.com, fullname=weiguolau, maildir=/var/mailbox/weiguo.com/weiguolau/Maildir/, quota=<null>, options=<null>
Jul 14 17:13:24 weiguo authdaemond: Authenticated: clearpasswd=weiguolau, passwd=$1$YvUtyD8p$TIU4Gu3ngwazNz/LOZn1B0
Jul 14 17:13:24 weiguo pop3d-ssl: LOGIN, user=weiguolau@weiguo.com, ip=[192.168.1.8], port=[1299]
Jul 14 17:13:24 weiguo pop3d-ssl: LOGOUT, user=weiguolau@weiguo.com, ip=[192.168.1.8], port=[1299], top=0, retr=0, rcvd=12, sent=39, time=0

[ 本帖最后由 Weikey 于 2008-7-17 14:50 编辑 ]

论坛徽章:
0
709 [报告]
发表于 2008-07-14 17:41 |只看该作者
原帖由 zenglingping 于 2008-7-14 17:09 发表
呵呵,我看了一下,你的配置有些不同,也可以共享一下呀。。。

weiguo


一、  sasl不同之处,多了几条:

--with-dbpath=/usr/local/BerkeleyDB \
--with-bdb-libdir=/usr/local/BerkeleyDB/lib \
--with-bdb-incdir=/usr/local/BerkeleyDB/include \


二、courier-authlib 在 $下编译 在#下安装
如此而已

论坛徽章:
0
710 [报告]
发表于 2008-07-14 17:43 |只看该作者
其实我都不知道 BerkeleyDB 在这个邮件系统里面扮演什么角色。。。
哈哈!不过,我在安装软件的时候,现会去看一下其配置参数,如果有关于 BerkeleyDB 我就会配置进去。。。。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP