I'm using Amazon EC2 + MySQL + SES + Postfix + Dovecot + Roundcube
<recipient@>
and the email arrives well.How can I start using the mailbox in the step 2 (after created) and not after receive the first email?
Another important point is the command: tail -f /var/log/mail.log
When I try to login appears this:
For example I created a test recipient test21@example.com, the log shows this after try to login:
Sep 17 19:44:46 ip-172-31-20-63 dovecot: imap-login: Login: user=<test21@example.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=4236, secured
Sep 17 19:44:46 ip-172-31-20-63 dovecot: imap(test21@example.com): Error: User initialization failed: Namespace 'INBOX.': Ambiguous mail location setting, don't know what to do with it: /var/spool/mail/virtual/test21/ (try prefixing it with mbox: or maildir:)
Sep 17 19:44:46 ip-172-31-20-63 dovecot: imap: Error: Invalid user settings. Refer to server log for more information.
UPDATE: I know now two things more that helps me to solve the problem, the first solves the problem but I need to create folders manually for each new mailbox, and the second is suposed should work but it doesn't. There is:
1) Create the maildirs and add permissions:
mkdir /var/spool/mail/virtual/<recipient>
mkdir /var/spool/mail/virtual/<recipient>/cur
mkdir /var/spool/mail/virtual/<recipient>/new
mkdir /var/spool/mail/virtual/<recipient>/tmp
And finally again:
sudo chown -R virtual:virtual /var/spool/mail/virtual
2) The second option founded here (https://www.digitalocean.com/community/questions/ubuntu-mail-server-postfix-dovecot-create-default-inbox-sent-and-trash-folder-per-account) is:
Modify the dovecot flags in /etc/dovecot/conf.d/20-imap.conf, as said in the comments of the article:
protocol imap {
mail_plugins = $mail_plugins autocreate
}
plugin {
autocreate = Trash
autocreate2 = Junk
autocreate3 = Drafts
autocreate4 = Sent
autosubscribe = Trash
autosubscribe2 = Junk
autosubscribe3 = Drafts
autosubscribe4 = Sent
}
Thanks, any help.
I found a solution, when the first email comes to the new mailbox the folders are created, for that reason what I need to do, is to enable the new email account sending a new email to it using:
mail -s "Create email" test26@example.com
Cc:
Welcome !
<Ctrl+D>
I will creating a new php application to create the new emails.
Bye!