[Dovecot] Multiple Maildir?
OK - Getting close to everything working in my weird configuration. Here's a problem I'm still having.
I'm authenticating with this:
userdb { driver = sql args = /etc/dovecot/master-combined-sql.conf }
Default mail location:
mail_location = maildir:/fakedir/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs
However - what I'd like to do is if the mail location doesn't exist then I want to try a second mail location:
mail_location = maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs
How do I do that? Thanks in advance
Marc Perkel wrote:
if the mail location doesn't exist then I want to try a second mail location: mail_location = maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs
You might do this with a script which exports the MAIL environment variable and then executes the service binary:
http://wiki2.dovecot.org/MailLocation#Custom_mailbox_location_detection
Regards Daniel
On 10/09/12 15:42, Daniel Parthey wrote:
Marc Perkel wrote:
if the mail location doesn't exist then I want to try a second mail location: mail_location = maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs
You might do this with a script which exports the MAIL environment variable and then executes the service binary:
It will work, we do this to set the maildir location to a custom hashed directory and muck around with the namespaces a bit.
The script is in perl - the relevant parts look like this.
#set user's maildir location for dovecot $ENV{'MAIL'} = 'maildir:' . getmaildir($ENV{'USER'}); $ENV{'USERDB_KEYS'} .= 'MAIL';
#pass along to dovecot's next process exec { $ARGV[0] } @ARGV;
-K
On 10/9/2012 5:12 PM, Kelsey Cummings wrote:
On 10/09/12 15:42, Daniel Parthey wrote:
Marc Perkel wrote:
if the mail location doesn't exist then I want to try a second mail location: mail_location = maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs
You might do this with a script which exports the MAIL environment variable and then executes the service binary:
It will work, we do this to set the maildir location to a custom hashed directory and muck around with the namespaces a bit.
The script is in perl - the relevant parts look like this.
#set user's maildir location for dovecot $ENV{'MAIL'} = 'maildir:' . getmaildir($ENV{'USER'}); $ENV{'USERDB_KEYS'} .= 'MAIL';
#pass along to dovecot's next process exec { $ARGV[0] } @ARGV;
-K
Namespaces is something I don't understand. Still wondering what environment variables I can pick up in this script.
What I want to do is first try /fakedir/%d/%n and if that doesn't exist I want to go to /email/%d/%n
On 10/9/2012 3:42 PM, Daniel Parthey wrote:
Marc Perkel wrote:
if the mail location doesn't exist then I want to try a second mail location: mail_location = maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs You might do this with a script which exports the MAIL environment variable and then executes the service binary:
http://wiki2.dovecot.org/MailLocation#Custom_mailbox_location_detection
Regards Daniel
I see the idea. But how do I pick up the name and domain parameters to test the directory?
Hi Marc,
Marc Perkel wrote:
On 10/9/2012 3:42 PM, Daniel Parthey wrote:
Marc Perkel wrote:
if the mail location doesn't exist then I want to try a second mail location: mail_location = maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs You might do this with a script which exports the MAIL environment variable and then executes the service binary: http://wiki2.dovecot.org/MailLocation#Custom_mailbox_location_detection But how do I pick up the name and domain parameters to test the directory?
You can get the username and any other userdb value from the environment, have a look at the environment section:
http://wiki2.dovecot.org/PostLoginScripting#Running_environment
Regards Daniel
participants (3)
-
Daniel Parthey
-
Kelsey Cummings
-
Marc Perkel