概要: Plesk supports modern anti-spam mechanisms used to validate the identity of mail senders. Namely, DKIM, SPF, DMARC, and ARC.

In this topic, you will learn how to configure DKIM, SPF, and DMARC protection in Plesk. You will also learn how ARC support is implemented in Plesk for Linux.

Here is a short summary of the three mechanisms described in this topic and what they do:

  • DKIM (DomainKeys Identified Mail) 方案用於將域名身份與發送資訊建立關聯,並通過密碼驗證方式驗證與接收資訊相關聯的域名身份。
  • SPF (Sender Policy Framework) 方案用於阻止偽造寄件者位址,例如使用偽造的寄件者位址。該方案允許郵件伺服器檢查發自某個域名的接收郵件是否來自該域名管理員授權的某個主機。此外,Plesk 會使用 SRS (Sender Rewriting Scheme) 以保證被轉發資訊可以通過 SPF 檢查。
  • DMARC (Domain-based Message Authentication, Reporting and Conformance) 技術可擴展 SPF 和 DKIM 方案的功能。DMARC 執行策略以根據 DKIM 和 SPF 檢查的結果來處理郵件資訊。
  • ARC (Authenticated Received Chain) is a technology that enables intermediate mail servers (for example, mailing lists and mail forwarding services) to store an email’s authentication results using special headers. This helps the destination mail server validate the email if its SPF and DKIM records are made invalid by the intermediate mail server’s processing.

要使用這些方案對郵件伺服器的要求如下:

郵件伺服器 DKIM SPF* SRS DMARC ARC
Postfix (Linux)
Qmail (Linux)
MailEnable Professional (Windows)
MailEnable Standard (Windows) 9.16 或更新版本
SmarterMail (Windows)
IceWarp (Windows)

在該表格中,‘+’ 表示 Plesk Obsidian 支援的所有版本都支援該方案。‘-‘ 表示不支援該方案。

備註: *在上表中,SPF支援是指發送郵件的SPF。Linux郵件伺服器標記有‘+’,因為Plesk for Linux 支援接收和發送郵件的SPF。Windows郵件伺服器標記有“-”,因為Plesk for Windows只支援發送郵件的SPF。

DKIM

为域名啟用 DKIM 將特殊的資訊頭附加到發自該域名的每個電子郵件。此資訊頭包含加密私密金鑰。收件人郵件伺服器會使用公開金鑰核實電子郵件是否發自該域名且是否有人在傳輸過程中篡改電子郵件內容。沒有資訊頭的電子郵件將被檢測認定為不真實資訊。

為了提供 DKIM 支援,Plesk 會使用外部庫 (Linux) 或 Plesk 提供的郵件伺服器(Windows) 的功能。

啟用或禁用伺服器上的 DKIM

默認在 Plesk 中啟用 DKIM。若要禁用 DKIM 或僅保留用於發送和接收郵件,請轉到 工具與設定 > 郵件伺服器設定(在 「郵件」 下),向下滾動到 「DKIM 垃圾郵件防護」 部分,清空以下當中的一個核取方塊或兩個都清空:

  • “允許簽名發送郵件”。此選項使客戶能夠在每個域的基礎上管理發送郵件的DKIM簽名
  • (Plesk for Linux) 「核查接收郵件」。該選項會為所有接收郵件啟用 DKIM 檢查功能。會檢查所有的資訊,如果檢查失敗,則會使用特殊的標頭進行標記。

備註: 如果啟用了 DMARC 則無法對接收郵件禁用 DKIM 檢查。

啟用域名的 DKIM

若在伺服器上啟用了DKIM簽名,那麼在Plesk中具有DNS和郵件主機的新域預設會使用DKIM簽名發送郵件。

預設情況下,使用外部DNS伺服器的域無法啟用DKIM。使用DKIM簽名發送郵件意味著Plesk會將以下兩條記錄添加到域的DNS區域(example.com代表您的域名):

  • default._domainkey.example.com 包含已生成金鑰的公共部分。
  • _ domainkey.example.com 包含 DKIM 策略。您可以編輯該策略。

與Plesk中託管的域不同,Plesk無法將這些記錄添加到使用外部DNS伺服器的域中。對於這些域,您需要手動啟用DKIM。

要為使用外部DNS伺服器的域啟用對發送郵件進行DKIM簽名,請如下操作:

  1. 轉到 網站與域名 > 您的域名 > 「郵件」 標籤 > 郵件設定

  2. 保持選中」使用 DKIM 垃圾郵件防護系統簽名發送電子郵件資訊”核取方塊。

  3. 點按 「如何配置外部的 DNS」 提示。複製您在此看到的兩個 DNS 記錄然後將其添加到 DNS 伺服器。

    備註: 若您有用於發送郵件的域名,請同時為其添加 DKIM DNS 記錄。請將用於主域名的相同記錄用於域名別名。

    image DKIM external DNS

SPF 和 SRS

SPF(發件人策略框架)是用於阻止發件人位址偽造(例如使用偽造的發件人位址)的一個方案。SPF 允許域名管理員設定策略,授權特定主機從域名發送郵件。接收郵件的伺服器會檢查來自某域名的收件是否發自域名管理員授權的主機。SPF 基於發件人的 DNS 區域中的管理員指定的規則。

在 Plesk 中,您可以在 DNS 記錄中指定規則來設定用於發送郵件的 SPF 策略。另外在 Linux 上,SPF 還默認檢查接收郵件。

當設定了 SPF 時,郵件伺服器則會使用以下演算法步驟檢查接收的郵件:

  1. 閱讀本地規則。

    本地規則是垃圾郵件篩檢程式使用的本地規則。本地規則示例如下:a:test.plesk.com

  2. 搜索寄件者的 DNS SPF 記錄(如果有)。

    SPF 記錄示例如下:example.com. TXT v=spf1 +a +mx -all

  3. 將本地規則和 SPF 記錄合併到產生的策略中。

    在我們的示例中,產生的策略將是 example.com. TXT v=spf1 +a +mx +a:test.plesk.com -all

    備註: 如果郵件伺服器沒有檢測到 SPF 記錄,產生的策略將只包括本地規則。

  4. 根據由上一步操作所生成的策略來檢查郵件。

  5. 閱讀猜測規則。

    猜測規則是全域規則,會覆蓋 SPF 記錄。猜測規則示例如下:v=spf1 +a/24 +mx/24 +ptr ?all

  6. 只根據猜測規則檢查郵件。

  7. 對比兩個檢查的結果:根據產生的策略進行的檢查(第4步)和只根據猜測規則進行的檢查(前一步)。應用其結果更為寬容的檢查。

查看更多有關 SPF 檢查狀態的資訊

若要為發送郵件設定一個 SPF 策略,請如下操作:

Go to Tools & Settings > DNS Settings (under 「General Settings」) and edit the TXT DNS record related to SPF. This DNS record is always present in the server-wide DNS template. Here is an example of SPF record created by Plesk:

example.com.    TXT    v=spf1 +a +mx +a:test.plesk.com -all

該記錄的各個部分所表示的意思如下:

部分 描述
v=spf1 域名使用版本 1 的 SPF。
+a 來自 「A」 記錄的所有主機都被授權發送郵件。
+mx 來自 「MX」 記錄的所有主機都被授權發送郵件。
+a:test.plesk.com 域名 test.plesk.com 被授權發送郵件。
-all 所有其它域名未被授權發送郵件。

瞭解更多有關 SPF DNS 記錄的語法的資訊。策略符號可在 RFC7208查找。

(Plesk for Linux) 若要配置 SPF 檢查接收郵件:

  1. 轉到 工具與設定 > 郵件伺服器設定(在 「郵件」 下)並向下滾動到 「SPF 垃圾郵件防護」 部分。

  2. 從 SPF 檢查模式下拉清單中選擇一個選項以指定當 SPF 應用本地和推測規則時應如何處理電子郵件:

    1. 只創建 Received-SPF 標頭資訊,不遮罩 - 不管 SPF 檢查的結果接受所有的接收資訊。
    2. DNS查找出現問題時,使用臨時錯誤通知 - 不管 SPF 檢查的結果,即使因 DNS 查找問題導致 SPF 檢查失敗,仍接受所有的接收資訊。
    3. SPF解析為“失敗”(拒絕)時,退信 - 拒收發自未被授權使用域名的寄件者的資訊。
    4. SPF解析為“軟失敗”時,退信 - 拒收發自未被SPF系統識別為授權寄件者的或因域名沒有發佈SPF記錄而未被授權的寄件者的資訊。
    5. SPF解析為“中性”時,退信 - 拒收發自未被SPF系統識別為授權寄件者的或因域名沒有發佈SPF記錄而未被授權的寄件者的資訊。
    6. SPF沒有解析為“通過”時,退信- 拒收因任何原因而未通過SPF檢查的資訊(例如,收件人的域名未執行SPF而SPF檢查返回」未知」狀態。)
  3. 如要指定本地規則,請在 SPF 本地規則 框內輸入您需要的規則。
    例如: include:spf.trusted-forwarder.org

    瞭解更多有關 SPF 規則的資訊

  4. 您還可以在 SPF 猜測規則 框內指定猜測規則。

    例如: v=spf1 +a/24 +mx/24 +ptr ?all

  5. 要指定當郵件被拒絕時返回給 SMTP 寄件者的任意錯誤通知,請在 “SPF 解釋文本” 框中鍵入該通知。

    如果未指定任何值,預設的文本將會做為通知發送出去。

  6. 要完成設定,請按一下 “確定”

(Plesk for Linux) 若要禁用 SPF 檢查接收郵件,請如下操作:

  1. 進入 工具與設定 > 郵件伺服器設定(在 「郵件」 下)。
  2. 在 「DMARC」 部分,清空 「啟用 DMARC 檢查接收郵件」 核取方塊(如已勾選)。
  3. SPF 垃圾郵件防護 部分請清空 啟用 SPF 垃圾郵件防護檢查接收郵件 核取方塊然後點按 確定

使用 SRS

除了SPF,Plesk中的某些郵件伺服器還支援 SRS (Sender Rewriting Scheme),該機制是在轉發郵件(被轉發的郵件仍繼續要符合SPF) 時,支援覆寫寄件者位址。SRS 可幫助確保在使用SPF時發送資訊。

當從 Plesk 託管的郵箱轉發資訊時會自動使用 SRS。

為了提供 SRS 功能,Plesk 會使用外部庫 (Linux) 或郵件郵件伺服器軟體 (Windows) 的功能。

DMARC

DMARC (Domain-based Message Authentication, Reporting and Conformance) 是擴展 SPFDKIM 寄件者策略的功能的一項技術。DMARC 執行策略以根據 DKIM 和 SPF 檢查的結果來處理郵件資訊。該技術基於在寄件者DNS區域中指定的規則。

在Plesk中,您可以通過在DNS記錄中指定規則來為發送郵件設置DMARC策略。

備註: 在使用 SmarterMail 的 Plesk for Linux 和 Plesk for Windows 中,DMARC也會在默認檢查接收郵件。

若要為發送郵件設定自訂的 DMARC 策略,請如下操作:

  1. 進入 工具與設定 > DNS 設定(在 「常規設定」下)。
  2. 編輯與 DMARC 策略相關的 DNS 記錄。這些 DNS 記錄總是會出現在 伺服器級的 DNS 範本 中。相反,當您在域名上啟動 DKIM 時,與 DKIM 相關的 DNS 記錄會被添加到該域名的 DNS 區域中。

例如,Plesk默認的 DMARC 策略在以下記錄中指定:

_dmarc.<domain>.    TXT    v=DMARC1; adkim=s; aspf=s; p=quarantine

根據此策略,內送郵件伺服器應將未通過DKIM和SPF檢查的電子郵件進行隔離。隔離意味著將電子郵件移動到垃圾郵件資料夾,並將其標記為可疑。您可以指定一個更嚴格的策略。但是,接收伺服器仍可以自由地將其自己的策略應用於接收郵件。

瞭解更多有關DMARC的資訊(包括策略符號在內),請參閱

域也有自己單獨的DMARC策略,客戶可以編輯這些策略。在Plesk中擁有DNS和郵件主機的新域預設會啟用DMARC隔離策略。

若要禁用 DMARC 檢查接收郵件,請如下操作:

  1. 進入 工具與設定 > 郵件伺服器設定(在 「郵件」 下)。
  2. DMARC 部分,清空 「啟用 DMARC 檢查接收郵件」 核取方塊然後點按 確定

(Plesk for Linux) ARC

ARC (Authenticated Received Chain) is a technology that enables intermediate mail servers to add an additional layer of authentication to emails that are forwarded or sent from a mailing list by adding extra headers to emails. This is so that the final receiving mail server may be able to (but does not have to) treat an email as legitimate even if it fails its SPF, DKIM, and/or DMARC checks.

備註: ARC is supported on all Plesk Obsidian 18.0.58 and later servers running the Postfix or qmail mail servers. At the moment, ARC is only supported in Plesk for Linux, because none of the mail servers supported in Plesk for Windows have ARC support.

備註: The ARC support implementation in Plesk satisfies the Google requirement to add ARC headers to forwarded mail for senders who send 5000 or more messages a day to Gmail accounts.

局限性

  • ARC headers are not added to mail sent to a mailing list.
  • Plesk does not validate the ARC headers for incoming mail.

Enabling ARC Support

(Plesk for Linux) To enable ARC support on your server:

  1. 登錄到 Plesk
  2. 進入 工具與設定 > 郵件伺服器設定(在 「郵件」 下)。
  3. Under 「DKIM spam protection」, select the 「Allow signing outgoing mail」 checkbox.
  4. (Recommended) Under 「SPF spam protection」, select the 「Enable SPF spam protection to check incoming mail」 checkbox.
  5. (Recommended) Under 「DMARC」, select the 「Enable DMARC to check incoming mail」 checkbox.
  6. 點按 確定

ARC headers can now be added to outgoing mail forwarded via the Plesk forwarding feature or sent by the autoresponder.

Once ARC support is enabled on your server, ARC can be enabled for individual mail domains.

備註: For the ARC signatures to be valid, the DNS records required for DKIM to work must be configured properly for the domain hosting the forwarding mail account.

(Plesk for Linux) To enable ARC for a domain:

  1. 登錄到 Plesk
  2. Go to Websites & Domains, find the domain hosting the mail account, go to the 「Mail」 tab, and then click Mail Settings.
  3. Select the 「Use DKIM spam protection system to sign outgoing email messages」 checkbox, and then click OK.

ARC headers will now be added to outgoing mail forwarded via the Plesk forwarding feature or sent by the autoresponder by any of the mail accounts hosted on the domain.