mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-23 20:47:03 +00:00
Extend ParseMailboxName()
- Checks for invalid characters, returns useful error if it finds them - Extended unit tests for ParseMailboxName - Closes #6
This commit is contained in:
@@ -76,7 +76,10 @@ func DefaultFileDataStore() DataStore {
|
||||
// Retrieves the Mailbox object for a specified email address, if the mailbox
|
||||
// does not exist, it will attempt to create it.
|
||||
func (ds *FileDataStore) MailboxFor(emailAddress string) (Mailbox, error) {
|
||||
name := ParseMailboxName(emailAddress)
|
||||
name, err := ParseMailboxName(emailAddress)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dir := HashMailboxName(name)
|
||||
s1 := dir[0:3]
|
||||
s2 := dir[0:6]
|
||||
|
||||
Reference in New Issue
Block a user