Re: [Dovecot] problem migrating from maildir to dbox

2011-09-12 Thread Timo Sirainen
You changed the mail_location globally to dbox? You should instead do it
one user at a time, like explained in
http://wiki2.dovecot.org/Tools/Dsync (with initial dsync done before
user's mail_location is ever changed).

Otherwise you'll get these duplicate INBOXes and you'll need to somehow
manually figure out how to merge them. There are "doveadm move" and
"doveadm mailbox delete" commands for example.

On Mon, 2011-09-12 at 15:38 +0200, Ramón Frontera wrote:
> While the dovecot is running with the new mail_location to dbox, I try to 
> migrate the maildir content.
> This is the reason because INBOX already exists.
> 
> --
> --
>   Ramon Frontera Gallardo
>   Centre de Tecnologies de la Informació  
>   Universitat de les Illes Balears
>   Ctra. Valldemossa km 7,5
>   07122 Palma de Mallorca
> 
> 
> 
> 
> El 12/09/2011, a las 14:06, Timo Sirainen escribió:
> 
> > On Mon, 2011-09-12 at 13:52 +0200, Ramón Frontera wrote:
>  After that we use dsync -u user mirror maildir:~/Maildir.
>  The problem is that if INBOX exists the dsync create a new folder with 
>  name like b5893c0a93ff694e55122dfa3112
>  Can I migrate to the existing INBOX? or How can I merge the 2 INBOX 
>  folders?
> > 
> > Have you created the dbox directory before running dsync? And opened it
> > with some tool? I tried with your config and it worked fine.
> > 
> > The reason why these duplicate INBOXes happen is when INBOX exists both
> > in source and in destination when dsync is run. Typically this means
> > that you've created the destination INBOX already by e.g. logging in or
> > delivering a mail there or something..
> > 
> > 
> 




Re: [Dovecot] problem migrating from maildir to dbox

2011-09-12 Thread Ramón Frontera
While the dovecot is running with the new mail_location to dbox, I try to 
migrate the maildir content.
This is the reason because INBOX already exists.

--
--
  Ramon Frontera Gallardo
  Centre de Tecnologies de la Informació  
  Universitat de les Illes Balears
  Ctra. Valldemossa km 7,5
  07122 Palma de Mallorca




El 12/09/2011, a las 14:06, Timo Sirainen escribió:

> On Mon, 2011-09-12 at 13:52 +0200, Ramón Frontera wrote:
 After that we use dsync -u user mirror maildir:~/Maildir.
 The problem is that if INBOX exists the dsync create a new folder with 
 name like b5893c0a93ff694e55122dfa3112
 Can I migrate to the existing INBOX? or How can I merge the 2 INBOX 
 folders?
> 
> Have you created the dbox directory before running dsync? And opened it
> with some tool? I tried with your config and it worked fine.
> 
> The reason why these duplicate INBOXes happen is when INBOX exists both
> in source and in destination when dsync is run. Typically this means
> that you've created the destination INBOX already by e.g. logging in or
> delivering a mail there or something..
> 
> 



Re: [Dovecot] problem migrating from maildir to dbox

2011-09-12 Thread Timo Sirainen
On Mon, 2011-09-12 at 13:52 +0200, Ramón Frontera wrote:
> >> After that we use dsync -u user mirror maildir:~/Maildir.
> >> The problem is that if INBOX exists the dsync create a new folder with 
> >> name like b5893c0a93ff694e55122dfa3112
> >> Can I migrate to the existing INBOX? or How can I merge the 2 INBOX 
> >> folders?

Have you created the dbox directory before running dsync? And opened it
with some tool? I tried with your config and it worked fine.

The reason why these duplicate INBOXes happen is when INBOX exists both
in source and in destination when dsync is run. Typically this means
that you've created the destination INBOX already by e.g. logging in or
delivering a mail there or something..




Re: [Dovecot] problem migrating from maildir to dbox

2011-09-12 Thread Ramón Frontera
hello,
thanks in advance!
Regards,

$ dovecot -n
# 2.0.13: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-131.6.1.el6.x86_64 x86_64 Red Hat Enterprise Linux Server 
release 6.1 (Santiago) nfs
base_dir = /var/run/dovecot/
first_valid_uid = 96
listen = 10.80.82.21
log_path = /var/log/dovecot.log
mail_gid = 97
mail_location = sdbox:/vmail/0/%u/dbox
mail_plugins = acl quota mail_log notify
mail_uid = 97
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date
mbox_write_locks = fcntl
mmap_disable = yes
namespace {
  hidden = no
  inbox = yes
  list = yes
  location = 
  prefix = 
  separator = /
  subscriptions = yes
  type = private
}
namespace {
  hidden = no
  inbox = no
  list = children
  location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%n
  prefix = shared/%%n/
  separator = /
  subscriptions = no
  type = shared
}
passdb {
  driver = pam
}
passdb {
  args = /etc/dovecot/dovecot-ldap-pass.conf.ext.local
  driver = ldap
}
passdb {
  args = scheme=plain username_format=%u /etc/dovecot/imap.passwd
  driver = passwd-file
}
plugin {
  acl = vfile
  acl_shared_dict = file:/vmail/1/dovecot/shared-mailboxes
  quota = maildir:User quota
  quota_rule = *:storage=2500M
  quota_rule2 = Trash:storage=+500M
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
}
postmaster_address = xavier.p...@uib.es
protocols = imap pop3 lmtp sieve
service auth {
  unix_listener auth-userdb {
group = vmail
mode = 0660
  }
}
service imap-login {
  inet_listener imap {
port = 143
  }
  inet_listener imaps {
port = 993
ssl = yes
  }
}
service lmtp {
  inet_listener lmtp {
port = 30025
  }
}
service pop3-login {
  inet_listener pop3 {
port = 110
  }
  inet_listener pop3s {
port = 995
ssl = yes
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
user = vmail
  }
  user = dovecot
}
ssl = required
ssl_cert =  On Fri, 2011-09-09 at 14:19 +0200, Ramón Frontera wrote:
>> Hello,
>> we want to migrate Mail folders from Maildir to dbox without downtime.
>> We change the mail_location to dbox in 10-mail.conf and restart dovecot.
>> After that we use dsync -u user mirror maildir:~/Maildir.
>> The problem is that if INBOX exists the dsync create a new folder with name 
>> like b5893c0a93ff694e55122dfa3112
>> Can I migrate to the existing INBOX? or How can I merge the 2 INBOX folders?
> 
> dovecot -n output?
> 
> 



Re: [Dovecot] problem migrating from maildir to dbox

2011-09-12 Thread Timo Sirainen
On Fri, 2011-09-09 at 14:19 +0200, Ramón Frontera wrote:
> Hello,
> we want to migrate Mail folders from Maildir to dbox without downtime.
> We change the mail_location to dbox in 10-mail.conf and restart dovecot.
> After that we use dsync -u user mirror maildir:~/Maildir.
> The problem is that if INBOX exists the dsync create a new folder with name 
> like b5893c0a93ff694e55122dfa3112
> Can I migrate to the existing INBOX? or How can I merge the 2 INBOX folders?

dovecot -n output?




Re: [Dovecot] problem migrating from maildir to dbox

2011-09-09 Thread Захаров Роман

09.09.2011 16:19, Ramón Frontera пишет:

Hello,
we want to migrate Mail folders from Maildir to dbox without downtime.
We change the mail_location to dbox in 10-mail.conf and restart dovecot.
After that we use dsync -u user mirror maildir:~/Maildir.
The problem is that if INBOX exists the dsync create a new folder with name 
like b5893c0a93ff694e55122dfa3112
Can I migrate to the existing INBOX? or How can I merge the 2 INBOX folders?
Thanks for your help!
Regards,

--
Ramon




My transition from maildir to mdbox occurred so:
/Maildir - an old place of mail
/Mailbox - new

mail_location=%h # set home for all users maildir:/Maildir/user_name

script:
for i in `echo "select name from user|$sql`
do
   res=$(dsync -u $i backup mdbox:/Mailbox/$i)
   if [ $res -eq 0 ];then
  echo "update user set home=\"mdbox:/Mailbox/$i\" where 
name=$i"|$sql

  echo "$i migrated" >> $log
   fi
done


Re: [Dovecot] problem migrating from maildir to dbox

2011-09-09 Thread Захаров Роман

09.09.2011 16:19, Ramón Frontera пишет:

Hello,
we want to migrate Mail folders from Maildir to dbox without downtime.
We change the mail_location to dbox in 10-mail.conf and restart dovecot.
After that we use dsync -u user mirror maildir:~/Maildir.
The problem is that if INBOX exists the dsync create a new folder with name 
like b5893c0a93ff694e55122dfa3112
Can I migrate to the existing INBOX? or How can I merge the 2 INBOX folders?
Thanks for your help!
Regards,

--
Ramon




My transition from maildir to mdbox occurred so:
/Maildir - an old place of mail
/Mailbox - new

mail_location=%h # set home for all users maildir:/Maildir/user_name

script:
for i in `echo "select name from user|$sql`
do
   res=$(dsync -u $i backup mdbox:/Mailbox/$i)
   if [ $res -eq 0 ];then
  echo "update user set home=\"mdbox:/Mailbox/$i\" where 
name=$i"|$sql

  echo "$i migrated" >> $log
   fi
done