-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,26 +71,44 @@ func TestMultipleDomains_SeparateNamespace(tt *testing.T) { | |
t.Run(2) | ||
|
||
user1 := t.Conn("imap") | ||
defer user1.Close() | ||
user1.ExpectPattern(`\* OK *`) | ||
user1.Writeln(`. LOGIN [email protected] user1`) | ||
user1.ExpectPattern(`. OK *`) | ||
user1.Writeln(`. CREATE user1`) | ||
user1.ExpectPattern(`. OK *`) | ||
|
||
user1SMTP := t.Conn("submission") | ||
defer user1SMTP.Close() | ||
user1SMTP.SMTPNegotation("localhost", []string{"AUTH PLAIN"}, nil) | ||
user1SMTP.SMTPPlainAuth("[email protected]", "user1", true) | ||
|
||
user2 := t.Conn("imap") | ||
defer user2.Close() | ||
user2.ExpectPattern(`\* OK *`) | ||
user2.Writeln(`. LOGIN [email protected] user2`) | ||
user2.ExpectPattern(`. OK *`) | ||
user2.Writeln(`. CREATE user2`) | ||
user2.ExpectPattern(`. OK *`) | ||
|
||
user2SMTP := t.Conn("submission") | ||
defer user2SMTP.Close() | ||
user2SMTP.SMTPNegotation("localhost", []string{"AUTH PLAIN"}, nil) | ||
user2SMTP.SMTPPlainAuth("[email protected]", "user2", true) | ||
|
||
user3 := t.Conn("imap") | ||
defer user3.Close() | ||
user3.ExpectPattern(`\* OK *`) | ||
user3.Writeln(`. LOGIN [email protected] user3`) | ||
user3.ExpectPattern(`. OK *`) | ||
user3.Writeln(`. CREATE user3`) | ||
user3.ExpectPattern(`. OK *`) | ||
|
||
user3SMTP := t.Conn("submission") | ||
defer user3SMTP.Close() | ||
user3SMTP.SMTPNegotation("localhost", []string{"AUTH PLAIN"}, nil) | ||
user3SMTP.SMTPPlainAuth("[email protected]", "user3", true) | ||
|
||
user1.Writeln(`. LIST "" "*"`) | ||
user1.Expect(`* LIST (\HasNoChildren) "." INBOX`) | ||
user1.Expect(`* LIST (\HasNoChildren) "." "user1"`) | ||
|
@@ -150,26 +168,44 @@ func TestMultipleDomains_SharedCredentials_DistinctMailboxes(tt *testing.T) { | |
t.Run(2) | ||
|
||
user1 := t.Conn("imap") | ||
defer user1.Close() | ||
user1.ExpectPattern(`\* OK *`) | ||
user1.Writeln(`. LOGIN [email protected] user1`) | ||
user1.ExpectPattern(`. OK *`) | ||
user1.Writeln(`. CREATE user1`) | ||
user1.ExpectPattern(`. OK *`) | ||
|
||
user1SMTP := t.Conn("submission") | ||
defer user1SMTP.Close() | ||
user1SMTP.SMTPNegotation("localhost", []string{"AUTH PLAIN"}, nil) | ||
user1SMTP.SMTPPlainAuth("[email protected]", "user1", true) | ||
|
||
user2 := t.Conn("imap") | ||
defer user2.Close() | ||
user2.ExpectPattern(`\* OK *`) | ||
user2.Writeln(`. LOGIN [email protected] user2`) | ||
user2.ExpectPattern(`. OK *`) | ||
user2.Writeln(`. CREATE user2`) | ||
user2.ExpectPattern(`. OK *`) | ||
|
||
user2SMTP := t.Conn("submission") | ||
defer user2SMTP.Close() | ||
user2SMTP.SMTPNegotation("localhost", []string{"AUTH PLAIN"}, nil) | ||
user2SMTP.SMTPPlainAuth("[email protected]", "user2", true) | ||
|
||
user3 := t.Conn("imap") | ||
defer user3.Close() | ||
user3.ExpectPattern(`\* OK *`) | ||
user3.Writeln(`. LOGIN [email protected] user1`) | ||
user3.ExpectPattern(`. OK *`) | ||
user3.Writeln(`. CREATE user3`) | ||
user3.ExpectPattern(`. OK *`) | ||
|
||
user3SMTP := t.Conn("submission") | ||
defer user3SMTP.Close() | ||
user3SMTP.SMTPNegotation("localhost", []string{"AUTH PLAIN"}, nil) | ||
user3SMTP.SMTPPlainAuth("[email protected]", "user1", true) | ||
|
||
user1.Writeln(`. LIST "" "*"`) | ||
user1.Expect(`* LIST (\HasNoChildren) "." INBOX`) | ||
user1.Expect(`* LIST (\HasNoChildren) "." "user1"`) | ||
|
@@ -232,30 +268,62 @@ func TestMultipleDomains_SharedCredentials_SharedMailboxes(tt *testing.T) { | |
t.Run(2) | ||
|
||
user1 := t.Conn("imap") | ||
defer user1.Close() | ||
user1.ExpectPattern(`\* OK *`) | ||
user1.Writeln(`. LOGIN user1 user1`) | ||
user1.ExpectPattern(`. OK *`) | ||
user1.Writeln(`. CREATE user1`) | ||
user1.ExpectPattern(`. OK *`) | ||
|
||
user1SMTP := t.Conn("submission") | ||
defer user1SMTP.Close() | ||
user1SMTP.SMTPNegotation("localhost", []string{"AUTH PLAIN"}, nil) | ||
user1SMTP.SMTPPlainAuth("user1", "user1", true) | ||
|
||
user2 := t.Conn("imap") | ||
defer user2.Close() | ||
user2.ExpectPattern(`\* OK *`) | ||
user2.Writeln(`. LOGIN [email protected] user2`) | ||
user2.ExpectPattern(`. OK *`) | ||
user2.Writeln(`. CREATE user2`) | ||
user2.ExpectPattern(`. OK *`) | ||
|
||
user2SMTP := t.Conn("submission") | ||
defer user2SMTP.Close() | ||
user2SMTP.SMTPNegotation("localhost", []string{"AUTH PLAIN"}, nil) | ||
user2SMTP.SMTPPlainAuth("user2", "user2", true) | ||
|
||
user12 := t.Conn("imap") | ||
defer user12.Close() | ||
user12.ExpectPattern(`\* OK *`) | ||
user12.Writeln(`. LOGIN [email protected] user1`) | ||
user12.ExpectPattern(`. OK *`) | ||
user12.Writeln(`. CREATE user12`) | ||
user12.ExpectPattern(`. OK *`) | ||
|
||
user13 := t.Conn("imap") | ||
defer user13.Close() | ||
user13.ExpectPattern(`\* OK *`) | ||
user13.Writeln(`. LOGIN [email protected] user1`) | ||
user13.ExpectPattern(`. OK *`) | ||
user13.Writeln(`. CREATE user13`) | ||
user13.ExpectPattern(`. OK *`) | ||
|
||
user12SMTP := t.Conn("submission") | ||
defer user12SMTP.Close() | ||
user12SMTP.SMTPNegotation("localhost", []string{"AUTH PLAIN"}, nil) | ||
user12SMTP.SMTPPlainAuth("user1", "user1", true) | ||
|
||
user13SMTP := t.Conn("submission") | ||
defer user13SMTP.Close() | ||
user13SMTP.SMTPNegotation("localhost", []string{"AUTH PLAIN"}, nil) | ||
user13SMTP.SMTPPlainAuth("[email protected]", "user1", true) | ||
|
||
user1.Writeln(`. LIST "" "*"`) | ||
user1.Expect(`* LIST (\HasNoChildren) "." INBOX`) | ||
user1.Expect(`* LIST (\HasNoChildren) "." "user1"`) | ||
user1.Expect(`* LIST (\HasNoChildren) "." "user12"`) | ||
user1.Expect(`* LIST (\HasNoChildren) "." "user13"`) | ||
user1.ExpectPattern(". OK *") | ||
|
||
user2.Writeln(`. LIST "" "*"`) | ||
|
@@ -267,5 +335,6 @@ func TestMultipleDomains_SharedCredentials_SharedMailboxes(tt *testing.T) { | |
user12.Expect(`* LIST (\HasNoChildren) "." INBOX`) | ||
user12.Expect(`* LIST (\HasNoChildren) "." "user1"`) | ||
user12.Expect(`* LIST (\HasNoChildren) "." "user12"`) | ||
user12.Expect(`* LIST (\HasNoChildren) "." "user13"`) | ||
user12.ExpectPattern(". OK *") | ||
} |
1d04424
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this fixes the regression introduced by 120c5c9, which prevents me from sending out emails (we use auth.shadow on our server). Could you please tag a release with this included?