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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user