mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
Compare commits
2 Commits
main
...
release-3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0738791ba8 | ||
|
|
66831d10c7 |
@@ -6,6 +6,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [v3.0.4] - 2022-10-02
|
||||
|
||||
### Fixed
|
||||
- More flexible support of `AUTH=<>` FROM parameter (#291)
|
||||
|
||||
|
||||
## [v3.0.3] - 2022-08-07
|
||||
|
||||
@@ -310,7 +315,8 @@ No change from beta1.
|
||||
specific message.
|
||||
|
||||
|
||||
[Unreleased]: https://github.com/inbucket/inbucket/compare/v3.0.3...main
|
||||
[Unreleased]: https://github.com/inbucket/inbucket/compare/v3.0.4...main
|
||||
[v3.0.4]: https://github.com/inbucket/inbucket/compare/v3.0.3...v3.0.4
|
||||
[v3.0.3]: https://github.com/inbucket/inbucket/compare/v3.0.2...v3.0.3
|
||||
[v3.0.2]: https://github.com/inbucket/inbucket/compare/v3.0.1-rc2...v3.0.2
|
||||
[v3.0.1-rc2]: https://github.com/inbucket/inbucket/compare/v3.0.1-rc1...v3.0.1-rc2
|
||||
|
||||
@@ -58,7 +58,7 @@ const (
|
||||
// as quoted pair and in double quoted strings (?i) makes the regex case insensitive, (?:) is
|
||||
// non-grouping sub-match. Accepts empty angle bracket value in options for 'AUTH=<>'.
|
||||
var fromRegex = regexp.MustCompile(
|
||||
`(?i)^FROM:\s*<((?:(?:\\>|[^>])+|"[^"]+"@[^>])+)?>( [\w= ]+(?:=<>)?)?$`)
|
||||
`(?i)^FROM:\s*<((?:(?:\\>|[^>])+|"[^"]+"@[^>])+)?>( ([\w= ]|=<>)+)?$`)
|
||||
|
||||
func (s State) String() string {
|
||||
switch s {
|
||||
@@ -619,7 +619,7 @@ func (s *Session) parseCmd(line string) (cmd string, arg string, ok bool) {
|
||||
// The leading space is mandatory.
|
||||
func (s *Session) parseArgs(arg string) (args map[string]string, ok bool) {
|
||||
args = make(map[string]string)
|
||||
re := regexp.MustCompile(` (\w+)=(\w+)`)
|
||||
re := regexp.MustCompile(` (\w+)=(\w+|<>)`)
|
||||
pm := re.FindAllStringSubmatch(arg, -1)
|
||||
if pm == nil {
|
||||
s.logger.Warn().Msgf("Failed to parse arg string: %q", arg)
|
||||
|
||||
@@ -197,6 +197,8 @@ func TestReadyState(t *testing.T) {
|
||||
{"RSET", 250},
|
||||
{"MAIL FROM:<bounces@onmicrosoft.com> SIZE=4096 AUTH=<>", 250},
|
||||
{"RSET", 250},
|
||||
{"MAIL FROM:<b@o.com> SIZE=4096 AUTH=<> BODY=7BIT", 250},
|
||||
{"RSET", 250},
|
||||
{"MAIL FROM:<host!host!user/data@foo.com>", 250},
|
||||
{"RSET", 250},
|
||||
{"MAIL FROM:<\"first last\"@space.com>", 250},
|
||||
|
||||
Reference in New Issue
Block a user