From aa2ae98b2aee55345bd691f50e946b27868bcee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Picado=20Ladr=C3=B3n=20de=20Guevara?= Date: Thu, 11 Feb 2016 14:00:59 +0100 Subject: [PATCH 1/2] Default imap folders Create default imap folders for Trash, Drafts and Sent. --- start-mailserver.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/start-mailserver.sh b/start-mailserver.sh index 17ec186b..050b9e06 100644 --- a/start-mailserver.sh +++ b/start-mailserver.sh @@ -27,6 +27,12 @@ if [ -f /tmp/postfix/accounts.cf ]; then mkdir -p /var/mail/${domain} if [ ! -d "/var/mail/${domain}/${user}" ]; then maildirmake "/var/mail/${domain}/${user}" + maildirmake "/var/mail/${domain}/${user}/.Sent" + maildirmake "/var/mail/${domain}/${user}/.Trash" + maildirmake "/var/mail/${domain}/${user}/.Drafts" + echo -e "INBOX\nINBOX.Sent\nINBOX.Trash\nInbox.Drafts" >> "/var/mail/${domain}/${user}/courierimapsubscribed" + touch "/var/mail/${domain}/${user}/.Sent/maildirfolder" + fi echo ${domain} >> /tmp/vhost.tmp done < /tmp/postfix/accounts.cf From 7ce4b8c7d90df9733e179a833b4c69360f5df28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Picado=20Ladr=C3=B3n=20de=20Guevara?= Date: Thu, 11 Feb 2016 18:36:08 +0100 Subject: [PATCH 2/2] Update test.sh --- test/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test.sh b/test/test.sh index a6cc6efa..107e0dcd 100644 --- a/test/test.sh +++ b/test/test.sh @@ -31,8 +31,8 @@ assert_raises "docker exec mail /bin/sh -c 'nc -w 1 0.0.0.0 25 < /tmp/test/auth/ # Testing user creation assert "docker exec mail sasldblistusers2" "user1@localhost.localdomain: userPassword\nuser2@otherdomain.tld: userPassword" -assert "docker exec mail ls -A /var/mail/localhost.localdomain/user1" "cur\nnew\ntmp" -assert "docker exec mail ls -A /var/mail/otherdomain.tld/user2" "cur\nnew\ntmp" +assert "docker exec mail ls -A /var/mail/localhost.localdomain/user1" ".Drafts\n.Sent\n.Trash\ncourierimapsubscribed\ncur\nnew\ntmp" +assert "docker exec mail ls -A /var/mail/otherdomain.tld/user2" ".Drafts\n.Sent\n.Trash\ncourierimapsubscribed\ncur\nnew\ntmp" # Testing `vhost` creation assert "docker exec mail cat /etc/postfix/vhost" "localhost.localdomain\notherdomain.tld"