Class MailBlockedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.mail.MailException
io.leandev.appfuse.mail.MailBlockedException
- All Implemented Interfaces:
Serializable
public class MailBlockedException
extends org.springframework.mail.MailException
郵件因防火牆政策被全部封鎖時拋出
與「遞送失敗」(SMTP / 網路錯誤)語意刻意區分:這是確定性的政策封鎖——收件者全不在 白名單,或防火牆啟用卻無白名單(依文檔契約 = 阻擋全部)。重試不會改變結果。
拋例外(而非靜默丟棄)確保此情況不靜默、不假成功:呼叫端必會察覺;通知子系統的
EmailNotificationChannel 會將其轉為
DeliveryResult.suppressed、Outbox 轉 SUPPRESSED
終態、不重試(確定性政策封鎖,重試無益;與遞送失敗的重試 / dead-letter 區分),
既不被誤標為已送達、也不會無謂重試。
注意:部分收件者被過濾(仍有人在白名單)不屬於此例外——那會正常寄給允許的子集。 只有「過濾後一個收件者都不剩」才拋。
- Since:
- 4.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCauseMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MailBlockedException
-