1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

Increase max local-part length to 128

- Improves compatibility with Mailgun
- Closes #41
- Update CHANGELOG
This commit is contained in:
James Hillyerd
2016-12-31 04:57:13 +00:00
parent c1e7de5e14
commit dcc0f36f48
3 changed files with 13 additions and 5 deletions

View File

@@ -9,10 +9,17 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added ### Added
- Storage of To: header in messages (likely breaks existing datastores) - Storage of To: header in messages (likely breaks existing datastores)
- Attachment list to [GET message
JSON](https://github.com/jhillyerd/inbucket/wiki/REST-GET-message)
### Fixed ### Fixed
- We should no longer run out of file handles when dealing with a large number - No longer run out of file handles when dealing with a large number of
of recipients on a single message. recipients for a single message.
### Changed
- Removed legacy `integral` theme, as most new features only in `bootstrap`
- Removed old RESTful APIs, must use `/api/v1` base URI now
- Allow increased local-part length of 128 chars for Mailgun
[1.1.0] - 2016-09-03 [1.1.0] - 2016-09-03
-------------------- --------------------

View File

@@ -182,8 +182,8 @@ LOOP:
inCharQuote = false inCharQuote = false
} else { } else {
// End of local-part // End of local-part
if i > 63 { if i > 128 {
return "", "", fmt.Errorf("Local part must not exceed 64 characters") return "", "", fmt.Errorf("Local part must not exceed 128 characters")
} }
if prev == '.' { if prev == '.' {
return "", "", fmt.Errorf("Local part cannot end with a period") return "", "", fmt.Errorf("Local part cannot end with a period")

View File

@@ -99,7 +99,8 @@ func TestValidateLocal(t *testing.T) {
}{ }{
{"", false, "Empty local is not valid"}, {"", false, "Empty local is not valid"},
{"a", true, "Single letter should be fine"}, {"a", true, "Single letter should be fine"},
{strings.Repeat("a", 65), false, "Only valid up to 64 characters"}, {strings.Repeat("a", 128), true, "Valid up to 128 characters"},
{strings.Repeat("a", 129), false, "Only valid up to 128 characters"},
{"FirstLast", true, "Mixed case permitted"}, {"FirstLast", true, "Mixed case permitted"},
{"user123", true, "Numbers permitted"}, {"user123", true, "Numbers permitted"},
{"a!#$%&'*+-/=?^_`{|}~", true, "Any of !#$%&'*+-/=?^_`{|}~ are permitted"}, {"a!#$%&'*+-/=?^_`{|}~", true, "Any of !#$%&'*+-/=?^_`{|}~ are permitted"},