mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
policy: Implement recipient domain policy for #51
- INBUCKET_SMTP_DEFAULTACCEPT - INBUCKET_SMTP_ACCEPTDOMAINS - INBUCKET_SMTP_REJECTDOMAINS
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/mail"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// HashMailboxName accepts a mailbox name and hashes it. filestore uses this as
|
||||
@@ -28,3 +29,20 @@ func StringAddressList(addrs []*mail.Address) []string {
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// SliceContains returns true if s is present in slice.
|
||||
func SliceContains(slice []string, s string) bool {
|
||||
for _, v := range slice {
|
||||
if s == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// SliceToLower lowercases the contents of slice of strings.
|
||||
func SliceToLower(slice []string) {
|
||||
for i, s := range slice {
|
||||
slice[i] = strings.ToLower(s)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user