Change index location problem

2014-06-11 Thread igord
Hi All,

I was unable to change location of Dovecot indexes.

Currently they are under /var/vmail/%d/%u, but I want to change them to
/media/ephemeral0/%u

I've changed conf line in /etc/dovecot/dovecot.conf:

mail_location = maildir:/var/vmail/%d/%u:INDEX=/media/ephemeral0/%u

and setup permissions of /media/ephemeral0 to dovecot:dovecot, tried also
vmail:mail (which is default user for e-mails) and also tried with 777 on
all dirs, but Dovecot is keeping creating indexes on the old location. I
tried moving them from old to new location, but Dovecot recreates them on
the old location.

Details:

# dovecot --version
2.0.9

# doveconf -a | grep location
mail_location = maildir:/var/vmail/%d/%u:INDEX=/media/ephemeral0/%u

Has anyone experienced something similar, any solution for this?

Thanks in advance!



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/Change-index-location-problem-tp48468.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: Change index location problem

2014-06-11 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 11 Jun 2014, igord wrote:


mail_location = maildir:/var/vmail/%d/%u:INDEX=/media/ephemeral0/%u

and setup permissions of /media/ephemeral0 to dovecot:dovecot, tried also
vmail:mail (which is default user for e-mails) and also tried with 777 on
all dirs, but Dovecot is keeping creating indexes on the old location. I
tried moving them from old to new location, but Dovecot recreates them on
the old location.


+ Did you've restarted Dovecot after changing the conf file?
+ What's in the logs? Maybe you need to enable mail_debug.
+ What's the permission of /media?

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBU5hK33z1H7kL/d9rAQLM0ggAhADvHkovUm1NjGxxG6EKrxz3irwHQFw+
ZQJ8XK16i7IiUwYxMOfNwb+b++VpPgwdZCREVskQs3fJemqW7WbpY9KAHmQt4eQr
fVQSQVg2M3BhFVkmaVp6sUqUmrGrGIfkLyVR2ciFdFlCqxJIbahH7bM0WlNafY/S
y/U/Rfha8brUN/JSwHaYUv4lbxyf1Mxgee/Yx4ANpv7+g5yt5Yk3C3gO8nn9XNhF
ae3ozsJ4BJTlk+Tb7u8LpTL78VCbVpEShrQXaQ7Ww0gULWlVer1yq5l7RbjqA3my
jcTmVFP4Q/JY7d9IWW9JlntN7+ONfeU7Nd1GpKhTPsDBksyTuMVLdQ==
=P1Zq
-END PGP SIGNATURE-


Re: Change index location problem

2014-06-11 Thread igord
 Did you've restarted Dovecot after changing the conf file?

Yes, few times.

 What's in the logs? Maybe you need to enable mail_debug.

I've enabled now mail_debug, and looks like Dovecot doesn't see new index
location:

Jun 11 12:36:16 dovecot: imap(e-mail@domain): Debug: maildir++:
root=/var/vmail/domain/user, index=, control=, inbox=/var/vmail/domain/user

# dovecot -n | grep location
mail_location = maildir:/var/vmail/%d/%u:INDEX=/media/ephemeral0/%u

 What's the permission of /media? 

Currently it's 777 and vmail:mail, which is a user for storing e-mails, but
I tried with dovecot:dovecot which Dovecot daemon is running.

# ls -la /

drwxrwxrwx   3 vmail mail  4096 Apr  8 21:29 media

# ls -la /media

drwxrwsrwx  2 vmail mail 4096 Jun 11 11:41 ephemeral0



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/Change-index-location-problem-tp48468p48473.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: Change index location problem

2014-06-11 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 11 Jun 2014, igord wrote:


Did you've restarted Dovecot after changing the conf file?


Yes, few times.


What's in the logs? Maybe you need to enable mail_debug.


I've enabled now mail_debug, and looks like Dovecot doesn't see new index
location:

Jun 11 12:36:16 dovecot: imap(e-mail@domain): Debug: maildir++:
root=/var/vmail/domain/user, index=, control=, inbox=/var/vmail/domain/user


is this the only log line? Some lines from UserDB?


# dovecot -n | grep location
mail_location = maildir:/var/vmail/%d/%u:INDEX=/media/ephemeral0/%u


Did does not mean, that Dovecot is using this setting, though.

Please post full doveconf -n output.

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBU5hZpXz1H7kL/d9rAQLcfgf+Pye7OnPfFg1yObiyNibAjoRmUqp3d3/V
/6104Ah9jEr3AUng+/FwLa9665BxbLdxOfFCNsV9TQNv8uPOTHbUxOLA7rO+HAMf
z4O+j0tP+MScDJh4JWmMRc5qPInqrNzlMMSRZDgtH9jRLxbq/eKs29W4Oqv/kdGd
qytEWua8yfI9C2CRLhutK+44OhqfMroetJRjktT/ZakggDzqmy/JqLyFrU41Pp65
uBEzsg6+ZQr4euDlrhBK8tiBYVxmgA4fL7WIY4Gbcbrh2qwMbbg9/66r8sm4TZ9Y
Pv3i4Dy0M0F+hyYhpa2uwnILWubzAf6fUXWyOlul2dWVoeJb9Il49w==
=4Ddx
-END PGP SIGNATURE-


Re: Change index location problem

2014-06-11 Thread igord
You are right, I forgot to mention part which is actually crucial here -
users (and their settings) are 
being queried by userdb settings (from mysql), which will override default
dovecot.conf settings 
(as described  here http://wiki2.dovecot.org/UserDatabase  ):

...
userdb {
  args = /etc/dovecot/sql.conf
  driver = sql
}
...

And in /etc/dovecot/sql.conf I have:

user_query = SELECT concat('/var/vmail/', maildir) as home,
concat('maildir:/var/vmail/', maildir) as mail, 101 AS uid, 12 AS gid,
concat('maildir:storage=', quota) AS quota FROM mailbox WHERE username =
'%u' AND active = '1'

So I modified it to:

user_query = SELECT concat('/var/vmail/', maildir) as home,
concat('maildir:/var/vmail/', maildir, ':INDEX=/media/ephemeral0/%u') as
mail, 101 AS uid, 12 AS gid, concat('maildir:storage=', quota) AS quota FROM
mailbox WHERE username = '%u' AND active = '1'

.. and now it started creating indexes in /media/ephemeral0/%u !

Thank you for assistance 



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/Change-index-location-problem-tp48468p48475.html
Sent from the Dovecot mailing list archive at Nabble.com.