(tt *testing.T)
| 82 | } |
| 83 | |
| 84 | func TestIssue321(tt *testing.T) { |
| 85 | t := tests.NewT(tt) |
| 86 | t.DNS(map[string]mockdns.Zone{ |
| 87 | "example.invalid.": { |
| 88 | AD: true, |
| 89 | A: []string{"127.0.0.1"}, |
| 90 | }, |
| 91 | }) |
| 92 | t.Port("smtp") |
| 93 | tgtPort := t.Port("remote_smtp") |
| 94 | t.Config(` |
| 95 | hostname mx.maddy.test |
| 96 | tls off |
| 97 | smtp tcp://127.0.0.1:{env:TEST_PORT_smtp} { |
| 98 | deliver_to remote { |
| 99 | mx_auth { |
| 100 | dnssec |
| 101 | dane |
| 102 | } |
| 103 | } |
| 104 | }`) |
| 105 | t.Run(1) |
| 106 | defer t.Close() |
| 107 | |
| 108 | be, s := testutils.SMTPServer(tt, "127.0.0.1:"+strconv.Itoa(int(tgtPort))) |
| 109 | defer s.Close() |
| 110 | |
| 111 | c := t.Conn("smtp") |
| 112 | defer c.Close() |
| 113 | c.SMTPNegotation("client.maddy.test", nil, nil) |
| 114 | c.Writeln("MAIL FROM:<from@maddy.test>") |
| 115 | c.ExpectPattern("250 *") |
| 116 | c.Writeln("RCPT TO:<to1@example.invalid>") |
| 117 | c.ExpectPattern("250 *") |
| 118 | c.Writeln("RCPT TO:<to2@example.invalid>") |
| 119 | c.ExpectPattern("250 *") |
| 120 | c.Writeln("DATA") |
| 121 | c.ExpectPattern("354 *") |
| 122 | c.Writeln("From: <from@maddy.test>") |
| 123 | c.Writeln("To: <to@maddy.test>") |
| 124 | c.Writeln("Subject: Hello!") |
| 125 | c.Writeln("") |
| 126 | c.Writeln("Hello!") |
| 127 | c.Writeln(".") |
| 128 | c.ExpectPattern("250 2.0.0 OK: queued") |
| 129 | c.Writeln("QUIT") |
| 130 | c.ExpectPattern("221 *") |
| 131 | |
| 132 | if be.SessionCounter != 1 { |
| 133 | t.Fatal("No actual connection made?", be.SessionCounter) |
| 134 | } |
| 135 | } |
nothing calls this directly
no test coverage detected