1.desktop操作:

vim /etc/named.rfc1912.zones

  zone "westos.com" IN {

         type master;

         file "westos.com.zone";

        allow-update { none; };

  };

  zone "linux.com" IN {

          type master;

         file "linux.com.zone";

         allow-update { none; };

  };


cp -p named.localhost westos.com.zone

vim /var/named/westos.com.zone 


SMTP简单邮件协议的服务配置_master


cp -p westos.com.zone linux.com.zone

vim /var/named/linux.com.zone 

SMTP简单邮件协议的服务配置_file_02

systemctl restart named

systemctl stop firewalld


vim /etc/postfix/main.cf 

SMTP简单邮件协议的服务配置_master_03

SMTP简单邮件协议的服务配置_master_04

SMTP简单邮件协议的服务配置_file_05

SMTP简单邮件协议的服务配置_master_06

2.server操作:

    

SMTP简单邮件协议的服务配置_master_07

SMTP简单邮件协议的服务配置_master_08

SMTP简单邮件协议的服务配置_master_09

SMTP简单邮件协议的服务配置_master_10

3.别名发送:

要求:

desktop(linux.com) 主机向 server(westos.com)主机发送邮件,使用别名发送:mail lzt@westos.com (server主机里没有lzt用户)

vim /etc/aliases

SMTP简单邮件协议的服务配置_file_11


    vim /etc/moreusers 

        root

        student



 postalias /etc/aliases

 systemctl restart postfix.service 



4.出站地址伪装

server (westos.com)主机:

vim /etc/postfix/generic 

SMTP简单邮件协议的服务配置_file_12

postmap /etc/postfix/generic

postconf -d | grep generic 会出来一段字符,选择最后的一行字符(如下),进行复制:

smtp_generic_maps =

postconf -e "smtp_generic_maps = hash:/etc/postfix/generic" ##此处用到上条语句复制的字符

systemctl restart postfix.servic





5.检测25端口

软件下载 yum install telnet -y

SMTP简单邮件协议的服务配置_master_13

SMTP简单邮件协议的服务配置_master_14

250 2.0.0 Ok: queued as 38E0C17E849

quit ##退出telnet

221 2.0.0 Bye

Connection closed by foreign host.