[Dovecot] bad maildir location
Hi,
I use dovecot 1.0.15 on Debian Lenny.
In my /etc/dovecot/dovecot-sql.conf, i use user_query = SELECT path, 33 AS uid, uid AS gid FROM mail_users WHERE alias = '%u'
The result is something like this /var/alternc/mail/d/denis_collectifs.net and is the correct location (the Maildir is created by an script)
But the problem is that dovecot creates (when you log in for the first time) a directory in the form of the exact address. Here for example, /var/alternc/mail/d/denis@collectifs.net
And so all connections will be on an empty location.
How is it possible to resolve this?
As mail_location I have this "maildir:/var/alternc/mail/%1u/%u/Maildir" which is not really correct.
Thanks Denis
PS: For now, I temporarily symlinks /var/alternc/mail/d/denis@collectifs.net /var/alternc/mail/d/denis_collectifs.net
On Fri, 2009-04-17 at 18:09, denis wrote:
Hi,
But the problem is that dovecot creates (when you log in for the first time) a directory in the form of the exact address. Here for example, /var/alternc/mail/d/denis@collectifs.net
And so all connections will be on an empty location.
How is it possible to resolve this?
As mail_location I have this "maildir:/var/alternc/mail/%1u/%u/Maildir" which is not really correct.
Dovecot is doing what you have told it.
%u is complete username
if you want name use %n ... and %d where (if) you want domain Bascially replace your %u with %n
Noel Butler a écrit :
On Fri, 2009-04-17 at 18:09, denis wrote:
/But the problem is that dovecot creates (when you log in for the first time) a directory in the form of the exact address. Here for example, /var/alternc/mail/d/denis@collectifs.net
And so all connections will be on an empty location.
How is it possible to resolve this?
As mail_location I have this "maildir:/var/alternc/mail/%1u/%u/Maildir" which is not really correct. /
Dovecot is doing what you have told it. %u is complete username
if you want name use %n ... and %d where (if) you want domain Bascially replace your %u with %n Thanks, it's working well with
mail_location = maildir:/var/alternc/mail/%1u/%n_%d/Maildir
But, for some users logging with name_domain the directory which is created is not correct and look like
/var/alternc/mail/d/denis_collectifs.net_
Is it a way to transform a login with _ like denis_collectifs.net to denis@collectifs.net to have a the mail_location correct ?
Thanks Denis
On Wed, 2009-04-22 at 19:29, denis wrote:
Noel Butler a écrit :
On Fri, 2009-04-17 at 18:09, denis wrote:
/But the problem is that dovecot creates (when you log in for the first time) a directory in the form of the exact address. Here for example, /var/alternc/mail/d/denis@collectifs.net
And so all connections will be on an empty location.
How is it possible to resolve this?
As mail_location I have this "maildir:/var/alternc/mail/%1u/%u/Maildir" which is not really correct. /
Dovecot is doing what you have told it. %u is complete username
if you want name use %n ... and %d where (if) you want domain Bascially replace your %u with %n Thanks, it's working well with
mail_location = maildir:/var/alternc/mail/%1u/%n_%d/Maildir
But, for some users logging with name_domain the directory which is created is not correct and look like
/var/alternc/mail/d/denis_collectifs.net_
I can't see how it's doing that, given you have told it where to put the underscore. Is there any reason you can't use /var/alternc/mail/collectifs.net/d/denis format? Do you need underscores?
Is it a way to transform a login with _ like denis_collectifs.net to denis@collectifs.net to have a the mail_location correct ?
I can't recall if you mentioned earlier what MTA you are using, our setup uses postfix/dovecot/mysql How are you storing your users/auth ? Perhaps using my suggestion above will work better? just adjust your database query to match
Noel
Noel Butler a écrit :
Thanks, it's working well with
mail_location = maildir:/var/alternc/mail/%1u/%n_%d/Maildir
But, for some users logging with name_domain the directory which is created is not correct and look like
/var/alternc/mail/d/denis_collectifs.net_
I can't see how it's doing that, given you have told it where to put the underscore. Is there any reason you can't use /var/alternc/mail/collectifs.net/d/denis format? Do you need underscores?
Yes, because it comes from the hosting control/ panel Alternc http://www.alternc.org
I am trying to use dovecot in place of courrier /
Is it a way to transform a login with _ like denis_collectifs.net to denis@collectifs.net to have a the mail_location correct ?
I can't recall if you mentioned earlier what MTA you are using, our setup uses postfix/dovecot/mysql How are you storing your users/auth ? Perhaps using my suggestion above will work better? just adjust your database query to match
In my /etc/dovecot/dovecot-sql.conf, i use user_query = SELECT path, 33 AS uid, uid AS gid FROM mail_users WHERE alias = '%u'
The user can be denis_collectifs.net or denis@collectifs.net and the path is always like this /var/alternc/mail/d/denis_collectifs.net (the Maildir is created by an script)
If i set mail_location = maildir:/var/alternc/mail/%1u/%u/Maildir
The problem is that dovecot creates (when you log in for the first time) a directory in the form of the exact address. Here for example, /var/alternc/mail/d/denis@collectifs.net in place of using /var/alternc/mail/d/denis_collectifs.net
If i set mail_location = maildir:/var/alternc/mail/%1u/%n_%d/Maildir
All is working well, except is use denis_collectifs as user because dovecot creates a directory /var/alternc/mail/d/denis_collectifs.net_
Maybe that the best way is to modify the user_query , something like REPLACE(alias,'@','_') but i don't now if it's possible.
Thanks Denis
participants (2)
-
denis
-
Noel Butler