mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
smtpsrv: Only allow authenticated email on submission
The submission port is expected to be used only by authenticated clients, so this patch makes chasquid enforce this, which also helps to reduce spam. https://www.rfc-editor.org/rfc/rfc6409.txt
This commit is contained in:
@@ -146,6 +146,15 @@ func TestAuth(t *testing.T) {
|
||||
sendEmailWithAuth(t, c, auth)
|
||||
}
|
||||
|
||||
func TestSubmissionWithoutAuth(t *testing.T) {
|
||||
c := mustDial(t, ModeSubmission, true)
|
||||
defer c.Close()
|
||||
|
||||
if err := c.Mail("from@from"); err == nil {
|
||||
t.Errorf("Mail not failed as expected")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAuthOnSMTP(t *testing.T) {
|
||||
c := mustDial(t, ModeSMTP, true)
|
||||
defer c.Close()
|
||||
|
||||
Reference in New Issue
Block a user