Removing personal e-mail from comments and tests.
This commit is contained in:
parent
8ff45117c6
commit
f70a0c8d52
3 changed files with 11 additions and 11 deletions
|
@ -36,11 +36,11 @@ func parseLine(line string) (cmd command) {
|
||||||
// Account for some clients breaking the standard and having
|
// Account for some clients breaking the standard and having
|
||||||
// an extra whitespace after the ':' character. Example:
|
// an extra whitespace after the ':' character. Example:
|
||||||
//
|
//
|
||||||
// MAIL FROM: <christian@technobabble.dk>
|
// MAIL FROM: <test@example.org>
|
||||||
//
|
//
|
||||||
// Should be:
|
// Should be:
|
||||||
//
|
//
|
||||||
// MAIL FROM:<christian@technobabble.dk>
|
// MAIL FROM:<test@example.org>
|
||||||
//
|
//
|
||||||
// Thus, we add a check if the second field ends with ':'
|
// Thus, we add a check if the second field ends with ':'
|
||||||
// and appends the rest of the third field.
|
// and appends the rest of the third field.
|
||||||
|
|
|
@ -34,7 +34,7 @@ func TestParseLine(t *testing.T) {
|
||||||
t.Fatalf("unexpected params: %v", cmd.params)
|
t.Fatalf("unexpected params: %v", cmd.params)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = parseLine("MAIL FROM:<christian@technobabble.dk>")
|
cmd = parseLine("MAIL FROM:<test@example.org>")
|
||||||
if cmd.action != "MAIL" {
|
if cmd.action != "MAIL" {
|
||||||
t.Fatalf("unexpected action: %s", cmd.action)
|
t.Fatalf("unexpected action: %s", cmd.action)
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ func TestParseLine(t *testing.T) {
|
||||||
t.Fatalf("unexpected value for param 0: %v", cmd.params[0])
|
t.Fatalf("unexpected value for param 0: %v", cmd.params[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
if cmd.params[1] != "<christian@technobabble.dk>" {
|
if cmd.params[1] != "<test@example.org>" {
|
||||||
t.Fatalf("unexpected value for param 1: %v", cmd.params[1])
|
t.Fatalf("unexpected value for param 1: %v", cmd.params[1])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ func TestParseLine(t *testing.T) {
|
||||||
|
|
||||||
func TestParseLineMailformedMAILFROM(t *testing.T) {
|
func TestParseLineMailformedMAILFROM(t *testing.T) {
|
||||||
|
|
||||||
cmd := parseLine("MAIL FROM: <christian@technobabble.dk>")
|
cmd := parseLine("MAIL FROM: <test@example.org>")
|
||||||
if cmd.action != "MAIL" {
|
if cmd.action != "MAIL" {
|
||||||
t.Fatalf("unexpected action: %s", cmd.action)
|
t.Fatalf("unexpected action: %s", cmd.action)
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ func TestParseLineMailformedMAILFROM(t *testing.T) {
|
||||||
t.Fatalf("unexpected value for param 0: %v", cmd.params[0])
|
t.Fatalf("unexpected value for param 0: %v", cmd.params[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
if cmd.params[1] != "<christian@technobabble.dk>" {
|
if cmd.params[1] != "<test@example.org>" {
|
||||||
t.Fatalf("unexpected value for param 1: %v", cmd.params[1])
|
t.Fatalf("unexpected value for param 1: %v", cmd.params[1])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ func TestHELO(t *testing.T) {
|
||||||
t.Fatalf("Dial failed: %v", err)
|
t.Fatalf("Dial failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cmd(c.Text, 502, "MAIL FROM:<christian@technobabble.dk>"); err != nil {
|
if err := cmd(c.Text, 502, "MAIL FROM:<test@example.org>"); err != nil {
|
||||||
t.Fatalf("MAIL before HELO didn't fail: %v", err)
|
t.Fatalf("MAIL before HELO didn't fail: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1010,7 +1010,7 @@ func TestHELO(t *testing.T) {
|
||||||
t.Fatalf("HELO failed: %v", err)
|
t.Fatalf("HELO failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cmd(c.Text, 250, "MAIL FROM:<christian@technobabble.dk>"); err != nil {
|
if err := cmd(c.Text, 250, "MAIL FROM:<test@example.org>"); err != nil {
|
||||||
t.Fatalf("MAIL after HELO failed: %v", err)
|
t.Fatalf("MAIL after HELO failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1119,7 +1119,7 @@ func TestNoBracketsSender(t *testing.T) {
|
||||||
t.Fatalf("HELO failed: %v", err)
|
t.Fatalf("HELO failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cmd(c.Text, 250, "MAIL FROM:christian@technobabble.dk"); err != nil {
|
if err := cmd(c.Text, 250, "MAIL FROM:test@example.org"); err != nil {
|
||||||
t.Fatalf("MAIL without brackets failed: %v", err)
|
t.Fatalf("MAIL without brackets failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1211,7 +1211,7 @@ func TestMailformedMAILFROM(t *testing.T) {
|
||||||
|
|
||||||
addr, closer := runserver(t, &smtpd.Server{
|
addr, closer := runserver(t, &smtpd.Server{
|
||||||
SenderChecker: func(peer smtpd.Peer, addr string) error {
|
SenderChecker: func(peer smtpd.Peer, addr string) error {
|
||||||
if addr != "christian@technobabble.dk" {
|
if addr != "test@example.org" {
|
||||||
return smtpd.Error{Code: 502, Message: "Denied"}
|
return smtpd.Error{Code: 502, Message: "Denied"}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -1229,7 +1229,7 @@ func TestMailformedMAILFROM(t *testing.T) {
|
||||||
t.Fatalf("HELO failed: %v", err)
|
t.Fatalf("HELO failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cmd(c.Text, 250, "MAIL FROM: <christian@technobabble.dk>"); err != nil {
|
if err := cmd(c.Text, 250, "MAIL FROM: <test@example.org>"); err != nil {
|
||||||
t.Fatalf("MAIL FROM failed with extra whitespace: %v", err)
|
t.Fatalf("MAIL FROM failed with extra whitespace: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue