From dcc0f36f4867721087a906b3feed02d61257e2a2 Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sat, 31 Dec 2016 04:57:13 +0000 Subject: [PATCH] Increase max local-part length to 128 - Improves compatibility with Mailgun - Closes #41 - Update CHANGELOG --- CHANGELOG.md | 11 +++++++++-- smtpd/utils.go | 4 ++-- smtpd/utils_test.go | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1c157c..00f9da8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,17 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - 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 -- We should no longer run out of file handles when dealing with a large number - of recipients on a single message. +- No longer run out of file handles when dealing with a large number of + 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 -------------------- diff --git a/smtpd/utils.go b/smtpd/utils.go index 06a38fe..a8dcfb7 100644 --- a/smtpd/utils.go +++ b/smtpd/utils.go @@ -182,8 +182,8 @@ LOOP: inCharQuote = false } else { // End of local-part - if i > 63 { - return "", "", fmt.Errorf("Local part must not exceed 64 characters") + if i > 128 { + return "", "", fmt.Errorf("Local part must not exceed 128 characters") } if prev == '.' { return "", "", fmt.Errorf("Local part cannot end with a period") diff --git a/smtpd/utils_test.go b/smtpd/utils_test.go index 7f5e72d..ae4fda3 100644 --- a/smtpd/utils_test.go +++ b/smtpd/utils_test.go @@ -99,7 +99,8 @@ func TestValidateLocal(t *testing.T) { }{ {"", false, "Empty local is not valid"}, {"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"}, {"user123", true, "Numbers permitted"}, {"a!#$%&'*+-/=?^_`{|}~", true, "Any of !#$%&'*+-/=?^_`{|}~ are permitted"},