Skip to content

Commit

Permalink
feat: XOORG support
Browse files Browse the repository at this point in the history
  • Loading branch information
ml1nk committed Aug 22, 2024
1 parent 274020d commit 04dd565
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ func (c *Conn) handleGreet(enhanced bool, arg string) {
if c.server.EnableDSN {
caps = append(caps, "DSN")
}
if c.server.EnableXOORG {
caps = append(caps, "XOORG")
}
if c.server.MaxMessageBytes > 0 {
caps = append(caps, fmt.Sprintf("SIZE %v", c.server.MaxMessageBytes))
} else {
Expand Down Expand Up @@ -339,6 +342,12 @@ func (c *Conn) handleMail(arg string) {
}

opts.Size = int64(size)
case "XOORG":
if !c.server.EnableXOORG {
c.writeResponse(504, EnhancedCode{5, 5, 4}, "EnableXOORG is not implemented")
return
}
opts.XOORG = value
case "SMTPUTF8":
if !c.server.EnableSMTPUTF8 {
c.writeResponse(504, EnhancedCode{5, 5, 4}, "SMTPUTF8 is not implemented")
Expand Down
4 changes: 4 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ type Server struct {
// Should be used only if backend supports it.
EnableDSN bool

// Advertise XOORG capability.
// Should be used only if backend supports it.
EnableXOORG bool

// The server backend.
Backend Backend

Expand Down
3 changes: 3 additions & 0 deletions smtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ type MailOptions struct {
// Envelope identifier set by the client.
EnvelopeID string

// Accepted Domain from Exchange Online, e.g. from OutgoingConnector
XOORG string

// The authorization identity asserted by the message sender in decoded
// form with angle brackets stripped.
//
Expand Down

0 comments on commit 04dd565

Please sign in to comment.