1
0
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:
James Hillyerd
2013-11-06 15:36:46 -08:00
parent 6b606ebb9b
commit ef48b9c2dd
4 changed files with 121 additions and 28 deletions

View File

@@ -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]