一.邮件服务器基本概念:
1.邮件传输协议
SMTP:Simple Mail Transfer Protocol
POP3:Post Office Protocol
IMAP4:Internet Mail Access Protocol
2.smtpd监听(25/tcp)
3.SASL:Simple Authentication Secure Layer
cyrus-sasl
courier-authlib
4.MDA:邮件投递代理,MDA是挂在MUA下的一个小功能,它的主要功能是分析邮件的表头,决定邮件去向
procmail,maildrop
5.MUA:邮件用户代理,即邮件客户端软件,如Windows的Outlook,客户通过它来浏览、写和收邮件
mutt(文本界面),mail,thunderbird,evolution
6.MTA:邮件传输代理,当你在MUA(如outlook)上点发邮件时,其实它是把邮件发到MTA(如SendMail, Postfix),通过MTA实现发邮件的功能
sendmail,qmai,postfix,exim
7.MRA:邮件检索代理(pop3,imap4),MUA向MRA发送请求接收邮件
cyrus-imap
dovecot
二.简单邮件发送过程
1.客户端向服务端发送hello信息来建立连接
helo(smtp协议)
ehlo(esmtp协议)
2.客户端向服务器发送发件人信息
mail from
3.客户端向服务器端发送收件人信息
rcpt to
4.客户端向服务器端发送邮件主体
data:以点号(.)结束
实例:通过telnet发送邮件
[root@localhost ~]# telnet localhost 25Trying ::1...telnet: connect to address ::1: Connection refusedTrying 127.0.0.1...Connected to localhost.Escape character is '^]'.220 localhost.localdomain ESMTP Postfixhelo localhost250 localhost.localdomainmail from:root250 2.1.0 Okrcpt to:apache250 2.1.5 Okdata354 End data with. hello.250 2.0.0 Ok: queued as 75749279quit221 2.0.0 ByeConnection closed by foreign host.You have mail in /var/spool/mail/root[root@localhost ~]#