useOwnAddressFrom reports whether outbound for this agent may use its own address as the From header. Fail-closed: every uncertain path returns false.
(agent *identity.AgentIdentity)
| 132 | // useOwnAddressFrom reports whether outbound for this agent may use its own |
| 133 | // address as the From header. Fail-closed: every uncertain path returns false. |
| 134 | func (s *Sender) useOwnAddressFrom(agent *identity.AgentIdentity) bool { |
| 135 | if s.sendingStatus == nil || agent == nil || !agent.DomainVerified || agent.Domain == "" { |
| 136 | return false |
| 137 | } |
| 138 | // "verified" mirrors senderidentity.StatusVerified (not imported here). |
| 139 | status, err := s.sendingStatus.GetSendingStatus(context.Background(), agent.Domain) |
| 140 | if err != nil { |
| 141 | return false |
| 142 | } |
| 143 | return status == "verified" |
| 144 | } |
| 145 | |
| 146 | // envelopeSender returns the SMTP MAIL FROM (Return-Path) for an outbound |
| 147 | // message: the aligned custom MAIL FROM (bounces@bounce.<domain>) when the |