POSTFIX

##1.服务器配置:(限制规则是按照查询的顺序进行的,第一条符合条件的规则被执行)

 

    客户端主机名/地址限制 :

    smtpd_client_restrictions =

    check_client_access hash:/etc/postfix/access,

    permit_mynetworks,reject_maps_rbl (permit_mynetworks:如果客户端的ip地址符合$mynetworks参数定义的范围则接受该客户端的连接请求;reject_maps_rbl:如果客户端的网络地址符合$maps_rbl_domains参数的值则拒绝

    该客户端的连接请求)

    vim access:

        192.168.0.4REJECT

        192.168.0REJECT

    postmap access

    /etc/init.d/postfix restart

 

实例:

westos.westos.com端:

    vim access:

        172.25.254.113  REJECT

    postmapaccess

    postconf -d |grep client

    postconf -e "smtpd_client_restrictions = check_client_access hash:/etc/postfix/access"

    systemctl restart postfix.service


linux.linux.com端:

    telnet 172.25.254.213 25

SMTP(2)

 

 

 

通过发件人地址进行限制 :

smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/

sender

vim /etc/postfix/sender:

    [email protected] REJECT(OK、RELAY)

postmap sender

 


实例:

westos.westos.com端:

vim sender

    [email protected] REJECT

postmap sender

postconf -d | grep sender

 postconf -e "smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender"

systemctl restart postfix.service


linux.linux.com端:

    telnet 172.25.254.213 25

SMTP(2)

 

通过收件人地址进行过滤 :

smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recipient, permit_mynetworks,

reject_unauth_destination(reject_unauth_destination:不管客户端的主机名,只

要符合以下的条件, 就拒绝该客户端SMTP连接请求:

* 解析后的目标地址符合$relay_domains及其子域

* 解析后的目标地址符合$inet_interfaces、$mydestination或$virtual_maps )

vi /etc/postfix/recipient:

[email protected]

DISCARDED

postmap recipient

 

实例:

westos.westos.com端:

vim recip

    [email protected]REJECT

 postmap recip

postconf -d | grep recip

postconf -e "smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recip"

systemctl restart postfix.service


 

linux.linux.com端:

telnet 172.25.254.213 25

SMTP(2)

 


 

 

 

 

豆腐块(dovecot)

##1.mutt的创建与使用

westos.westos.com端:

    yum install dovecot -y

    cd /etc/dovecot/

    vim dovecot.conf

         24 protocols = imap pop3 lmtp

        49 disable_plaintext_auth = no

    

[[email protected] conf.d]# vim 10-mail.conf

    30 mail_location =  mbox:~/mail:INBOX=/var/mail/%u

 

SMTP(2)

 

[[email protected] skel]# mkdir mail/.imap/ -p

[[email protected] skel]# touch mail/.imap/INBOX

[[email protected] dovecot]# useradd lee

[[email protected] dovecot]# passwd lee

##先创建目录后建立的新用户会自动生成该文件,不必切换到该用户再自行创建

 


linux.linux.com端:

yum install mutt -y

SMTP(2)

SMTP(2)


 

 

 

##2.雷鸟的创建与使用

 

 

westos.westos.com端;

    [[email protected] dovecot]# vim /etc/dovecot/dovecot.conf

        49 login_trusted_networks = 0.0.0.0/0

    [[email protected] dovecot]# systemctl restart dovecot.service

     

 

linux.linux.com端:

    [[email protected] postfix]# cd /mnt/

    [[email protected] mnt]# ls

    thunderbird-45.5.1.tar.bz2

    [[email protected] mnt]# tar jxf thunderbird-45.5.1.tar.bz2

    [[email protected] mnt]# cd thunderbird/

    [[email protected] thunderbird]# ./thunderbird

SMTP(2)