一.郵件服務器基本概念:
apache
1.郵件傳輸協議bash
SMTP:Simple Mail Transfer Protocol服務器
POP3:Post Office Protocoldom
IMAP4:Internet Mail Access Protocoltcp
2.smtpd監聽(25/tcp)ide
3.SASL:Simple Authentication Secure Layerpost
cyrus-saslui
courier-authlib代理
4.MDA:郵件投遞代理,MDA是掛在MUA下的一個小功能,它的主要功能是分析郵件的表頭,決定郵件去向it
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 25 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 localhost.localdomain ESMTP Postfix helo localhost 250 localhost.localdomain mail from:root 250 2.1.0 Ok rcpt to:apache 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> hello . 250 2.0.0 Ok: queued as 75749279 quit 221 2.0.0 Bye Connection closed by foreign host. You have mail in /var/spool/mail/root [root@localhost ~]#