一、邮件别名的功能:
1、相关文件:/etc/aliases
2、语法格式:
别名:真实账户1,真实账户2,……
当给别名发送邮件时,别名后面所列出的真实账户都可以收到该封邮件。 接我们前面的例子,假设我们写成这个样子:
My1: myuser1,myuser2,myuser3
那么当我们发信给my1@rhce.cn时,mytest1@rhce.cn,mytest2@rhce.cn,mytest3@rhce.cn都能够收到这个邮件。
3、别名库文件生成:
1)编辑/etc/aliases文件;
---------------------------------------------------------------------------
[root@rhel53 ~]# vim /etc/aliases
my1: mytest1,mytest2 //这一行为我们增加的内容。
----------------------------------------------------------------------------
2)执行newaliases生成别名库文件:
---------------------------------------------------------------------------
[root@rhel53 ~]# newaliases
/etc/aliases: 77 aliases, longest 15 bytes, 783 bytes total
----------------------------------------------------------------------------
4、测试别名功能:
1) 计算机中添加mytest1和mytest2两个账户,并修改它们的密码。
2) 通过邮件客户端配置好这两个账号,并按照前面文章的测试测试它们2个之间可以相互收发邮件。
-----------以上功能前文中已经测试,这里不再叙述了--------------
3)用mytest1账号给my1@rhce.cn发邮件看看谁能收到。
1、相关文件:/etc/mail/access /etc/mail/access.db
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
Connect:localhost.localdomain RELAY
Connect:localhost RELAY //上面两行,本域内机器可以实现转发
Connect:127.0.0.1 RELAY
//服务器所在的主机的用户可以任意发送邮件
heike.org REJECT 拒绝来自heike.org域的,提示端口错误
sendmail.org RELAY sendmail.org域的可以转发
my@sendmail.org OK 即使被其他规则给屏蔽了也仍然转发
spam@buyme.com DISCARD 收到邮件就销毁,不给转发,不给提示
192.168.20 REJECT 不给来自192.168.20网段的转发
192.168.10.100 REJECT 不给192.168.10.100这个IP的计算机转发
@buyme.com 550 You don't see the whole world! 凡是来自@buym.come的则提示550错误。
To:rhce.org RELAY 允许去向rhce.org的,但不允许来的。
From:rhce.net RELAY 允许rhce.net来的,但不允许去的。
3、练习建议:可写成如下样子,进行测试。
-----------------------------------------------------------------------------------
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
Connect:192.168.10 RELAY
Connect:192.168.10.100 REJECT
Connect:mytest1@rhce.cn OK
1、调整系统时间,确定正确的系统时间和日期。
2、删除系统中的原有证书和密钥文件:
-----------------------------------------------------------------------------------
/etc/pki/dovecot/certs/dovecot.pem
/etc/pki/dovecot/private/dovecot.pem
[root@rhel53 mail]# rm /etc/pki/dovecot/certs/dovecot.pem
rm: remove regular file `/etc/pki/dovecot/certs/dovecot.pem'? y
[root@rhel53 mail]# rm /etc/pki/dovecot/private/dovecot.pem
rm: remove regular file `/etc/pki/dovecot/private/dovecot.pem'? y
make: Entering directory `/etc/pki/tls/certs'
umask 77 ; \
PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
/usr/bin/openssl req -utf8 -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 -set_serial 0 ; \
cat $PEM1 > dovecot.pem ; \
echo "" >> dovecot.pem ; \
cat $PEM2 >> dovecot.pem ; \
rm -f $PEM1 $PEM2
Generating a 1024 bit RSA private key
.......++++++
writing new private key to '/tmp/openssl.R13059'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:GB
State or Province Name (full name) [Berkshire]:JIANGSU
Locality Name (eg, city) [Newbury]:XUZHOU
Organization Name (eg, company) [My Company Ltd]:QINGNIAO
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:mail.rhce.cn
Email Address []:root@mail.rhce.cn
make: Leaving directory `/etc/pki/tls/certs'
-------------------------------------------------------------------------------------
protocols = imaps pop3s //这行修改成这个样子
ssl_cert_file = /etc/pki/tls/certs/dovecot.pem
ssl_key_file = /etc/pki/tls/certs/dovecot.pem //这两行前的#去掉,修改路径和建立证书处的蓝色文字的路径相同。
[root@rhel53 ~]# echo "this is a test" |mail -s test mytest1
上面这条命令打过以后等几秒钟再向下执行。不要拿root测试,会报错。
[root@rhel53 ~]# mutt -f imaps://mytest1@mail.rhce.cn //没有mutt用yum安装 : yum install mutt* -y
下面我们通过邮件客户端Foxmail测试POP3S:(outlook不知道怎么设置,测试老出错)
1)配置账户: