0

Here's my dovecot.conf (I don't have a conf.d).

listen = *

ssl = required
ssl_cert = </etc/letsencrypt/live/domain.tld/fullchain.pem
ssl_key = </etc/letsencrypt/live/domain.tld/privkey.pem
ssl_dh = </etc/dovecot/dh.pem

mail_location = maildir:~/Maildir

passdb {
    args = scheme=sha512-crypt /etc/mail/passwd
    driver = passwd-file
}

userdb {
    args = uid=vmail gid=vmail home=/var/vmail/%d/%n
    driver = static
}

protocols = imap lmtp

service imap-login {
    inet_listener imaps {
        port = 993
        ssl = yes
    }
    # Disable imap
    inet_listener imap {
        port = 0
    } 
}

namespace inbox {
    inbox = yes
    location =

    mailbox Drafts {
        special_use = \Drafts
    }
    mailbox Junk {
        special_use = \Junk
    }
    mailbox Trash {
        special_use = \Trash
    }

    mailbox Sent {
        special_use = \Sent
    }
    mailbox "Sent Messages" {
        special_use = \Sent
    }

    mailbox virtual/Flagged {
        special_use = \Flagged
        comment = All my flagged messages
    }
    prefix =
}

Currently what happens is that the INBOX is correctly created and stored in /var/vmail/domain.tld/user/Maildir/. I would expect it to live in /var/vmail/domain.tld/user/Maildir/INBOX instead.

When syncing with a MTA, I cannot get the Sent, Trash, Junk, ... folders.

What am I doing wrong?

2 Answers 2

2

I don't have exactly the same configuration as you, but I have virtual mailboxes (for groups) and the special mailboxes were not automatically created. I had to write a script in order to do it (script executed in incron):

ManageGroup() {
  if [[ -d "/var/mail/group/${1}" ]]; then
cat <<EOMaint | doveadm exec imap -u "${1}"
1 select Sent
2 select Trash
3 select Junk
EOMaint
  fi
}

for group in /var/mail/group/*; do
  ManageGroup ${group##*/}
done
1

Adding auto = create to the folders creates them automatically. That seems to solve the problem. Also I did not understand exactly how Maildir++ was working and I was expecting something more along the lines of LAYOUT:fs. See https://wiki.dovecot.org/MailLocation/Maildir

2
  • Oh, yes, sorry, I forgot about this auto = create. Commented May 13, 2020 at 8:19
  • no worries, thanks for answering @StéphaneVeyret, it was very kind of you Commented May 13, 2020 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .