mirror of
https://github.com/harness-community/drone-email.git
synced 2026-06-13 18:42:17 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 40a9df7a10 | |||
| 5b0a93b192 | |||
| b4bc696ee8 |
@@ -185,10 +185,13 @@ func (p Plugin) Exec() error {
|
||||
}
|
||||
|
||||
// Handle STARTTLS policy
|
||||
// Note: Use WithTLSPolicy (not WithTLSPortPolicy) to avoid overriding
|
||||
// the user-configured port. WithTLSPortPolicy treats port 25 as "default/unset"
|
||||
// and silently changes it to 587 for TLSOpportunistic/TLSMandatory.
|
||||
if p.Config.NoStartTLS {
|
||||
options = append(options, mail.WithTLSPortPolicy(mail.NoTLS))
|
||||
options = append(options, mail.WithTLSPolicy(mail.NoTLS))
|
||||
} else {
|
||||
options = append(options, mail.WithTLSPortPolicy(mail.TLSOpportunistic))
|
||||
options = append(options, mail.WithTLSPolicy(mail.TLSOpportunistic))
|
||||
}
|
||||
|
||||
client, err := mail.NewClient(p.Config.Host, options...)
|
||||
|
||||
Reference in New Issue
Block a user