mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 11:44:38 +03:00
fix parsing List-Post header in webmail
This commit is contained in:
21
webmail/message_test.go
Normal file
21
webmail/message_test.go
Normal file
@ -0,0 +1,21 @@
|
||||
package webmail
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/mjl-/mox/dns"
|
||||
)
|
||||
|
||||
func TestParseListPostAddress(t *testing.T) {
|
||||
check := func(s string, exp *MessageAddress) {
|
||||
t.Helper()
|
||||
v := parseListPostAddress(s)
|
||||
tcompare(t, v, exp)
|
||||
}
|
||||
|
||||
check("<mailto:list@host.com>", &MessageAddress{User: "list", Domain: dns.Domain{ASCII: "host.com"}})
|
||||
check("<mailto:moderator@host.com> (Postings are Moderated)", &MessageAddress{User: "moderator", Domain: dns.Domain{ASCII: "host.com"}})
|
||||
check("<mailto:moderator@host.com?subject=list%20posting>", &MessageAddress{User: "moderator", Domain: dns.Domain{ASCII: "host.com"}})
|
||||
check("NO (posting not allowed on this list)", nil)
|
||||
check("", nil)
|
||||
}
|
Reference in New Issue
Block a user