mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 13:50:49 +01:00
Refactor TLS policy comments for clarity
Updated comments for WithTLSPolicy and WithTLSPortPolicy to provide clearer explanations. Improved readability and emphasized recommended best practices for SMTP TLS connections.
This commit is contained in:
parent
3e5c93a418
commit
bae0ac6cde
1 changed files with 11 additions and 11 deletions
22
client.go
22
client.go
|
@ -348,10 +348,10 @@ func WithHELO(helo string) Option {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithTLSPolicy tells the client to use the provided TLSPolicy
|
// WithTLSPolicy sets the TLSPolicy of the Client and overrides the DefaultTLSPolicy
|
||||||
//
|
//
|
||||||
// Note: To follow best-practices for SMTP TLS connections, it is recommended
|
// Note: To follow best-practices for SMTP TLS connections, it is recommended to use
|
||||||
// to use WithTLSPortPolicy instead.
|
// WithTLSPortPolicy instead.
|
||||||
func WithTLSPolicy(policy TLSPolicy) Option {
|
func WithTLSPolicy(policy TLSPolicy) Option {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
c.tlspolicy = policy
|
c.tlspolicy = policy
|
||||||
|
@ -359,16 +359,16 @@ func WithTLSPolicy(policy TLSPolicy) Option {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithTLSPortPolicy tells the client to use the provided TLSPolicy,
|
// WithTLSPortPolicy enables explicit TLS via STARTTLS for the Client using the provided TLSPolicy. The
|
||||||
// The correct port is automatically set.
|
// correct port is automatically set.
|
||||||
//
|
//
|
||||||
// Port 587 is used for TLSMandatory and TLSOpportunistic.
|
// If TLSMandatory or TLSOpportunistic are provided as TLSPolicy, port 587 will be used for the connection.
|
||||||
// If the connection fails with TLSOpportunistic,
|
// If the connection fails with TLSOpportunistic, the Client will attempt to connect on port 25 using
|
||||||
// a plaintext connection is attempted on port 25 as a fallback.
|
// using an unencrypted connection as a fallback. If NoTLS is provided, the Client will always use port 25.
|
||||||
// NoTLS will allways use port 25.
|
|
||||||
//
|
//
|
||||||
// Note: If a different port has already been set otherwise, the port-choosing
|
// Note: If a different port has already been set otherwise using WithPort, the selected port has higher
|
||||||
// and fallback automatism will be skipped.
|
// precedence and is used to establish the SSL/TLS connection. In this case the authmatic fallback
|
||||||
|
// mechanism is skipped at all.
|
||||||
func WithTLSPortPolicy(policy TLSPolicy) Option {
|
func WithTLSPortPolicy(policy TLSPolicy) Option {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
c.SetTLSPortPolicy(policy)
|
c.SetTLSPortPolicy(policy)
|
||||||
|
|
Loading…
Reference in a new issue