mirror of
https://github.com/decke/smtprelay.git
synced 2025-12-26 09:12:28 -07:00
net/smtp: adds support for the SMTPUTF8 extension
Obtained from: https://github.com/golang/go/issues/19860
This commit is contained in:
6
smtp.go
6
smtp.go
@@ -242,7 +242,8 @@ func (c *Client) Auth(a smtp.Auth) error {
|
|||||||
|
|
||||||
// Mail issues a MAIL command to the server using the provided email address.
|
// Mail issues a MAIL command to the server using the provided email address.
|
||||||
// If the server supports the 8BITMIME extension, Mail adds the BODY=8BITMIME
|
// If the server supports the 8BITMIME extension, Mail adds the BODY=8BITMIME
|
||||||
// parameter.
|
// parameter. If the server supports the SMTPUTF8 extension, Mail adds the
|
||||||
|
// SMTPUTF8 parameter.
|
||||||
// This initiates a mail transaction and is followed by one or more Rcpt calls.
|
// This initiates a mail transaction and is followed by one or more Rcpt calls.
|
||||||
func (c *Client) Mail(from string) error {
|
func (c *Client) Mail(from string) error {
|
||||||
if err := validateLine(from); err != nil {
|
if err := validateLine(from); err != nil {
|
||||||
@@ -256,6 +257,9 @@ func (c *Client) Mail(from string) error {
|
|||||||
if _, ok := c.ext["8BITMIME"]; ok {
|
if _, ok := c.ext["8BITMIME"]; ok {
|
||||||
cmdStr += " BODY=8BITMIME"
|
cmdStr += " BODY=8BITMIME"
|
||||||
}
|
}
|
||||||
|
if _, ok := c.ext["SMTPUTF8"]; ok {
|
||||||
|
cmdStr += " SMTPUTF8"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_, _, err := c.cmd(250, cmdStr, from)
|
_, _, err := c.cmd(250, cmdStr, from)
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user