码迷,mamicode.com
首页 > 其他好文 > 详细

smpt协议(一)

时间:2016-12-02 04:01:46      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:邮件传输   远程邮件发送   

####smtp 协议####
smtp协议就是简单邮件传输。
(1)首先做好dns解析
vim /etc/named.conf
//      listen-on port 53 { 127.0.0.1; };
//      listen-on-v6 port 53 { ::1; };
//      allow-query     { localhost; };
dnssec-validation no;
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; };
};


vim westos.com.zone
$TTL 1D
@       IN SOA  dns.westos.com. root.westos.com. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      dns.westos.com.
dns     A       172.25.254.109
westos.com. MX 1 172.25.254.109.
vim linux.com.zone
$TTL 1D
@       IN SOA  dns.linux.com. root.linux.com. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      dns.linux.com.
dns     A       172.25.254.109
linux.com. MX 1  172.25.254.209.
vim /etc/postfix/main.cf
75 myhostname = maillinux.linux.com
83 mydomain = linux.com
99 myorigin = $mydomain
113 inet_interfaces = all
116 #inet_interfaces = localhost
164 mydestination = $myhostname,$mydomain, localhost
systemctl restart postfix.service

(2)出站地址伪装
cd /etc/postfix/
vim generic
root@westos.com xxxxxxxx@qq.com
   ||                ||
真实地址           假地址
postmap generic
postconf -d | grep generic
postconf -e "smtp_generic_maps =hash:/etc/postfix/generic"
systemctl restart postfix.service


(3)远程邮件发送
yum install telnet -y       ##安装
telnet 172.25.254.109 25
[root@foundation9 ~]# telnet 172.25.254.109 25
Trying 172.25.254.109...
Connected to 172.25.254.109.
Escape character is ‘^]‘.
220 mailwestos.westos.com ESMTP Postfix
ehlo hello                
250-mailwestos.westos.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from
501 5.5.4 Syntax: MAIL FROM:<address>
mail from:root@westos.com
250 2.1.0 Ok
rcpt to:root@linux.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
afsa
dsd
sdw
sws
.
250 2.0.0 Ok: queued as 830D917E861
quit
221 2.0.0 Bye
Connection closed by foreign host.
##在邮件发送中"."表示结束。



smpt协议(一)

标签:邮件传输   远程邮件发送   

原文地址:http://12183531.blog.51cto.com/12173531/1878575

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!