I am trying to change where dovecot places new incoming emails from the inbox, to another folder, which i've named PreInbox OR I'd like to move all emails from inbox to PreInbox via cron or something.
when running doveadm mailbox list -u ###@###.com
dovecot shows the folder as:
INBOX
INBOX.PreInbox
INBOX.Archive
etc...
I know that I can change the inbox namespace in /etc/dovecot/dovecot.conf
but this would change the setting for all mail accounts and I want to do this for only ONE user. Is there a way to set a configuration file for a single user?
Alternatively, moving the emails using cron: I've tried moving the emails from the directory that holds inbox emails to the directory for .PreInbox as such: mv mail/user/cur/*emailfile* mail/user/.PreInbox/cur/
when checking the mail, it disappears from the inbox but does not show in the PreInbox folder, when moved back to the original directory it shows in the inbox again.
I am not a dovecot master, so I'm sure there's something simple I'm missing. Any guidance would be greatly appreciated.
Asked
Active
Viewed 332 times
1

lemonskunnk
- 113
- 5
1 Answers
0
According to the docs for mail location and configuration, you can use something like
mail_location = maildir:~/mail:INBOX=%{if;%u;eq;name;Preinbox;INBOX}
where name
is the name of the user you want to treat differently. This needs version 2.2.33 or later for the conditional.

Andrew Schulman
- 8,811
- 21
- 32
- 47
-
it appears that where, in the conditional statement, you have PreInbox and INBOX, literal, dynamic paths may be required? when looking at dovecot.conf, the examples look like ```# mail_location = mbox:~/mail:INBOX=/var/mail/%u # mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n``` do you see how INBOX= leads to a literal, dynamic path? would you concur with this conclusion? though it does get confusing, because i'm not using mbox files, and the example for maildir looks like ```# mail_location = maildir:~/Maildir``` – lemonskunnk Nov 13 '20 at 17:30
-
Not sure. I think you'll just have to try it. – Andrew Schulman Nov 13 '20 at 19:26