Implement address blocking on the server.
[mailpopbox.git] / smtp_test.go
index ba8c254e8cad160aeac540cb9630c6b734aa354a..b589c6979edda7e828b1d4479a1dcd0f178783da 100644 (file)
@@ -36,6 +36,9 @@ func TestVerifyAddress(t *testing.T) {
                                {
                                        Domain:       "example.com",
                                        MaildropPath: dir,
+                                       BlockedAddresses: []string{
+                                               "blocked@example.com",
+                                       },
                                },
                        },
                },
@@ -57,6 +60,9 @@ func TestVerifyAddress(t *testing.T) {
        if s.VerifyAddress(mail.Address{Address: "unknown"}) == smtp.ReplyOK {
                t.Errorf("Invalid mailbox reports to be valid")
        }
+       if s.VerifyAddress(mail.Address{Address: "blocked@example.com"}) == smtp.ReplyOK {
+               t.Errorf("Blocked mailbox reports to be valid")
+       }
 }
 
 func TestMessageDelivery(t *testing.T) {