1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-22 15:27:02 +00:00

chasquid: Detect email loops

This patch implements some measures against email loops, such as keeping
a limit on the lenght of an address, and rejecting email that has too
many Received headers.

It's not perfect (a server could be actively removing Received headers),
but it should cover the normal accidents and misconfigurations.
This commit is contained in:
Alberto Bertogli
2016-10-08 12:11:20 +01:00
parent c4e8b22fd0
commit 40153e352f
12 changed files with 132 additions and 10 deletions

View File

@@ -108,7 +108,7 @@ func sendEmailWithAuth(tb testing.TB, c *smtp.Client, auth smtp.Auth) {
tb.Fatalf("Data: %v", err)
}
msg := []byte("Hi! This is an email\n")
msg := []byte("Subject: Hi!\n\n This is an email\n")
if _, err = w.Write(msg); err != nil {
tb.Errorf("Data write: %v", err)
}