forked from emersion/go-smtp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some SMTP extensions add new RCPT parameters. Add a struct to be able to support these.
- Loading branch information
Showing
10 changed files
with
24 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,7 @@ func TestBasic(t *testing.T) { | |
t.Fatalf("AUTH failed: %s", err) | ||
} | ||
|
||
if err := c.Rcpt("[email protected]>\r\nDATA\r\nInjected message body\r\n.\r\nQUIT\r\n"); err == nil { | ||
if err := c.Rcpt("[email protected]>\r\nDATA\r\nInjected message body\r\n.\r\nQUIT\r\n", nil); err == nil { | ||
t.Fatalf("RCPT should have failed due to a message injection attempt") | ||
} | ||
if err := c.Mail("[email protected]>\r\nDATA\r\nAnother injected message body\r\n.\r\nQUIT\r\n", nil); err == nil { | ||
|
@@ -129,7 +129,7 @@ func TestBasic(t *testing.T) { | |
if err := c.Mail("[email protected]", nil); err != nil { | ||
t.Fatalf("MAIL failed: %s", err) | ||
} | ||
if err := c.Rcpt("[email protected]"); err != nil { | ||
if err := c.Rcpt("[email protected]", nil); err != nil { | ||
t.Fatalf("RCPT failed: %s", err) | ||
} | ||
msg := `From: [email protected] | ||
|
@@ -797,7 +797,7 @@ func TestLMTP(t *testing.T) { | |
if err := c.Mail("[email protected]", nil); err != nil { | ||
t.Fatalf("MAIL failed: %s", err) | ||
} | ||
if err := c.Rcpt("[email protected]"); err != nil { | ||
if err := c.Rcpt("[email protected]", nil); err != nil { | ||
t.Fatalf("RCPT failed: %s", err) | ||
} | ||
msg := `From: [email protected] | ||
|
@@ -882,10 +882,10 @@ func TestLMTPData(t *testing.T) { | |
if err := c.Mail("[email protected]", nil); err != nil { | ||
t.Fatalf("MAIL failed: %s", err) | ||
} | ||
if err := c.Rcpt("[email protected]"); err != nil { | ||
if err := c.Rcpt("[email protected]", nil); err != nil { | ||
t.Fatalf("RCPT failed: %s", err) | ||
} | ||
if err := c.Rcpt("[email protected]"); err != nil { | ||
if err := c.Rcpt("[email protected]", nil); err != nil { | ||
t.Fatalf("RCPT failed: %s", err) | ||
} | ||
msg := `From: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ func ExampleDial() { | |
if err := c.Mail("[email protected]", nil); err != nil { | ||
log.Fatal(err) | ||
} | ||
if err := c.Rcpt("[email protected]"); err != nil { | ||
if err := c.Rcpt("[email protected]", nil); err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
|
@@ -113,7 +113,7 @@ func (s *Session) Mail(from string, opts *smtp.MailOptions) error { | |
return nil | ||
} | ||
|
||
func (s *Session) Rcpt(to string) error { | ||
func (s *Session) Rcpt(to string, opts *smtp.RcptOptions) error { | ||
log.Println("Rcpt to:", to) | ||
return nil | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters