Centos7 配置 sendmail、postfix 端口號25、465

阿里雲、騰訊雲的操作系統 CentOS 6.x 和 CentOS 7.x 安裝 sendmail、postfix 發送郵件時,會遇到無法使用25端口號發送郵件的問題。

本文分享米撲博客折騰了幾天的研究成果,全面詳細討論各種正常和異常場景,您遇到的坑我們可能全部都踩過,並給出解決方案。米撲博客原文:Centos7 配置 sendmail、postfix 端口號25、465

 

閱讀本文前,推薦最好先閱讀米撲博客先前的兩篇博客:

Centos7 使用 sendmail 發送郵件

POP3、SMTP、IMAP 的作用和聯繫

 

在討論之前,先介紹發送郵件的幾個場景:

1)本地發送郵件,是指安裝完sendmail後,直接由本機發送郵件(小白級)

2)smtp發送郵件,包含設置163、qq等smtp 25、smtps 465 等端口轉發(中級)

3)第三方郵件軟件方式,如使用 Ubuntu heirloom-mailx、NodeJS NodemailersendEmail 等轉發郵件(高級)

4)使用 nginx 代理方式,把端口號25 做轉發(專家級)

 

 

一、本地發送郵件(小白級)

本地發送郵件,一般是安裝完 sendmail、mailx 後,什麼都不配置,就直接發送郵件,因此默認是由本機發送郵件

yum -y install sendmail* mailx

本地發送郵件命令:

mail -v -s "subject_title" [email protected] < /etc/passwd

1、本地發送郵件的正常日誌(2016年9月前購買的阿里雲,CentOS 6.5)

mail -v -s "subject_title" [email protected] < /etc/passwd

# mail -v -s "subject_title" [email protected] < /etc/passwd
Loading lookup modules from /usr/lib64/exim/4.72-7.el6/lookups
Loaded 0 lookup modules
LOG: MAIN
  <= root@mimvp-bj U=root P=local S=2075
[root@mimvp-bj ~]# Loading lookup modules from /usr/lib64/exim/4.72-7.el6/lookups
Loaded 0 lookup modules
delivering 1fkiJu-0000Zc-C5
Connecting to mxbiz1.qq.com [163.177.89.176]:25 ... connected
  SMTP<< 220 bizmx17.qq.com MX QQ Mail Server
  SMTP>> EHLO mimvp-bj
  SMTP<< 250-bizmx17.qq.com
         250-SIZE 73400320
         250-STARTTLS
         250 OK
  SMTP>> STARTTLS
  SMTP<< 220 Ready to start TLS
  SMTP>> EHLO mimvp-bj
  SMTP<< 250-bizmx17.qq.com
         250-SIZE 73400320
         250 OK
  SMTP>> MAIL FROM:<root@mimvp-bj> SIZE=3147
  SMTP<< 250 Ok
  SMTP>> RCPT TO:<[email protected]>
  SMTP<< 250 Ok
  SMTP>> DATA
  SMTP<< 354 End data with <CR><LF>.<CR><LF>
  SMTP>> writing message and terminating "."
  SMTP<< 250 Ok: queued as
  SMTP>> QUIT
LOG: MAIN
  => [email protected] R=dnslookup T=remote_smtp H=mxbiz1.qq.com [163.177.89.176] X=UNKNOWN:AES128-SHA256:128
LOG: MAIN
  Completed

成功接收郵件的結果:

 

2、本地發送郵件的錯誤日誌(2016年9月後購買的阿里雲,CentOS 7.5)

mail -v -s "subject_title" [email protected] < /etc/passwd

# mail -v -s "subject_title" [email protected] < /etc/passwd
[email protected]... Connecting to [127.0.0.1] via relay...
220 mimvp-sz2.com ESMTP Sendmail 8.14.7/8.14.7; Wed, 1 Aug 2018 12:05:19 +0800
>>> EHLO mimvp.com
250-mimvp-sz2.com Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<[email protected]> SIZE=1795
250 2.1.0 <[email protected]>... Sender ok
>>> RCPT To:<[email protected]>
>>> DATA
550 5.1.1 <[email protected]>... User unknown
503 5.0.0 Need RCPT (recipient)
>>> RSET
250 2.0.0 Reset state
>>> RSET
250 2.0.0 Reset state
root... Using cached ESMTP connection to [127.0.0.1] via relay...
>>> MAIL From:<> SIZE=2819
250 2.1.0 <>... Sender ok
>>> RCPT To:<[email protected]>
>>> DATA
250 2.1.5 <[email protected]>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 w7145JI4002277 Message accepted for delivery
root... Sent (w7145JI4002277 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 mimvp-sz2.com closing connection

失敗接收郵件的結果:

550 5.1.1 <[email protected]>... User unknown

從上面發送日誌裏,可以看到上圖錯誤提示 User unknown,發送失敗了,因此也不可能成功收到郵件

 

3、問題分析與解決

錯誤提示 User unknown,是很多小白級用戶遇到的問題,當然我一開始也是小白級用戶,也遇到過此問題

遇到這種問題,如何分析呢? 哈哈,這就是我深入思考,從小白級逐漸晉升的小祕訣

本地發送郵件,默認是發送方是本機用戶名、採用默認25端口號,因此可以通過 telnet 檢測25端口號的可用性

a)安裝 telnet 

yum -y install telnet

退出 telnet 命令:

Ctrl + ] (反中括號),然後 quit

 

b)telnet 連接檢測 1)成功發送郵件的25端口號

先獲取本機外網ip,然後 telnet 外網ip 25

telnet 123.57.78.159 25

[root@mimvp-bj ~]# curl ip.cn
當前 IP:123.57.78.159 來自:北京市 阿里雲
[root@mimvp-bj ~]# telnet 123.57.78.159 25
Trying 123.57.78.159...
Connected to 123.57.78.159.
Escape character is '^]'.
220 mimvp-bj ESMTP Exim 4.72 Wed, 01 Aug 2018 12:17:43 +0800

可見,本地成功發送郵件的服務器,是可以成功連接 25 端口號

 

c)telnet 連接檢測 2)失敗發送郵件的25端口號

telnet 47.106.126.18 25

1

2

3

4

5

6

[root@mimvp-sz2 ~]# curl ip.cn

當前 IP:47.106.126.18 來自:廣東省深圳市 阿里雲

[root@mimvp-sz2 ~]#

[root@mimvp-sz2 ~]# telnet 47.106.126.18 25

Trying 47.106.126.18...

telnet: connect to address 47.106.126.18: Connection timed out

可見,本地失敗發送郵件的服務器,不可以成功失敗連接 25 端口號,錯誤提示超時

 

上面就是爲什麼阿里雲新購買的服務器無法發送郵件的原因,阿里雲把25端口號禁用了,後面也會影響到下文介紹的 smtp 配置

經過米撲博客蒐集了網上大量資料,創新型總結:

阿里雲客服解釋是2016年9月以後新購買的服務器將25端口封掉了,之前購買的不受影響

 

阿里雲封禁25號端口

出於安全考慮,阿里雲默認封禁TCP 25端口出方向的訪問流量,即你無法在阿里雲上的雲服務器通過TCP 25端口連接外部地址。

TCP 25端口的出方向封禁可能影響您通過TCP 25 端口連接第三方郵件服務商的SMTP服務器對外部發送郵件。

如果您需要使用阿里雲上的雲服務器對外部發送郵件,建議您使用阿里雲郵產品或者使用第三方郵件服務商提供的465端口。

如果存在特殊場景,您必須在雲服務器上使用TCP 25端口進行對外連接,請在安全管控平臺中提交25端口解封申請。

阿里雲:投訴,無故封禁25端口 (2016-12-06)

阿里雲:TCP 25端口解封申請  (2018-06-27)

 

這裏先小結,給出解決方案:

1)本地發送郵件,默認用25端口號,由於阿里雲2016年9月後新購服務器都禁用了25端口號,因此本地發送郵件是不可能了

2)根據阿里雲官方給出的解決方案,可以採用第三方 smtp ssl 465 端口號,即我們馬上要介紹的 smtp 和 smtps(可行的技術方案)

3)根據阿里雲解決方案,向阿里雲申請解封25號端口,但其也只能用第三方smtp,不可本機發送郵件(實際不給開,全封禁了)

阿里雲申請解封25號端口官網:25端口解封

米撲博客嘗試向阿里雲申請你了,結果是否決的,對阿里系一直沒好感,意料之中的坑爹貨~

 

 

二、smtp發送郵件(中級)

配置 smtp 發送郵件,這樣郵件的發送者就是正常的郵箱地址,不再是本機root發送

1)正常的發送者郵箱地址,如 [email protected][email protected]

2)本機root發送者郵箱地址,如 root@mimvp-bj、[email protected]

 

smtp 默認也是採用 25端口號發送,由於阿里雲禁用了25端口號,但這裏還是對比介紹下正常和失敗的場景

本文配置的qq企業郵箱和163個人郵箱,需要先了解授權碼:POP3、SMTP、IMAP 的作用和聯繫

 

1、修改 smtp 配置文件 

vim /etc/mail.rc

添加如下配置項

set [email protected]
set smtp=smtp.exmail.qq.com
set [email protected]
set smtp-auth-password=mimvp-password
set smtp-auth=login

參數介紹,請見米撲博客:Centos7 使用 sendmail 發送郵件

 

2、smtp發送郵件的正常日誌(2016年9月前購買的阿里雲,CentOS 6.5)

# mail -v -s "subject_title" [email protected] < /etc/passwd
Resolving host smtp.exmail.qq.com . . . done.
Connecting to 163.177.72.143 . . . connected.
220 smtp.qq.com Esmtp QQ Mail Server
>>> EHLO mimvp-bj
250-smtp.qq.com
250-PIPELINING
250-SIZE 73400320
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN
250-MAILCOMPRESS
250 8BITMIME
>>> AUTH LOGIN
334 VXNlcm5hbWU6
>>> cm9ib3RAbWltdnAuY29t
334 UGFzc3dvcmQ6
>>> TUltdnBfMjA1MF90b2Jvcg==
235 Authentication successful
>>> MAIL FROM:<[email protected]>
250 Ok
>>> RCPT TO:<[email protected]>
250 Ok
>>> DATA
354 End data with <CR><LF>.<CR><LF>
>>> .
250 Ok: queued as 
>>> QUIT
221 Bye

成功接收郵件的結果:

 

3、smtp 發送郵件的錯誤日誌(2016年9月後購買的阿里雲,CentOS 7.5)

# mail -v -s "subject_title" [email protected] < /etc/passwd
Resolving host smtp.exmail.qq.com . . . done.
Connecting to 163.177.72.143:smtp . . .Connecting to 163.177.90.125:smtp . . .could not connect: Connection timed out
"/root/dead.letter" 43/1873
. . . message not sent.

失敗接收郵件的結果:

Connecting to 163.177.72.143:smtp . . .Connecting to 163.177.90.125:smtp . . .could not connect: Connection timed out

從上面發送日誌裏,可以看到上圖錯誤提示 could not connect: Connection timed out,發送失敗了,因此也不可能成功收到郵件

這是因爲阿里雲禁用了25端口號,讓 smtp 默認端口號25 無法通信,可以通過 telnet 來驗證

 

4、問題分析與解決

smtp 發送郵件,默認也是採用25端口號,因此可以通過 telnet 檢測25端口號的可用性

a)安裝 telnet 

yum -y install telnet

退出 telnet 命令:

Ctrl + ] (反中括號),然後 quit

 

b)telnet 連接檢測 1)成功發送郵件的25端口號

先獲取本機外網ip,然後 telnet 外網ip 25

telnet smtp.exmail.qq.com 25

# telnet smtp.exmail.qq.com 25
Trying 163.177.72.143...
Connected to smtp.exmail.qq.com.
Escape character is '^]'.
220 smtp.qq.com Esmtp QQ Mail Server
^]
telnet> quit
Connection closed.

可見,本地成功發送郵件的服務器,是可以成功連接 25 端口號

 

c)telnet 連接檢測 2)失敗發送郵件的25端口號

telnet smtp.exmail.qq.com 25

# telnet smtp.exmail.qq.com 25
Trying 163.177.90.125...
telnet: connect to address 163.177.90.125: Connection timed out
Trying 163.177.72.143...
telnet: connect to address 163.177.72.143: Connection timed out

可見,smtp失敗發送郵件的服務器,不可以成功失敗連接 25 端口號,錯誤提示超時

 

結論:封禁了25端口號,實際上對本地發送郵件、smtp 發送郵件的方式 ,都給禁掉了

因此,唯一可行的解決方案就是不用 25端口號,改用 smtps ssl 465 端口號,安全發送郵件

 

 

三、smtps 發送郵件(中級)

465端口是SSL/TLS通訊協議的內容,郵件正文一開始就被加密保護起來了,是看不到郵件明文的。

465端口(SMTPS):465端口是爲SMTPS(SMTP-over-SSL)協議服務開放的,這是SMTP協議基於SSL安全協議之上的一種變種協議,它繼承了SSL安全協議的非對稱加密的高度安全可靠性,可防止郵件泄露。SMTPS和SMTP協議一樣,也是用來發送郵件的,只是更安全些,防止郵件被黑客截取泄露,還可實現郵件發送者抗抵賴功能。防止發送者發送之後刪除已發郵件,拒不承認發送過這樣一份郵件。

 

上面講了 telnet 驗證25端口,現在驗證下 465 端口

# telnet smtp.exmail.qq.com 465

# telnet smtp.163.com 465

1

2

3

4

5

6

7

8

9

10

11

12

[root@mimvp-sz2 ~]# telnet smtp.exmail.qq.com 465

Trying 163.177.90.125...

Connected to smtp.exmail.qq.com.

Escape character is '^]'.

^]

telnet> Connection closed.

[root@mimvp-sz2 ~]# telnet smtp.163.com 465        

Trying 220.181.12.18...

Connected to smtp.163.com.

Escape character is '^]'.

^]

telnet> Connection closed.

發現 465 端口號都是開放的,阿里雲沒有屏蔽 465端口(哈哈,廢話嘛,阿里雲推薦採用465端口)

 

這裏介紹兩種配置 smtps 465端口號的方式:qq 企業郵件 和 163個人郵箱,基本可以滿足絕多數的用戶需求了

1)qq 企業郵箱,發送者郵箱 + 密碼(若是qq個人郵箱,則是發送者郵箱 + 隨機碼,不是密碼哈)

2)163 個人郵箱,發送者郵箱 + 授權碼(163是自己定義的授權碼)

若不清楚,請參見米撲博客:POP3、SMTP、IMAP 的作用和聯繫

 

1、qq 企業郵箱設置 smtps 465

首先,開啓 smtp

登錄qq企業郵箱 ——> 設置 ——> 客戶端設置

接收服務器:imap.exmail.qq.com (使用SSL,端口號993)

發送服務器:smtp.exmail.qq.com (使用SSL,端口號465)

 

接着,配置 /etc/mail.rc

vim /etc/mail.rc

1

2

3

4

5

6

7

set [email protected]

set smtp=smtps://smtp.exmail.qq.com:465

set ssl-verify=ignore

set nss-config-dir=/root/.certs

set [email protected]

set smtp-auth-password=mimvp-password

set smtp-auth=login

創建證書目錄

mkdir /root/.certs

 

然後,ssl 授權,執行如下命令

1

2

3

4

5

echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/qq.crt

certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt

certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt

certutil -L -d .certs

certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ~/.certs/ -i ~/.certs/qq.crt

完整的執行日誌如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

[root@mimvp-hz ~]# echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/qq.crt

depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA

verify return:1

depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = GeoTrust RSA CA 2018

verify return:1

depth=0 C = CN, ST = Guangdong, L = Shenzhen, O = Shenzhen Tencent Computer Systems Company Limited, OU = R&D, CN = pop.qq.com

verify return:1

DONE

[root@mimvp-hz ~]# certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt

[root@mimvp-hz ~]# certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt

[root@mimvp-hz ~]# certutil -L -d .certs

 

Certificate Nickname                                         Trust Attributes

                                                             SSL,S/MIME,JAR/XPI

 

GeoTrust SSL CA                                              C,, 

GeoTrust Global CA                                           C,,

 

再次,smtps 加密發送郵件

mail -v -s "subject_title" [email protected] < /etc/passwd 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

# mail -v -s "subject_title" [email protected] < /etc/passwd                                                Resolving host smtp.exmail.qq.com . . . done.

Connecting to 163.177.72.143 . . . connected.

Error in certificate: Peer's certificate issuer is not recognized.

Comparing DNS name: "pop.qq.com"

Comparing DNS name: "ex.qq.com"

Comparing DNS name: "imap.exmail.qq.com"

Comparing DNS name: "rtx.exmail.qq.com"

Comparing DNS name: "smtp.exmail.qq.com"

SSL parameters: cipher=AES-128, keysize=128, secretkeysize=128,

issuer=CN=GeoTrust RSA CA 2018,OU=www.digicert.com,O=DigiCert Inc,C=US

subject=CN=pop.qq.com,OU=R&D,O=Shenzhen Tencent Computer Systems Company Limited,L=Shenzhen,ST=Guangdong,C=CN

220 smtp.qq.com Esmtp QQ Mail Server

>>> EHLO mimvp-hz

250-smtp.qq.com

250-PIPELINING

250-SIZE 73400320

250-AUTH LOGIN PLAIN

250-AUTH=LOGIN

250-MAILCOMPRESS

250 8BITMIME

>>> AUTH LOGIN

334 VXNlcm5hbWU6

>>> cm9ib3RAbWltdnAuY29t

334 UGFzc3dvcmQ6

>>> TUltdnBfMjA1MF90b2Jvcg==

235 Authentication successful

>>> MAIL FROM:<[email protected]>

250 Ok

>>> RCPT TO:<[email protected]>

250 Ok

>>> DATA

354 End data with <CR><LF>.<CR><LF>

>>> .

250 Ok: queued as

>>> QUIT

221 Bye

 

最後,查看成功發送了郵件

 

2、163 個人郵箱設置 smtps 465

首先,開啓 smtp

登錄163個人郵箱 ——> 設置 ——> POP3/SMTP/IMAP

服務器地址:

POP3服務器: pop.163.com

SMTP服務器: smtp.163.com

IMAP服務器: imap.163.com

 

接着,配置 /etc/mail.rc

vim /etc/mail.rc

1

2

3

4

5

6

7

set [email protected]

set smtp=smtps://smtp.163.com:465

set ssl-verify=ignore

set nss-config-dir=/root/.certs

set [email protected]

set smtp-auth-password=password-auth-code

set smtp-auth=login

創建證書目錄

mkdir /root/.certs

163個人郵箱的密碼,不是郵箱密碼,而是授權碼

申請請參見米撲博客:POP3、SMTP、IMAP 的作用和聯繫 (163 郵箱授權碼)

 

然後,ssl 授權,執行如下命令

1

2

3

4

5

echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/163.crt

certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt

certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt

certutil -L -d /root/.certs

certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ~/.certs/ -i ~/.certs/163.crt

完整的執行日誌如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

[root@mimvp-hz ~]# echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/163.crt

depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA

verify return:1

depth=1 C = US, O = GeoTrust Inc., CN = GeoTrust SSL CA - G3

verify return:1

depth=0 C = CN, ST = ZheJiang, L = HangZhou, O = "NetEase (Hangzhou) Network Co., Ltd", CN = *.163.com

verify return:1

DONE

[root@mimvp-hz ~]# certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt

[root@mimvp-hz ~]# certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt

[root@mimvp-hz ~]# certutil -L -d /root/.certs

 

Certificate Nickname                                         Trust Attributes

                                                             SSL,S/MIME,JAR/XPI

 

GeoTrust SSL CA                                              C,, 

GeoTrust Global CA                                           C,,

查看授權目錄 /root/.certs/ 裏的文件

1

2

3

4

5

6

7

# ll /root/.certs/

total 84

-rw-r--r-- 1 root root  2285 Jul 31 23:17 163.crt

-rw------- 1 root root 65536 Aug  1 15:36 cert8.db

-rw------- 1 root root 16384 Aug  1 15:36 key3.db

-rw-r--r-- 1 root root  2594 Aug  1 13:43 qq.crt

-rw------- 1 root root 16384 Jul 31 23:18 secmod.db

 

再次,smtps 加密發送郵件

mail -v -s "subject_title" [email protected] < /etc/passwd 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

# mail -v -s "subject_title" [email protected] < /etc/passwd

Resolving host smtp.163.com . . . done.

Connecting to 220.181.12.12 . . . connected.

Error in certificate: Peer's certificate issuer is not recognized.

Comparing DNS name: "*.163.com"

SSL parameters: cipher=AES-128-GCM, keysize=128, secretkeysize=128,

issuer=CN=GeoTrust SSL CA - G3,O=GeoTrust Inc.,C=US

subject=CN=*.163.com,O="NetEase (Hangzhou) Network Co., Ltd",L=HangZhou,ST=ZheJiang,C=CN

220 163.com Anti-spam GT for Coremail System (163com[20141201])

>>> EHLO mimvp-hz

250-mail

250-PIPELINING

250-AUTH LOGIN PLAIN

250-AUTH=LOGIN PLAIN

250-coremail 1Uxr2xKj7kG0xkI17xGrU7I0s8FY2U3Uj8Cz28x1UUUUU7Ic2I0Y2UFe34-5UCa0xDrUUUUj

250-STARTTLS

250 8BITMIME

>>> AUTH LOGIN

334 dXNlcm5hbWU6

>>> eWFuZ2dhbmdfMjA1MEAxNjMuY29t

334 UGFzc3dvcmQ6

>>> U3VuYm95MjA1MA==

235 Authentication successful

>>> MAIL FROM:<[email protected]>

250 Mail OK

>>> RCPT TO:<[email protected]>

250 Mail OK

>>> DATA

354 End data with <CR><LF>.<CR><LF>

>>> .

250 Mail OK queued as smtp8,DMCowABXbp2dXmFbV75OLg--.8377S2 1533107869

>>> QUIT

221 Bye

 

最後,查看成功發送了郵件

 

總結,smtps 通過 465端口號,實際測試可以在阿里雲老服務器、新服務器上,都可以正常發送郵件

因此,通過 smtps ssl 465 通過 qq企業郵箱和163個人郵箱發送郵件,都成功了,推薦此方案

 

 

四、nginx 發送郵件(專家級)

本文暫不講解 nginx 代理轉發方式,配置太多繁瑣,安裝軟件太多,知識點太多

感興趣的可以參見:Configuring NGINX as a Mail Proxy Server

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章