郵件沒收到先拿寄件者、收件者、精確時間、主旨片段與 Message-ID,再查 trace。只有截圖『寄件成功』不夠,寄件端接受不代表最後已投遞。
Message Trace V2
查最近 24 小時Exchange Online PowerShell
Get-MessageTraceV2 -StartDate (Get-Date).AddHours(-24) -EndDate (Get-Date) -ResultSize 5000時區與查詢期間要記錄,避免漏跨日。
依寄件者查Exchange Online PowerShell
Get-MessageTraceV2 -StartDate (Get-Date).AddDays(-2) -EndDate (Get-Date) -SenderAddress [email protected]外部寄件者拼字與 envelope sender 可能不同。
依收件者查Exchange Online PowerShell
Get-MessageTraceV2 -StartDate (Get-Date).AddDays(-2) -EndDate (Get-Date) -RecipientAddress [email protected]群組展開後可能要查實際成員。
依 Message-ID 查Exchange Online PowerShell
Get-MessageTraceV2 -StartDate (Get-Date).AddDays(-2) -EndDate (Get-Date) -MessageId '<[email protected]>'Message-ID 從原始 header 取得,通常包含角括號。
取單封 trace 詳細事件Exchange Online PowerShell
$t=Get-MessageTraceV2 -StartDate (Get-Date).AddDays(-2) -EndDate (Get-Date) -RecipientAddress [email protected] | Select-Object -First 1; Get-MessageTraceDetailV2 -MessageTraceId $t.MessageTraceId -RecipientAddress $t.RecipientAddress先確認 $t 真的是目標郵件,不要只拿第一筆正式判斷。
匯出 traceExchange Online PowerShell
Get-MessageTraceV2 -StartDate (Get-Date).AddHours(-24) -EndDate (Get-Date) -ResultSize 5000 | Export-Csv .\message-trace.csv -NoTypeInformation -Encoding utf8CSV 含郵件地址與主旨,需限制存取。
Rule、Connector 與隔離
查看啟用中的 Transport RulesExchange Online PowerShell
Get-TransportRule | Where-Object State -eq 'Enabled' | Sort-Object Priority | Format-List Name,Priority,Mode,StopRuleProcessing,Description找 redirect、reject、quarantine、header 與 stop processing。
查看 Inbound ConnectorExchange Online PowerShell
Get-InboundConnector | Format-List Name,Enabled,SenderDomains,SenderIPAddresses,RequireTls,TlsSenderCertificateName來源 IP 或憑證名稱漂移會讓 connector 不命中。
查看 Outbound ConnectorExchange Online PowerShell
Get-OutboundConnector | Format-List Name,Enabled,RecipientDomains,SmartHosts,TlsSettings,RouteAllMessagesViaOnPremisessmart host、TLS 與 scoped connector 要一起看。
連到 Security & CompliancePowerShell
Connect-IPPSSession需要對應權限與 ExchangeOnlineManagement 模組。
查最近隔離郵件Security & Compliance PowerShell
Get-QuarantineMessage -StartReceivedDate (Get-Date).AddDays(-2) -EndReceivedDate (Get-Date)不要未檢查內容與威脅判定就直接 release。
查看反垃圾信政策Exchange Online PowerShell
Get-HostedContentFilterPolicy | Format-List Name,SpamAction,HighConfidenceSpamAction,PhishSpamAction,BulkThreshold還要確認 policy rule 套到哪些人。
查看出站垃圾信政策Exchange Online PowerShell
Get-HostedOutboundSpamFilterPolicy | Format-List Name,RecipientLimitExternalPerHour,RecipientLimitInternalPerHour,ActionWhenThresholdReached,AutoForwardingMode租戶限制與 service limit 仍可能另外套用。
Domain、DKIM 與 SMTP AUTH
查看 Accepted Domain 類型Exchange Online PowerShell
Get-AcceptedDomain | Format-Table DomainName,DomainType,DefaultInternalRelay 沒 connector 可能造成未知收件者無法轉送。
查看 DKIM 狀態Exchange Online PowerShell
Get-DkimSigningConfig | Format-Table Domain,Enabled,Status,Selector1CNAME,Selector2CNAMECNAME 發布與 Enabled 都要確認。
查看全租戶 SMTP AUTHExchange Online PowerShell
Get-TransportConfig | Format-List SmtpClientAuthenticationDisabledTrue 表示全租戶預設停用。
查看單一 Mailbox SMTP AUTHExchange Online PowerShell
Get-CASMailbox [email protected] | Format-List SmtpClientAuthenticationDisabledNull 表示跟隨組織設定。
查 MXPowerShell
Resolve-DnsName contoso.com -Type MX確認 MX 指向預期 Microsoft 365 或第三方防護服務。
查 SPF 與 DMARCPowerShell
Resolve-DnsName contoso.com -Type TXT; Resolve-DnsName _dmarc.contoso.com -Type TXT檢查來源是否授權與 alignment。
怎麼確認有做對
- trace 的 Receive、Rule、Spam、Deliver/Fail 事件能串成完整路徑。
- Connector、Accepted Domain、MX 與 TLS 設定和實際拓樸一致。
- 用可辨識主旨與 Message-ID 的測試信驗證修正,並查最終 header。
常見錯誤
- 只查收件匣,不查 Junk、Quarantine、Rule 與 forwarding。
- 查錯時區或時間範圍。
- 看到 Delivered 就認為一定顯示在 Outlook 收件匣。
- 為了一封信直接停用整條防垃圾信政策。
常見問題
Trace 顯示 Delivered,使用者為什麼看不到?
Delivered 代表送到 mailbox,不保證在 Inbox。接著查 Junk、Inbox Rule、Sweep、Focused Inbox、delegate、retention、client sync 與搜尋條件。
舊 Get-MessageTrace 還能用嗎?
以當期 ExchangeOnlineManagement 和 Microsoft 公告為準;新內容優先使用 Get-MessageTraceV2/Get-MessageTraceDetailV2,避免照過期參數。
延伸閱讀
版本與官方文件
參數會隨工具版本與作業系統實作改變。正式環境先用 --help、-h 或系統內建說明確認,再以當版官方文件為準。
常見問題
Trace 顯示 Delivered,使用者為什麼看不到?
Delivered 代表送到 mailbox,不保證在 Inbox。接著查 Junk、Inbox Rule、Sweep、Focused Inbox、delegate、retention、client sync 與搜尋條件。
舊 Get-MessageTrace 還能用嗎?
以當期 ExchangeOnlineManagement 和 Microsoft 公告為準;新內容優先使用 Get-MessageTraceV2/Get-MessageTraceDetailV2,避免照過期參數。