Skip to content

Commit 57b68ba

Browse files
authored
ci: adapt dovecot config file to version 2.4
1 parent b88a6b6 commit 57b68ba

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

imapclient/acl_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var testCases = []struct {
3131
},
3232
{
3333
name: "custom_child_folder",
34-
mailbox: "MyFolder.Child",
34+
mailbox: "MyFolder/Child",
3535
setRightsModification: imap.RightModificationReplace,
3636
setRights: imap.RightSet("aelrwtd"),
3737
expectedRights: imap.RightSet("aelrwtd"),
@@ -52,7 +52,7 @@ var testCases = []struct {
5252
},
5353
{
5454
name: "empty_rights",
55-
mailbox: "MyFolder.Child",
55+
mailbox: "MyFolder/Child",
5656
setRightsModification: imap.RightModificationReplace,
5757
setRights: imap.RightSet("a"),
5858
expectedRights: imap.RightSet("a"),
@@ -82,13 +82,13 @@ func TestACL(t *testing.T) {
8282
// execute SETACL command
8383
err := client.SetACL(tc.mailbox, testUsername, tc.setRightsModification, tc.setRights).Wait()
8484
if err != nil {
85-
t.Errorf("SetACL().Wait() error: %v", err)
85+
t.Fatalf("SetACL().Wait() error: %v", err)
8686
}
8787

8888
// execute GETACL command to reset cache on server
8989
getACLData, err := client.GetACL(tc.mailbox).Wait()
9090
if err != nil {
91-
t.Errorf("GetACL().Wait() error: %v", err)
91+
t.Fatalf("GetACL().Wait() error: %v", err)
9292
}
9393

9494
if !tc.expectedRights.Equal(getACLData.Rights[testUsername]) {

imapclient/dovecot_test.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,32 @@ func newDovecotClientServerPair(t *testing.T) (net.Conn, io.Closer) {
1313
tempDir := t.TempDir()
1414

1515
cfgFilename := filepath.Join(tempDir, "dovecot.conf")
16-
cfg := `log_path = "` + tempDir + `/dovecot.log"
16+
cfg := `dovecot_config_version = 2.4.0
17+
dovecot_storage_version = 2.4.0
18+
19+
log_path = "` + tempDir + `/dovecot.log"
1720
ssl = no
18-
mail_home = "` + tempDir + `/%u"
19-
mail_location = maildir:~/Mail
21+
mail_home = "` + tempDir + `/%{user}"
22+
mail_driver = maildir
23+
mail_path = "~/Mail"
2024
2125
namespace inbox {
2226
separator = /
2327
prefix =
2428
inbox = yes
2529
}
2630
27-
mail_plugins = $mail_plugins acl
28-
protocol imap {
29-
mail_plugins = $mail_plugins imap_acl
31+
mail_plugins {
32+
acl = yes
3033
}
31-
plugin {
32-
acl = vfile
34+
35+
protocol imap {
36+
mail_plugins {
37+
imap_acl = yes
38+
}
3339
}
40+
41+
acl_driver = vfile
3442
`
3543
if err := os.WriteFile(cfgFilename, []byte(cfg), 0666); err != nil {
3644
t.Fatalf("failed to write Dovecot config: %v", err)

0 commit comments

Comments
 (0)