?????????????/h2>
????????????????????????????????????????????????????????????????????????????????
- MTA??ail Transfer Agent???????????????????????????????????? SMTP ?????FC 5321??????????????????????? MTA ?????? Postfix??xim??endmail ????/li>
- MDA??ail Delivery Agent???????????????????????????????????????????????????MTA ????????ovecot ??LDA/LMTP??rocmail ?????? MDA??/li>
- MUA??ail User Agent??????????????????????????????????????? IMAP??FC 9051??? POP3??FC 1939???????????????????? Outlook??hunderbird??oxmail ????/li>
????????TA ?????????????"?????????????????DA ???????"??????????????????????MUA ????????????????????"??
???????????????
?????????????????????????????????????????????????????????????????
- Postfix????????????????MTA??????????????????????????????????? Linux ???????????????????? Dovecot ???????????????????????"??/li>
- Exim???????????????MTA??? Debian ??????????????????????????????????????????????/li>
- Microsoft Exchange???????????????????????Windows ????? Active Directory?????????????????????????/li>
- ??????????????/strong>??? TurboEx/??????????????????????????????????????????????????????????????????????????????????????????????????/li>
??????????????
???????????????????????????????????????????????????????????????????????????????????????????????????
| ?????? | ??????????br>(Postfix+Dovecot) | ????????? (TurboEx/???) |
????????br>(???/???/???) |
|---|---|---|---|
| ?????? | ????? Linux ????????????????????/td> | ?????????????????????????? | ??????????????? |
| ?????? | ?????????????????????????? | ????????????????????/td> | ?????????????????SLA |
| ?????/strong> | ?????????????????????????? | ??????????????? DLP/???/??? | ??????????????????????/td> |
| ???????? | ???????????????????/td> | ??????????????UOS/???/????????/td> | ?????/td> |
| ?????/strong> | ??????????????? | ??????????????????????????/td> | ??????????????? |
????????/strong>????????? Linux ??????????????????Postfix + Dovecot ?????????????????????????????????????????????????????????????????TurboEx/?????????????????????????????????????????????????????????????????????
??????????????/h3>
??????????????????TurboEx ????????????????????/strong>????????????????????????????
- ???????????SPF/DKIM/DMARC ??????????????? DNS ??????
- ????????????99.5% ???????????????
- ????????????????????/???/????????????/??? UOS ??????
- ??? 6000+ ?????????????????????????????
- ?????????Webmail??indows/macOS ??????????OS/Android/??? APP
???????????????
????????Postfix + Dovecot ??Ubuntu/CentOS ??????????????????????????DNS ???????????????????
1 ?????DNS ???
????????????????????????????????DNS ?????????????????? example.com??????????????? mail.example.com??/p>
- A ??????
mail.example.com???????????? IP ??? - MX ????????
example.com??MX ??????mail.example.com????????? 10 - PTR ????????????????????????????????????????????? IP ????????????
mail.example.com??????????????????????????????
?????/strong>??????????????? 25 ?????????????????????????????????????????????????SMTP 25 ????????? 587??ubmission?????????????
2 ???????????/h3>
??Ubuntu 22.04 LTS ????????????????????????
# ??????
sudo apt update && sudo apt upgrade -y
# ????????sudo hostnamectl set-hostname mail.example.com
# ????????hostname -f
3 Postfix ????????????SMTP??/h3>
# ??? Postfix
sudo apt install postfix -y
# ??????????? "Internet Site"
# System mail name ???: example.com
# ??? Postfix
sudo apt install postfix -y
# ??????????? "Internet Site"
# System mail name ???: example.com??? Postfix ????????/etc/postfix/main.cf???????????/p>
# ??????
myhostname = mail.example.com
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 127.0.0.0/8
# TLS ????????? 5??smtpd_tls_cert_file = /etc/letsencrypt/live/mail.example.com/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.example.com/privkey.pem
smtpd_use_tls = yes
# ?????????
home_mailbox = Maildir/
???????????Postfix??/p>
sudo systemctl restart postfix
sudo systemctl enable postfix
4 Dovecot ?????????IMAP/POP3??/h3>
# ??? Dovecot
sudo apt install dovecot-core dovecot-imapd dovecot-pop3d -y
# ??? Dovecot
sudo apt install dovecot-core dovecot-imapd dovecot-pop3d -y??? Dovecot ?????? /etc/dovecot/dovecot.conf??/p>
protocols = imap pop3 lmtp
listen = *
mail_location = maildir:~/Maildir
??? IMAP ??POP3 ??TLS ?????code>/etc/dovecot/conf.d/10-ssl.conf???
ssl = required
ssl_cert = </etc/letsencrypt/live/mail.example.com/fullchain.pem
ssl_key = </etc/letsencrypt/live/mail.example.com/privkey.pem
??? Dovecot??/p>
sudo systemctl restart dovecot
sudo systemctl enable dovecot
5 SSL/TLS ??????
??? Let's Encrypt ?????????????????? TLS ?????/p>
# ??? Certbot
sudo apt install certbot -y
# ???????????80 ?????????
sudo certbot certonly --standalone -d mail.example.com
# ?????????
sudo crontab -e
# ????? 3 * * * certbot renew --quiet --post-hook "systemctl restart postfix dovecot"
6 SPF/DKIM/DMARC ??????
????????????????????????????????????????/p>
- SPF??ender Policy Framework??/strong>??? DNS ?????TXT ??????????????????????????????????/li>
# DNS TXT ???????????mail.example.com ???????????????
example.com TXT "v=spf1 mx a:mail.example.com ip4:203.0.113.0/24 ~all"
- DKIM??omainKeys Identified Mail??/strong>?????????????????????????????????????????????????/li>
# ??? OpenDKIM
sudo apt install opendkim opendkim-tools -y
# ??? DKIM ???
sudo opendkim-genkey -s default -d example.com
# ??????????????DNS TXT ???
default._domainkey.example.com TXT "v=DKIM1; k=rsa; p=..."
- DMARC??omain-based Message Authentication, Reporting & Conformance??/strong>???????????????????? SPF/DKIM ??????????/li>
# DNS TXT ??????
_dmarc.example.com TXT "v=DMARC1; p=quarantine; rua=mailto:postmaster@example.com; pct=100"
7 ????????/h3>
???????????????????????????????????????
- ???????????/strong>???
mail??sendmail?????????????/li>- MX ???????????
dig example.com MX??? MX ?????????- SPF/DKIM/DMARC ???????? MXToolbox ??Mail Tester ?????????
- ??????????
telnet mail.example.com 25/telnet mail.example.com 587- ???????????/strong>??Gmail/Outlook ???????????????????????????????/li>
- MX ???????????
??????????????/h2>
??????????????/h3>
??????????????????????????????????/p>
| ??? | ??? | ????/th> | ??? |
|---|---|---|---|
| SMTP | 25 | ??????????????TA??TA??/td> | STARTTLS?????? |
| SMTP Submission | 587 | ?????????????????/td> | STARTTLS?????? |
| SMTPS | 465 | ?????????????????? | SSL/TLS?????? |
| IMAP | 143 | ???????????/td> | STARTTLS?????? |
| IMAPS | 993 | ?????????????????/td> | SSL/TLS?????? |
| POP3 | 110 | ???????????/td> | STARTTLS?????? |
| POP3S | 995 | ?????????????????/td> | SSL/TLS?????? |
??????????????????????587??MTP Submission????93??MAPS??? 995??OP3S??????????????5 ??????????????????????????? MTA ????????????????????
???????????/h3>
????????????????????????????????????????????????????/p>
- Rspamd???????????????????????????????????????????NS ??????DNSBL????PF/DKIM/DMARC ??????????????????????????????/li>
- SpamAssassin????????????????????????????????????????????????/li>
# ??? Rspamd
sudo apt install rspamd -y
# ?????Postfix??etc/postfix/main.cf ?????smtpd_milters = inet:127.0.0.1:11332
milter_default_action = accept
milter_protocol = 6
??????????????/h3>
- ????????/strong>Postfix ?????
/var/log/mail.log??ovecot ?????/var/log/dovecot.log
- ????????/strong>
mailq ??????????????????postqueue -f ?????????
- ????????/strong>???????????????????????????????????
- ????????/strong>???????
/var/log/auth.log ??? SASL ?????????????????/li>
/var/log/mail.log??ovecot ?????/var/log/dovecot.logmailq ??????????????????postqueue -f ?????????/var/log/auth.log ??? SASL ?????????????????/li>
??????
??????????????iPhone ??????
iPhone ???????????????????????????????????????????????????
- SSL/TLS ????????/strong>???????????????????????SSL ?????? Let's Encrypt???iPhone ?????iOS ??????????????????????????????????? iPhone ??????????????/li>
- ???????????/strong>iPhone ??????????????? IMAP ??? 993??SL???????????SMTP ??? 587??TARTTLS??? 465??SL????/li>
- ???????????/strong>??? iPhone ????????????????SSL ?????CN/SAN ?????????/li>
- ??????????????????????????????993 ??587/465 ?????/li>
- ???????????/strong>??????????????????????????????????????????SMTP ?????/li>
- ???????????/strong>iPhone ??????????????? IMAP ??? 993??SL???????????SMTP ??? 587??TARTTLS??? 465??SL????/li>
?????????????????
????????????????????
- ?????? MX ????????/strong>?????????
dig example.com MX??? MXToolbox ???????????/li>- ??????????????????????/strong>???????????
smtp.exmail.qq.com/imap.exmail.qq.com????????????smtp.mxhichina.com/imap.mxhichina.com??/li>- ??????????????????????MX ?????????????????
mail.example.com??/li> - ??????????????????????/strong>???????????
??? vs ?????????????????/h3>
??????????????????
- ????????/strong>??? Linux ??????????????????????????????????????????????????????????????????????????????/li>
- ??????????????/strong>??????????????????????????????????????? SLA ?????????????/li>
????????????????????/h3>
?????????????????????????????
- ???????????????????G?????? ?100~500/????????????????????5,000~20,000
- ????????/strong>???50~100/??/li>
- SSL ?????/strong>Let's Encrypt ????????????500~5,000/??/li>
- ????????Postfix+Dovecot???????????????????????????
- ????????? TurboEx/???????????????????????????????????????????????????????????/li>
- SSL ?????/strong>Let's Encrypt ????????????500~5,000/??/li>
📥 30 ????????TurboEx ??????
SPF/DKIM/DMARC ?????????????????????????????????/p> ??????
