Missing 'mailbox' variable ?

View: New views
9 Messages — Rating Filter:   Alert me  

Missing 'mailbox' variable ?

by David Goncalves-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm using Dovecot with LDAP.
My users have an home directory and a field named 'mailMessageStore'.
Then the full mailbox path is 'homeDirectory/mailMessageStore'

In dovecot-ldap.conf i configured as follows :

user_filter = (&(objectClass=qmailUser)(cn=%u))
user_attrs  =
qmailUID=uid,qmailGID=gid,homeDirectory=home,mailMessageStore=mail=maildir:~/%$

Everything is working as expected but...

I'm using sieve and in the 'dovecot.conf' there is no way to get
a variable containing the mailbox path...

As the mailMessageStore field can contain something different than the
login or uid, how can i get the mailbox path in the conf ?


Regards.
--
David Goncalves - http://www.lestat.st


Re: Missing 'mailbox' variable ?

by Timo Sirainen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 2009-11-09 at 22:50 +0100, David Goncalves wrote:
> user_attrs  =
> qmailUID=uid,qmailGID=gid,homeDirectory=home,mailMessageStore=mail=maildir:~/%$
>
> Everything is working as expected but...
>
> I'm using sieve and in the 'dovecot.conf' there is no way to get
> a variable containing the mailbox path...

What do you use home for? If you don't want anything under user's "real"
home directory, you can just make mailMessageStore=home. But then again,
see http://wiki.dovecot.org/VirtualUsers#homedirs



signature.asc (204 bytes) Download Attachment

Re: Missing 'mailbox' variable ?

by David Goncalves-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Timo Sirainen wrote:
> What do you use home for? If you don't want anything under user's "real"
> home directory, you can just make mailMessageStore=home. But then again,
> see http://wiki.dovecot.org/VirtualUsers#homedirs

Actually home contains the base path of all mailboxes (ie: /opt/mailboxes)
and the mailMessageStore contains the mailbox path (ie: MyMailBox/ ).

The users are virtual, they have no real home.

Regards.
--
David Goncalves - http://www.lestat.st


Re: Missing 'mailbox' variable ?

by Timo Sirainen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 2009-11-09 at 23:00 +0100, David Goncalves wrote:
> Timo Sirainen wrote:
> > What do you use home for? If you don't want anything under user's "real"
> > home directory, you can just make mailMessageStore=home. But then again,
> > see http://wiki.dovecot.org/VirtualUsers#homedirs
>
> Actually home contains the base path of all mailboxes (ie: /opt/mailboxes)
> and the mailMessageStore contains the mailbox path (ie: MyMailBox/ ).

You really shouldn't be setting home to a global common directory.

> The users are virtual, they have no real home.

Dovecot still prefers them to have a virtual home, see the link above.
My suggestion:

user_attrs = .., mailMessageStore=home=/opt/mailboxes/%$

mail_location = maildir:~/Maildir

Then Sieve scripts also go nicely to home dir.



signature.asc (204 bytes) Download Attachment

Re: Missing 'mailbox' variable ?

by David Goncalves-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Timo Sirainen wrote:

> You really shouldn't be setting home to a global common directory.
>
>> The users are virtual, they have no real home.
>
> Dovecot still prefers them to have a virtual home, see the link above.
> My suggestion:
>
> user_attrs = .., mailMessageStore=home=/opt/mailboxes/%$
>
> mail_location = maildir:~/Maildir
>
> Then Sieve scripts also go nicely to home dir.

I finally used 'homeDirectory' and 'mailMessageStore' with the full
mailbox path because i want to avoid using absolute paths in the
config files.


Thanks for you help.
--
David Goncalves - http://www.lestat.st


Re: Missing 'mailbox' variable ?

by Timo Sirainen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 2009-11-09 at 23:23 +0100, David Goncalves wrote:
> I finally used 'homeDirectory' and 'mailMessageStore' with the full
> mailbox path because i want to avoid using absolute paths in the
> config files.

Used how? Since it's not possible to nicely combine them yet, it sounds
like you're still doing it in a potentially broken/dangerous way.





signature.asc (204 bytes) Download Attachment

Re: Missing 'mailbox' variable ?

by David Goncalves-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Timo Sirainen wrote:
> On Mon, 2009-11-09 at 23:23 +0100, David Goncalves wrote:
>> I finally used 'homeDirectory' and 'mailMessageStore' with the full
>> mailbox path because i want to avoid using absolute paths in the
>> config files.
>
> Used how? Since it's not possible to nicely combine them yet, it sounds
> like you're still doing it in a potentially broken/dangerous way.

dovecot-ldap.conf :
   user_attrs =
qmailUID=uid,qmailGID=gid,homeDirectory=home,mailMessageStore=mail

dovecot.conf :
   mail_location = ~/

LDAP :
  homeDirectory    = /opt/mailboxes/MyMailBox/
  mailMessageStore = /opt/mailboxes/MyMailBox/


You think there is something bad doing like that ?


--
David Goncalves - http://www.lestat.st


Re: Missing 'mailbox' variable ?

by Timo Sirainen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 2009-11-09 at 16:52 -0500, Timo Sirainen wrote:
> What do you use home for? If you don't want anything under user's "real"
> home directory, you can just make mailMessageStore=home. But then again,
> see http://wiki.dovecot.org/VirtualUsers#homedirs

Since this gets asked so often, I wrote a new page that hopefully makes
the whole thing clearer: http://wiki.dovecot.org/VirtualUsers/Home



signature.asc (204 bytes) Download Attachment

Re: Missing 'mailbox' variable ?

by Timo Sirainen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 2009-11-09 at 23:44 +0100, David Goncalves wrote:
> Timo Sirainen wrote:
> > On Mon, 2009-11-09 at 23:23 +0100, David Goncalves wrote:
> >> I finally used 'homeDirectory' and 'mailMessageStore' with the full
> >> mailbox path because i want to avoid using absolute paths in the
> >> config files.
> >
> LDAP :
>   homeDirectory    = /opt/mailboxes/MyMailBox/
>   mailMessageStore = /opt/mailboxes/MyMailBox/

Oh, you meant you put full paths to LDAP. Sure, that's fine. Although it
would be preferable to not have home = mail.
http://wiki.dovecot.org/VirtualUsers/Home explains why.

Also if home and mail are related, it's not really necessary to return
mail from userdb. You could just set mail_location and use ~/ to refer
to home.



signature.asc (204 bytes) Download Attachment