1 頁 (共 1 頁)

如何透過 cPanel 設定 SPF 與 DKIM 紀錄

文章發表於: 2022年 8月 19日, 14:59
myc0504
註:假如您的郵件服務或是 DNS 在其他地方,需要請指向位置的廠商協助設定。
註2:DNS 變更後需要約 8-72 小時等待其他主機更新相關紀錄後方能生效。

近來有使用者反映,發送信箱到 Google 時會被退信
退信訊息內容如下:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

xxxxxxxxxxxx@gmail.com
host gmail-smtp-in.l.google.com [142.250.157.27]
SMTP error from remote mail server after end of data:
550-5.7.26 This message does not pass authentication checks (SPF and DKIM both
550-5.7.26 do not pass). SPF check for [ksm.com.tw] does not pass with ip:
550-5.7.26 [60.249.109.51].To best protect our users from spam, the message has
550-5.7.26 been blocked. Please visit
550-5.7.26 https://support.google.com/mail/answer/ ... entication for more
550 5.7.26 information. k6-20020a170902c40600b00164179b39acsi13553247plk.556 - gsmtp


該情況主要為發送信件之網域並未正確設定 SPF 、 DKIM
又或是該信件並非 SPF & DKIM 所設定的郵件主機,

想要檢查你的 SPF 設定狀態可以使用以下工具
https://mxtoolbox.com/spf.aspx
01-SPGMSG.png
01-SPGMSG.png (22.17 KiB) 被瀏覽 1109 次


只要在前方輸入你的網址後點選後方的 SPF Record Lookup 就會顯示出當前的狀態
02-SPFCheck.png
02-SPFCheck.png (22.92 KiB) 被瀏覽 1109 次


想要檢查你的 DKIM 設定狀態可以使用以下工具
https://mxtoolbox.com/dkim.aspx
DKIM 檢查方法比較不同,
需要在前方輸入 default._domainkey.yourdomain 後再點選 DKIM Lookup 就會顯示出當前的狀態
03-DKIMCheck.png
03-DKIMCheck.png (12.18 KiB) 被瀏覽 1109 次


以下兩張圖為查詢後有正確設定SPF & DKIM 的畫面
04-SPFResault.png
04-SPFResault.png (131.78 KiB) 被瀏覽 1109 次

05-DKIMResault.png
05-DKIMResault.png (54.22 KiB) 被瀏覽 1109 次


如果沒有正確設定 SPF & DKIM 的話
請參照以下教學做設定

cPanel 的部分請參照以下圖片做操作

1.登入 cPanel 以後選擇 Email Deliverability
06-cPanelEmail Deliverability.png
06-cPanelEmail Deliverability.png (35.89 KiB) 被瀏覽 1109 次


2.選擇你的主網域點選後方的管理
07-SelectDomain.png
07-SelectDomain.png (41.37 KiB) 被瀏覽 1109 次


3.產生 DKIM key
08-Generate DKIM key.png
08-Generate DKIM key.png (21.23 KiB) 被瀏覽 1109 次


4.設定 DKIM
09-Set DKIM.png
09-Set DKIM.png (31.74 KiB) 被瀏覽 1109 次


5.DKIM 設定完成畫面
10-DKIM complete.png
10-DKIM complete.png (15.16 KiB) 被瀏覽 1109 次


6.點選設定 SPF 紀錄
11-set SPF.png
11-set SPF.png (29.35 KiB) 被瀏覽 1109 次


7. SPF 設定完成
12-SPF SPF complete.png
12-SPF SPF complete.png (11.04 KiB) 被瀏覽 1109 次


註:有使用者反應會出現錯誤訊息,這是因為我們的 nameserver 是使用 Cluster 的關係,該警告可以不用管。
警告: Because this is not an authoritative nameserver for the domain “domain.com.tw”, the current or suggested records will not reflect your changes. Use the Zone Editor to ensure that the system applied your changes.


註:假如您的郵件服務或是 DNS 在其他地方,需要請指向位置的廠商協助設定。