Merge pull request #77 from millaguie/master

Default imap folders
This commit is contained in:
Thomas VIAL 2016-02-11 19:10:25 +01:00
commit 52accb596c
2 changed files with 8 additions and 2 deletions

View file

@ -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

View file

@ -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"