Skip to content

Commit d576c01

Browse files
committed
Move MailOptions to smtp.go
This struct is used by both the server and the client.
1 parent d666ea9 commit d576c01

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

backend.go

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,6 @@ type Backend interface {
2727
NewSession(c *Conn) (Session, error)
2828
}
2929

30-
type BodyType string
31-
32-
const (
33-
Body7Bit BodyType = "7BIT"
34-
Body8BitMIME BodyType = "8BITMIME"
35-
BodyBinaryMIME BodyType = "BINARYMIME"
36-
)
37-
38-
// MailOptions contains custom arguments that were
39-
// passed as an argument to the MAIL command.
40-
type MailOptions struct {
41-
// Value of BODY= argument, 7BIT, 8BITMIME or BINARYMIME.
42-
Body BodyType
43-
44-
// Size of the body. Can be 0 if not specified by client.
45-
Size int64
46-
47-
// TLS is required for the message transmission.
48-
//
49-
// The message should be rejected if it can't be transmitted
50-
// with TLS.
51-
RequireTLS bool
52-
53-
// The message envelope or message header contains UTF-8-encoded strings.
54-
// This flag is set by SMTPUTF8-aware (RFC 6531) client.
55-
UTF8 bool
56-
57-
// The authorization identity asserted by the message sender in decoded
58-
// form with angle brackets stripped.
59-
//
60-
// nil value indicates missing AUTH, non-nil empty string indicates
61-
// AUTH=<>.
62-
//
63-
// Defined in RFC 4954.
64-
Auth *string
65-
}
66-
6730
// Session is used by servers to respond to an SMTP client.
6831
//
6932
// The methods are called when the remote client issues the matching command.

smtp.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,40 @@
1515
//
1616
// Additional extensions may be handled by other packages.
1717
package smtp
18+
19+
type BodyType string
20+
21+
const (
22+
Body7Bit BodyType = "7BIT"
23+
Body8BitMIME BodyType = "8BITMIME"
24+
BodyBinaryMIME BodyType = "BINARYMIME"
25+
)
26+
27+
// MailOptions contains custom arguments that were
28+
// passed as an argument to the MAIL command.
29+
type MailOptions struct {
30+
// Value of BODY= argument, 7BIT, 8BITMIME or BINARYMIME.
31+
Body BodyType
32+
33+
// Size of the body. Can be 0 if not specified by client.
34+
Size int64
35+
36+
// TLS is required for the message transmission.
37+
//
38+
// The message should be rejected if it can't be transmitted
39+
// with TLS.
40+
RequireTLS bool
41+
42+
// The message envelope or message header contains UTF-8-encoded strings.
43+
// This flag is set by SMTPUTF8-aware (RFC 6531) client.
44+
UTF8 bool
45+
46+
// The authorization identity asserted by the message sender in decoded
47+
// form with angle brackets stripped.
48+
//
49+
// nil value indicates missing AUTH, non-nil empty string indicates
50+
// AUTH=<>.
51+
//
52+
// Defined in RFC 4954.
53+
Auth *string
54+
}

0 commit comments

Comments
 (0)