你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux学习之邮件服务器

[日期:2014-04-10] 来源:Linux社区  作者:Linux_Near [字体:大 中 小]

使用雷鸟客户端

在客户端安装thunderbird-17.0.2-1.el6.remi.x86_64

设置账户就好了

服务器

[root@mail ~]# vim /etc/postfix/main.cf

inet_interfaces = all

 

 


为使功能健全,在/etc/rc.local 添加

[root@localhost File-Tail-0.99.3]# vi /etc/rc.local

/var/www/extsuite/extman/daemon/cmdserver &

/usr/local/mailgraph_ext/mailgraph-init start

[root@localhost ~]# chkconfig httpd on

[root@localhost ~]# chkconfig mysqld on

[root@mail ~]# chkconfig dovecot on

 

第二个周

1、postfix升级

[root@mail postfix-2.11.0]# /etc/init.d/postfix stop

[root@mail postfix-2.11.0]# yum install -y cyrus-sasl-*

[root@mail postfix-2.11.0]# yum install openssl-devel.x86_64 -y

[root@mail postfix-2.11.0]# yum install mysql-devel.x86_64 -y

[root@mail postfix-2.11.0]# yum install db4-devel-4.7.25-17.el6.x86_64 -y

 

[root@mail postfix-2.11.0]# make tidy

[root@mail postfix-2.11.0]# make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DUSE_TLS' 'AUXLIBS=-L/usr/lib64/mysql/ -lmysqlclient -lz -lm -L/usr/lib64 -lsasl2 -lssl -lcrypto'

[root@mail postfix-2.11.0]# make upgrade

[root@mail ~]# postconf mail_version

mail_version = 2.11.0查看版本

[root@mail certs]# postconf -A

cyrus

[root@mail certs]# postconf -a

cyrus

dovecot

带上mysql

[root@mail certs]# postconf -m

 

 


2、发信身份验证,使用统一密码

[root@mail ~]# yum localinstall -y cyrus-sasl-sql-2.1.23-13.el6.x86_64.rpm 注意版本

yum localinstall cyrus-sasl-sql-2.1.23-13.el6_3.1.x86_64.rpm

 

[root@mail sasl2]# vim /etc/sasl2/smtpd.conf

pwcheck_method: auxprop

auxprop_plugin: sql

mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5 NTLM

sql_engine: mysql

sql_hostnames: 127.0.0.1

sql_user: extmail

sql_passwd: extmail

sql_database: extmail

sql_select: SELECT password FROM mailbox WHERE username = '%u@%r'

 

[root@mail sasl2]# postconf -e smtpd_sasl_auth_enable=yes

[root@mail sasl2]# postfix reload

 

[root@mail sasl2]# perl -MMIME::Base64 -e 'print encode_base64("\0weifang\@extmail.org\0weifang");'

AHdlaWZhbmdAZXh0bWFpbC5vcmcAd2VpZmFuZw==

[root@mail sasl2]# telnet localhost 25

ehlo mail.extmail.org

auth plain AHdlaWZhbmdAZXh0bWFpbC5vcmcAd2VpZmFuZw==

 

使用雷鸟outgoing server

编辑

connection none

authentication password,transmitted insecurely

username weifang@extmail.org

之后,用户weifang@extmail.org发送邮件就会进行身份验证

登录需要身份验证,发信也需要验证身份,防止身份伪造或者非邮箱本人发信

3、加密发送

[root@mail sasl2]# postconf -e smtpd_tls_auth_only=yes

[root@mail sasl2]# postfix reload

[root@mail sasl2]# telnet localhost 25

ehlo localhost

没有这个250-AUTH LOGIN CRAM-MD5 DIGEST-MD5 PLAIN

改成no,就会有250-AUTH LOGIN CRAM-MD5 DIGEST-MD5 PLAIN

 

[root@mail certs]# postconf -e smtpd_tls_auth_only=no

[root@mail sasl2]# postconf -e smtpd_tls_security_level=may可以不加密发送

就会多一条这个,表示开启TLS加密

250-STARTTLS

 

生成加密验证文件

[root@mail sasl2]# cd /etc/pki/tls/certs/

[root@mail certs]# make postfix.pem

Country Name (2 letter code) [XX]:CN

State or Province Name (full name) []:shaanxi

Locality Name (eg, city) [Default City]:xi'an

Organization Name (eg, company) [Default Company Ltd]:westos

Organizational Unit Name (eg, section) []:LINUX

Common Name (eg, your name or your server's hostname) []:mail.extmail.org

Email Address []:root@example.com

 

[root@mail certs]# cp postfix.pem /etc/postfix/

[root@mail certs]# postconf -d | grep ^smtpd_tls

[root@mail certs]# postconf -e smtpd_tls_cert_file=/etc/postfix/postfix.pem

[root@mail certs]# postconf -e 'smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache'

 

[root@mail certs]# postconf -n加上这四条

smtpd_tls_auth_only = no

smtpd_tls_cert_file = /etc/postfix/postfix.pem

smtpd_tls_security_level = may

smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache

这时,雷鸟设置outgoing为

连接加密 connection STARTTLS 使用加密或者none不使用加密都可以正常发送

认证方法 authentication normal password

用户信息 username weifang@extmail.org

weifang发送邮件的话,需要确认网络环境安全,并得到验证文件,可以发送

修改为强制加密

[root@mail certs]# postconf -e smtpd_tls_security_level=encrypt

[root@mail certs]# postconf -e smtpd_tls_auth_only=yes

[root@mail certs]# postfix reload

如果不使用加密,就不能发送,这样就保证了安全

连接加密 connection STARTTLS 使用加密

认证方法 authentication normal password

用户信息 username weifang@extmail.org

linux
相关资讯       Linux邮件服务器 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款