Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-09 Thread Richard Stockton

Hi Timo,

At 07:32 PM 12/8/2009, Timo wrote:

On Dec 8, 2009, at 7:01 PM, Richard Stockton wrote:

 Here is what we are using with 1.1.19:

 password_query = SELECT password, home as userdb_home, 5000 as userdb_uid,
 5000 as userdb_gid FROM mailbox where userid = '%n'

 mail_location = maildir:/mail/%h:INDEX=MEMORY

So you're using relative home directories.

 Will this still work in 1.2?

No. Change it to:

password_query = .., '/mail/' || home as userdb_mail, ..

Then the mail_location in dovecot.conf will be completely ignored.


I assume you meant to have me change it to:
password_query = .., '/mail/' || home as userdb_home, ..
since there is no mail field in my DB table.

This does not appear to work in Dovecot 1.1.19.

Sadly, if I can't make a change that works for 1.1.19 as well as 1.2.x,
I will be unable to update at this time.

Please let me know if my assumptions about 1.1.19 vs 1.2.x are true.
Thank you.
 - Richard



Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-09 Thread Timo Sirainen
On Wed, 2009-12-09 at 11:13 -0800, Richard Stockton wrote:
 password_query = .., '/mail/' || home as userdb_mail, ..
 
 Then the mail_location in dovecot.conf will be completely ignored.
 
 I assume you meant to have me change it to:
 password_query = .., '/mail/' || home as userdb_home, ..
 since there is no mail field in my DB table.

No, I meant userdb_mail. The mail field isn't about having such field
in database, but about presenting the mail field to Dovecot. Or actually
I messed it up anyway, I meant:

password_query = .., 'maildir:/mail/' || home as userdb_mail, ..



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-09 Thread Timo Sirainen
On Wed, 2009-12-09 at 11:13 -0800, Richard Stockton wrote:
 I assume you meant to have me change it to:
 password_query = .., '/mail/' || home as userdb_home, ..
 since there is no mail field in my DB table.

Although this should work too with:

mail_location = maildir:~/

That's actually better than what I was first thinking about anyway.

 This does not appear to work in Dovecot 1.1.19.

If it doesn't work with the above mail_location, what exactly fails
then? auth_debug=yes and mail_debug=yes logs could be helpful.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-09 Thread Richard Stockton

At 11:21 AM 12/9/2009, Timo Sirainen wrote:

On Wed, 2009-12-09 at 11:13 -0800, Richard Stockton wrote:
 password_query = .., '/mail/' || home as userdb_mail, ..
 
 Then the mail_location in dovecot.conf will be completely ignored.

 I assume you meant to have me change it to:
 password_query = .., '/mail/' || home as userdb_home, ..
 since there is no mail field in my DB table.

No, I meant userdb_mail. The mail field isn't about having such field
in database, but about presenting the mail field to Dovecot. Or actually
I messed it up anyway, I meant:

password_query = .., 'maildir:/mail/' || home as userdb_mail, ..


Sorry, that doesn't work either.  I get an imap protocol error in 
squirrelmail.


I see your other mail suggesting mail_location = maildir:~/, but I
don't understand that one either.  Doesn't the tilde refer to a local
user on the server?  We have no local users, just users in the DB, so
how would maildir:~/ work?

I hesitate to turn on debugging because these servers are in heavy use.
Sorry to be a pain.
 - Richard



Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-09 Thread Timo Sirainen
On Wed, 2009-12-09 at 11:38 -0800, Richard Stockton wrote:
 password_query = .., 'maildir:/mail/' || home as userdb_mail, ..
 
 Sorry, that doesn't work either.  I get an imap protocol error in 
 squirrelmail.

And what did Dovecot's logs say? http://wiki.dovecot.org/Logging

 I see your other mail suggesting mail_location = maildir:~/, but I
 don't understand that one either.  Doesn't the tilde refer to a local
 user on the server?

No. It refers to home returned by userdb lookup.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-09 Thread Richard Stockton

At 11:45 AM 12/9/2009, Timo Sirainen wrote:

On Wed, 2009-12-09 at 11:38 -0800, Richard Stockton wrote:
 password_query = .., 'maildir:/mail/' || home as userdb_mail, ..

 Sorry, that doesn't work either.  I get an imap protocol error in
 squirrelmail.

And what did Dovecot's logs say? http://wiki.dovecot.org/Logging


mail_location: Ambiguous mail location setting, don't know what to
do with it: 0 (try prefixing it with mbox: or maildir:)

and then

IMAP(my_name): Namespace initialization failed

I believe these errors were from my first attempt, when I just had
'/mail/' || home as userdb_home.

When I added the 'maildir:/mail/' || home as userdb_mail, I didn't
see any errors in the dovecot-info.log, just the imap protocol error
in squirrelmail.


 I see your other mail suggesting mail_location = maildir:~/, but I
 don't understand that one either.  Doesn't the tilde refer to a local
 user on the server?

No. It refers to home returned by userdb lookup.


Hmmm, okay I see how that is supposed to work.

Unfortunately I had a couple of client complaints with my previous
one minute (or so) tests, so I won't be able to do anything more
with this until later today, or perhaps tomorrow.

Thanks for your help so far, I'll keep beating on it. ;-)
 - Richard



Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-09 Thread Timo Sirainen
On Wed, 2009-12-09 at 12:22 -0800, Richard Stockton wrote:
 At 11:45 AM 12/9/2009, Timo Sirainen wrote:
 On Wed, 2009-12-09 at 11:38 -0800, Richard Stockton wrote:
   password_query = .., 'maildir:/mail/' || home as userdb_mail, ..
  
   Sorry, that doesn't work either.  I get an imap protocol error in
   squirrelmail.
 
 And what did Dovecot's logs say? http://wiki.dovecot.org/Logging
 
 mail_location: Ambiguous mail location setting, don't know what to
 do with it: 0 (try prefixing it with mbox: or maildir:)

Oh. || wasn't concat operator in MySQL after all. I just recently tested
that it didn't give an error so I assumed it was concat, not logical
or. :)

 I believe these errors were from my first attempt, when I just had
 '/mail/' || home as userdb_home.

You should have used instead: concat('mail', home) as userdb_home



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-09 Thread Richard Stockton

At 12:28 PM 12/9/2009, Timo Sirainen wrote:

Oh. || wasn't concat operator in MySQL after all. I just recently tested
that it didn't give an error so I assumed it was concat, not logical
or. :)

 I believe these errors were from my first attempt, when I just had
 '/mail/' || home as userdb_home.

You should have used instead: concat('mail', home) as userdb_home


I just tried: concat('mail/', home) as userdb_home
after setting mail_location = maildir:~/:INDEX=MEMORY

Squirrelmail reports: ERROR: Connection dropped by IMAP server.
  Query: CAPABILITY

dovecot-info.log reports nothing.

home is defined in the DB as r/l/rls/Maildir/.  The DB is MySQL 5.0.26.
OS is Red Hat Enterprise Linux Server release 5.4 (Tikanga)


If I try: concat('maildir:/mail/', home) as userdb_mail
(leaving the old config mail_location = maildir:/mail/:INDEX=MEMORY)

I get the same squirrelmail error and this in dovecot-info.log
Dec  9 12:49:13 webmail02 dovecot: Fatal: Mailbox indexes in 
/mail/r/l/rls/Maildir/ are in NFS mount. You must set 
mail_nfs_index=yes (and mail_nfs_storage=yes) to avoid index 
corruptions. If you're sure this check was wrong, set nfs_check=no.


which I assume is due to there being no INDEX=MEMORY anywhere.

I am really starting to push my luck testing this with our clients
trying to use webmail at the same time.  But I'm still open to other
ideas, I just may have to wait a bit before trying them.
Thanks.
 - Richard



Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-09 Thread Timo Sirainen
On Wed, 2009-12-09 at 13:05 -0800, Richard Stockton wrote:
 At 12:28 PM 12/9/2009, Timo Sirainen wrote:
 Oh. || wasn't concat operator in MySQL after all. I just recently tested
 that it didn't give an error so I assumed it was concat, not logical
 or. :)
 
   I believe these errors were from my first attempt, when I just had
   '/mail/' || home as userdb_home.
 
 You should have used instead: concat('mail', home) as userdb_home
 
 I just tried: concat('mail/', home) as userdb_home

Was it really 'mail/', not '/mail/'? I forgot those / characters above..

 If I try: concat('maildir:/mail/', home) as userdb_mail
 (leaving the old config mail_location = maildir:/mail/:INDEX=MEMORY)
 
 I get the same squirrelmail error and this in dovecot-info.log
 Dec  9 12:49:13 webmail02 dovecot: Fatal: Mailbox indexes in 
 /mail/r/l/rls/Maildir/ are in NFS mount. You must set 
 mail_nfs_index=yes (and mail_nfs_storage=yes) to avoid index 
 corruptions. If you're sure this check was wrong, set nfs_check=no.
 
 which I assume is due to there being no INDEX=MEMORY anywhere.

Right, you should have added that to the concat() also. The point of
userdb_mail is that it completely overrides mail_location setting's
value.


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-09 Thread Richard Stockton

At 01:10 PM 12/9/2009, Timo Sirainen wrote:

On Wed, 2009-12-09 at 13:05 -0800, Richard Stockton wrote:
 I just tried: concat('mail/', home) as userdb_home

Was it really 'mail/', not '/mail/'? I forgot those / characters above..


Yes, I figured the maildir:~/ was putting in the first /.


 If I try: concat('maildir:/mail/', home) as userdb_mail
 (leaving the old config mail_location = maildir:/mail/:INDEX=MEMORY)

 I get the same squirrelmail error and this in dovecot-info.log
 Dec  9 12:49:13 webmail02 dovecot: Fatal: Mailbox indexes in
 /mail/r/l/rls/Maildir/ are in NFS mount. You must set
 mail_nfs_index=yes (and mail_nfs_storage=yes) to avoid index
 corruptions. If you're sure this check was wrong, set nfs_check=no.

 which I assume is due to there being no INDEX=MEMORY anywhere.

Right, you should have added that to the concat() also. The point of
userdb_mail is that it completely overrides mail_location setting's
value.


Hey!  I think I got it!
concat('maildir:/mail/', home, ':INDEX=MEMORY') as userdb_mail,
seems to do the trick, and should be compatible with 1.2.x, right?

Next step, update to 1.2...  Anything else I should be watching out for?

Thanks for sticking with me through all this, I really appreciate it.
 - Richard



Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-09 Thread Timo Sirainen
On Wed, 2009-12-09 at 13:23 -0800, Richard Stockton wrote:
 At 01:10 PM 12/9/2009, Timo Sirainen wrote:
 On Wed, 2009-12-09 at 13:05 -0800, Richard Stockton wrote:
   I just tried: concat('mail/', home) as userdb_home
 
 Was it really 'mail/', not '/mail/'? I forgot those / characters above..
 
 Yes, I figured the maildir:~/ was putting in the first /.

No, that simply converted it to:

maildir:mail/.../

 Next step, update to 1.2...  Anything else I should be watching out for?

Hopefully not.



signature.asc
Description: This is a digitally signed message part


[Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-08 Thread Proskurin Kirill

Hello.

I have this:

/usr/local/etc/dovecot.conf:
mail_location = maildir:/var/spool/dovecot/domains/%d/%n

/usr/local/etc/dovecot-ldap.conf:
user_attrs = mailQuotaSize=quota_rule=*:storage=%$M 
,=uid=1002,=gid=1002,=home=/var/spool/dovecot/domains/%d/%n


Two absolute paths seems to it is not right(but it works good...)

Right way will be:
mail_location = maildir:%d/%n

=home=/var/spool/dovecot/domains/

?

--
Best regards,
Proskurin Kirill


Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-08 Thread Timo Sirainen
On Dec 8, 2009, at 4:48 AM, Proskurin Kirill wrote:

 /usr/local/etc/dovecot.conf:
 mail_location = maildir:/var/spool/dovecot/domains/%d/%n
 
 /usr/local/etc/dovecot-ldap.conf:
 user_attrs = mailQuotaSize=quota_rule=*:storage=%$M 
 ,=uid=1002,=gid=1002,=home=/var/spool/dovecot/domains/%d/%n
 
 Two absolute paths seems to it is not right(but it works good...)

With the LDAP home you could use:

mail_location = maildir:~/

Although I wouldn't recommend using maildir = home, better would be:

mail_location = maildir:~/Maildir

http://wiki.dovecot.org/VirtualUsers/Home



Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-08 Thread Noel Butler
On Tue, 2009-12-08 at 10:26 -0500, Timo Sirainen wrote:

 On Dec 8, 2009, at 4:48 AM, Proskurin Kirill wrote:
 
  /usr/local/etc/dovecot.conf:
  mail_location = maildir:/var/spool/dovecot/domains/%d/%n
  
  /usr/local/etc/dovecot-ldap.conf:
  user_attrs = mailQuotaSize=quota_rule=*:storage=%$M 
  ,=uid=1002,=gid=1002,=home=/var/spool/dovecot/domains/%d/%n
  
  Two absolute paths seems to it is not right(but it works good...)
 
 With the LDAP home you could use:
 
 mail_location = maildir:~/
 
 Although I wouldn't recommend using maildir = home, better would be:
 
 mail_location = maildir:~/Maildir


I'm gunna but in here for a quick question :)

So, in using...

user_query = select 26 as uid, 26 as gid, '/var/vmail/%d/%1n/%1.1n/%
2.1n/%n' as home, snip

mail_location = maildir:/var/vmail/%d/%1n/%1.1n/%2.1n/%n/Maildir   

...  that is no longer the preferred way? 

We should just use mail_location = maildir:~/Maildiralong with our
existing user_query?

Obviously things work fine now, but may this change/break in the future?
Given it relies on 'deliver', but that does seems to query for home
using user_query.

Cheers



Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-08 Thread Timo Sirainen
On Wed, 2009-12-09 at 08:58 +1000, Noel Butler wrote:
 So, in using...
 
 user_query = select 26 as uid, 26 as gid, '/var/vmail/%d/%1n/%1.1n/%
 2.1n/%n' as home, snip
 
 mail_location = maildir:/var/vmail/%d/%1n/%1.1n/%2.1n/%n/Maildir   
 
 ...  that is no longer the preferred way? 

I don't think it's ever been the preferred way, since it's just
duplication of configuration. :) But you can keep doing it this way if
you want to. The only thing that v1.2 doesn't allow anymore is relative
home directory paths, and your home dir isn't relative.

 Obviously things work fine now, but may this change/break in the future?

No, it won't break.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-08 Thread Noel Butler
On Tue, 2009-12-08 at 18:20 -0500, Timo Sirainen wrote:

 On Wed, 2009-12-09 at 08:58 +1000, Noel Butler wrote:
  So, in using...
  
  user_query = select 26 as uid, 26 as gid, '/var/vmail/%d/%1n/%1.1n/%
  2.1n/%n' as home, snip
  
  mail_location = maildir:/var/vmail/%d/%1n/%1.1n/%2.1n/%n/Maildir   
  
  ...  that is no longer the preferred way? 
 
 I don't think it's ever been the preferred way, since it's just
 duplication of configuration. :) But you can keep doing it this way if
 you want to. The only thing that v1.2 doesn't allow anymore is relative
 home directory paths, and your home dir isn't relative.
 
  Obviously things work fine now, but may this change/break in the future?
 
 No, it won't break.
 


Cool, thanks :)




Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-08 Thread Richard Stockton

Hi Timo,

Okay, I'm confused now...

Here is what we are using with 1.1.19:

password_query = SELECT password, home as userdb_home, 5000 as userdb_uid,
 5000 as userdb_gid FROM mailbox where userid = '%n'

mail_location = maildir:/mail/%h:INDEX=MEMORY

The /mail/ dir contains 26 NFS mounted partitions.

Will this still work in 1.2?

I have been holding off upgrading because it sounded like I would have
to add the /mail/ prefix to all the home directories in my user DB,
and with 5 instances of Dovecot running off the same DB, I would have
to shut down the pop/imap servers for the upgrade, something that would
NOT make my boss happy.

However, if I can leave the configs and the database as they are, the
update will not be a big problem.  Please let me know if I can use the
old configs with Dovecot 1.2.x, I would love to be using the latest and
greatest.

And BTW, thanks again for all your hard work, Dovecot is a wonderful
piece of software, and we really appreciate it!
 - Richard



Re: [Dovecot] After upgrading to 1.2 - absolute path questions

2009-12-08 Thread Timo Sirainen
On Dec 8, 2009, at 7:01 PM, Richard Stockton wrote:

 Here is what we are using with 1.1.19:
 
 password_query = SELECT password, home as userdb_home, 5000 as userdb_uid,
 5000 as userdb_gid FROM mailbox where userid = '%n'
 
 mail_location = maildir:/mail/%h:INDEX=MEMORY

So you're using relative home directories.

 Will this still work in 1.2?

No. Change it to:

password_query = .., '/mail/' || home as userdb_mail, ..

Then the mail_location in dovecot.conf will be completely ignored.