It would be handy (for me) if there were a userdb where a directory structure defined the db.
userdb stat { mail_location=maildir:/fakedir/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs }
userdb stat { mail_location=maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs }
The idea being that if the first directory doesn't exist then it will try the second one.
On 10.10.2012, at 4.34, Marc Perkel wrote:
It would be handy (for me) if there were a userdb where a directory structure defined the db.
userdb stat { mail_location=maildir:/fakedir/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs }
userdb stat { mail_location=maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs }
The idea being that if the first directory doesn't exist then it will try the second one.
You could already implement this as userdb checkpassword script.
On 10/9/2012 7:29 PM, Timo Sirainen wrote:
On 10.10.2012, at 4.34, Marc Perkel wrote:
It would be handy (for me) if there were a userdb where a directory structure defined the db.
userdb stat { mail_location=maildir:/fakedir/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs }
userdb stat { mail_location=maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs }
The idea being that if the first directory doesn't exist then it will try the second one. You could already implement this as userdb checkpassword script.
Can you give me an example?
On 10.10.2012, at 5.40, Marc Perkel wrote:
It would be handy (for me) if there were a userdb where a directory structure defined the db.
userdb stat { mail_location=maildir:/fakedir/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs }
userdb stat { mail_location=maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs }
The idea being that if the first directory doesn't exist then it will try the second one. You could already implement this as userdb checkpassword script.
Can you give me an example?
Something like this:
userdb { driver = checkpasword args = /usr/local/bin/userdb.sh }
/usr/local/bin/userdb.sh:
#!/bin/sh
path=/fakedir/$AUTH_DOMAIN/$AUTH_USERNAME if [ -d $path ]; then MAIL=maildir:$path:INBOX=/email/$AUTH_DOMAIN/$AUTH_USERNAME:LAYOUT=fs EXTRA=mail AUTHORIZED=2 exec "$@" fi
exit 1
(I'm not sure if the MAIL/mail should be USERDB_MAIL/userdb_mail instead. Probably not.)
Timo Sirainen wrote:
On 10.10.2012, at 5.40, Marc Perkel wrote:
It would be handy (for me) if there were a userdb where a directory structure defined the db.
userdb stat { mail_location=maildir:/fakedir/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs }
userdb stat { mail_location=maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs }
The idea being that if the first directory doesn't exist then it will try the second one. You could already implement this as userdb checkpassword script.
Can you give me an example?
Something like this:
userdb { driver = checkpasword args = /usr/local/bin/userdb.sh }
Here is the documentation about how to implement a checkpassword script:
http://wiki2.dovecot.org/AuthDatabase/CheckPassword
Dovecot sets some environment variables that the script may use. All of the AUTH_* variables are available as AUTH_<long name> extra fields in the environment:
http://wiki2.dovecot.org/Variables#line-30
Regards Daniel
participants (3)
-
Daniel Parthey
-
Marc Perkel
-
Timo Sirainen