Re: [Dovecot] Dsync ignores INBOX when converting from mbox to maildir

2010-08-03 Thread Henrique Fernandes
Thanks for the explanation.

[]'sf.rique


On Tue, Aug 3, 2010 at 11:57 AM, Timo Sirainen  wrote:

> On Tue, 2010-08-03 at 11:20 -0300, Henrique Fernandes wrote:
>
> > Like
> > location1 is production.
> >
> > location1 has 1000 emails.
> >
> > I mirror it to location2
> >
> > Now the owner of location1 deletes some emails! and have now 989
> >
> > If i do mirroging again, it has to choose if it will copy back from
> > location2 to location1 or erase mails in location2
> >
> > How does it decide with one its going to do ?
>
> If mails are deleted in location1, mirroring causes the mails to be
> deleted from location2 as well. If new mails are added to location2,
> they are copied to location1. This is pretty easy to handle because in
> IMAP the UID numbers always grow, so if you see UIDs 1,5,10 in location1
> and UIDs 1,10 in location2, you'll know that in location1 UID 5 was
> deleted. UIDs at the end of the mailbox are then handled specially by
> looking up from index files if they were actually deleted. And there is
> some conflict checking also by looking message GUIDs.
>
> http://wiki2.dovecot.org/Design/Dsync has also some text about how the
> syncing works internally. I should update it though..
>
>


Re: [Dovecot] Dsync ignores INBOX when converting from mbox to maildir

2010-08-03 Thread Timo Sirainen
On Tue, 2010-08-03 at 11:20 -0300, Henrique Fernandes wrote:

> Like
> location1 is production.
> 
> location1 has 1000 emails.
> 
> I mirror it to location2
> 
> Now the owner of location1 deletes some emails! and have now 989
> 
> If i do mirroging again, it has to choose if it will copy back from
> location2 to location1 or erase mails in location2
> 
> How does it decide with one its going to do ?

If mails are deleted in location1, mirroring causes the mails to be
deleted from location2 as well. If new mails are added to location2,
they are copied to location1. This is pretty easy to handle because in
IMAP the UID numbers always grow, so if you see UIDs 1,5,10 in location1
and UIDs 1,10 in location2, you'll know that in location1 UID 5 was
deleted. UIDs at the end of the mailbox are then handled specially by
looking up from index files if they were actually deleted. And there is
some conflict checking also by looking message GUIDs.

http://wiki2.dovecot.org/Design/Dsync has also some text about how the
syncing works internally. I should update it though..



Re: [Dovecot] Dsync ignores INBOX when converting from mbox to maildir

2010-08-03 Thread Henrique Fernandes
Timo, if it does mirroring, i does matter the way!

it has to choose one location to mirror.

Like
location1 is production.

location1 has 1000 emails.

I mirror it to location2

Now the owner of location1 deletes some emails! and have now 989

If i do mirroging again, it has to choose if it will copy back from
location2 to location1 or erase mails in location2

How does it decide with one its going to do ?


[]'sf.rique


On Fri, Jul 23, 2010 at 12:38 PM, Henrique Fernandes wrote:

> Oh, ok.
>
> I thought it did mirroring by the one location, even if the other location
> is newer!
>
>
> []'sf.rique
>
>
> On Thu, Jul 22, 2010 at 5:54 PM, Timo Sirainen  wrote:
>
>> On 22.7.2010, at 21.11, Henrique Fernandes wrote:
>>
>> > location1 is mdbox:~/mdbox  and location2 is maildir:~/Maildir   Right ?
>>  or
>> > is backwards ? It takes location2 and convert to location1 ?
>> >
>> > The first guys  explain location1 to location2
>> >
>> > Wich one is right ? Sorry i do not have any dovecot configured right
>> now!
>>
>> dsync does two way mirroring. It doesn't matter which one is location1 and
>> which one location2.
>>
>>
>


Re: [Dovecot] Dsync ignores INBOX when converting from mbox to maildir

2010-08-03 Thread Henrique Fernandes
Timo, if it does mirroring, i does matter the way!

it has to choose one location to mirror.

Like
location1 is production.

location1 has 1000 emails.

I mirror it to location2

Now the owner of location1 deletes some emails! and have now 989

If i do mirroging again, it has to choose if it will copy back from
location2 to location1 or erase mails in location2

How does it decide with one its going to do ?


[]'sf.rique


On Fri, Jul 23, 2010 at 12:38 PM, Henrique Fernandes wrote:

> Oh, ok.
>
> I thought it did mirroring by the one location, even if the other location
> is newer!
>
>
> []'sf.rique
>
>
> On Thu, Jul 22, 2010 at 5:54 PM, Timo Sirainen  wrote:
>
>> On 22.7.2010, at 21.11, Henrique Fernandes wrote:
>>
>> > location1 is mdbox:~/mdbox  and location2 is maildir:~/Maildir   Right ?
>>  or
>> > is backwards ? It takes location2 and convert to location1 ?
>> >
>> > The first guys  explain location1 to location2
>> >
>> > Wich one is right ? Sorry i do not have any dovecot configured right
>> now!
>>
>> dsync does two way mirroring. It doesn't matter which one is location1 and
>> which one location2.
>>
>>
>


Re: [Dovecot] Dsync ignores INBOX when converting from mbox to maildir

2010-07-23 Thread Henrique Fernandes
Oh, ok.

I thought it did mirroring by the one location, even if the other location
is newer!


[]'sf.rique


On Thu, Jul 22, 2010 at 5:54 PM, Timo Sirainen  wrote:

> On 22.7.2010, at 21.11, Henrique Fernandes wrote:
>
> > location1 is mdbox:~/mdbox  and location2 is maildir:~/Maildir   Right ?
>  or
> > is backwards ? It takes location2 and convert to location1 ?
> >
> > The first guys  explain location1 to location2
> >
> > Wich one is right ? Sorry i do not have any dovecot configured right now!
>
> dsync does two way mirroring. It doesn't matter which one is location1 and
> which one location2.
>
>


Re: [Dovecot] Dsync ignores INBOX when converting from mbox to maildir

2010-07-22 Thread Timo Sirainen
On 22.7.2010, at 21.11, Henrique Fernandes wrote:

> location1 is mdbox:~/mdbox  and location2 is maildir:~/Maildir   Right ?  or
> is backwards ? It takes location2 and convert to location1 ?
> 
> The first guys  explain location1 to location2
> 
> Wich one is right ? Sorry i do not have any dovecot configured right now!

dsync does two way mirroring. It doesn't matter which one is location1 and 
which one location2.



Re: [Dovecot] Dsync ignores INBOX when converting from mbox to maildir

2010-07-22 Thread Henrique Fernandes
Is it right ?

Converting ☜ 

Assuming that the *mail_location* setting in *
/etc/dovecot/conf.d/10-mail.conf* is set to: *mail_location = mdbox:~/mdbox*,
a logged in system user may convert her/his mails from its Maildir in
her/his home directory to the mdbox mailbox format. The user has to execute
the command:

 *dsync mirror maildir:~/Maildir*


The comand above does not convert mdbox to maildir ?

location1 is mdbox:~/mdbox  and location2 is maildir:~/Maildir   Right ?  or
is backwards ? It takes location2 and convert to location1 ?

The first guys  explain location1 to location2

Wich one is right ? Sorry i do not have any dovecot configured right now!

Any way, in step 5 how would the comando know wich way it should convert
cause i change the conf.


[]'sf.rique


On Thu, Jul 22, 2010 at 4:28 PM, Timo Sirainen  wrote:

> On Thu, 2010-07-22 at 15:53 -0300, Henrique Fernandes wrote:
>
> > dsync -u -f 'u...@dom.com' mirror 'maildir:/path/maildir-format'
>
> -f -u u...@dom.com. Although -f isn't necessary at all.
>
> > and after i run this comand i have to change the config on my sql to the
> > user have the new maildir settings right ?
>
> Yes.
>
> > But now, i might have problems with emails sent when i am converting.
> After
> > change the setting on mysql, how can i convert the msg that arrived at
> same
> > time that convertion?  Thoses emals will be in mbox format and the dsyn
> will
> > see only maildir settings. Maybe using the parameter "-m"  after i change
> > the setting on mysql ?
>
> Just run dsync mirror again. See the "Converting" example in
> http://wiki2.dovecot.org/Tools/Dsync
>
>
>


Re: [Dovecot] Dsync ignores INBOX when converting from mbox to maildir

2010-07-22 Thread Timo Sirainen
On Thu, 2010-07-22 at 15:53 -0300, Henrique Fernandes wrote:

> dsync -u -f 'u...@dom.com' mirror 'maildir:/path/maildir-format'

-f -u u...@dom.com. Although -f isn't necessary at all.

> and after i run this comand i have to change the config on my sql to the
> user have the new maildir settings right ?

Yes.

> But now, i might have problems with emails sent when i am converting. After
> change the setting on mysql, how can i convert the msg that arrived at same
> time that convertion?  Thoses emals will be in mbox format and the dsyn will
> see only maildir settings. Maybe using the parameter "-m"  after i change
> the setting on mysql ?

Just run dsync mirror again. See the "Converting" example in
http://wiki2.dovecot.org/Tools/Dsync




Re: [Dovecot] Dsync ignores INBOX when converting from mbox to maildir

2010-07-22 Thread Jan Vítek

Tested, works now. Thanks.

JV

- Original Message - 
From: "Timo Sirainen" 

To: "Jan Vítek" 
Cc: 
Sent: Thursday, July 22, 2010 5:39 PM
Subject: Re: [Dovecot] Dsync ignores INBOX when converting from mbox to 
maildir



On Thu, 2010-07-22 at 16:09 +0200, Jan Vítek wrote:


I am trying to convert email box in mbox format to maildir++. It
converts all folders except INBOX. For example:

..

mail_location = mbox:~/mail:INBOX=/var/mail/%u


Fixed: http://hg.dovecot.org/dovecot-2.0/rev/459bd9621197





Re: [Dovecot] Dsync ignores INBOX when converting from mbox to maildir

2010-07-22 Thread Henrique Fernandes
I have a question,

before ( beta4 ) dsync had the convert command. Now it does not have anymore
right ?

All my emails are in mbox format. And i want to convert them to maildir.

Before on the testes, i had to configure userspaces ( i did that using mysql
per user configuration ) so the user now have maildir for mail_location, so
i used:  dsync -u us...@dom.com -m /path/mbox-formats/
I had the same probles with the inbox, after it i had to run the comando
again where the inbox was.

So, let me see if i got it.

Now, with the code from mercurial i have to.

do not change any configuration. and run

dsync -u -f 'u...@dom.com' mirror 'maildir:/path/maildir-format'

and after i run this comand i have to change the config on my sql to the
user have the new maildir settings right ?

But now, i might have problems with emails sent when i am converting. After
change the setting on mysql, how can i convert the msg that arrived at same
time that convertion?  Thoses emals will be in mbox format and the dsyn will
see only maildir settings. Maybe using the parameter "-m"  after i change
the setting on mysql ?


Thanks!


[]'sf.rique


On Thu, Jul 22, 2010 at 12:39 PM, Timo Sirainen  wrote:

> On Thu, 2010-07-22 at 16:09 +0200, Jan Vítek wrote:
>
> > I am trying to convert email box in mbox format to maildir++. It
> > converts all folders except INBOX. For example:
> ..
> > mail_location = mbox:~/mail:INBOX=/var/mail/%u
>
> Fixed: http://hg.dovecot.org/dovecot-2.0/rev/459bd9621197
>
>
>


Re: [Dovecot] Dsync ignores INBOX when converting from mbox to maildir

2010-07-22 Thread Timo Sirainen
On Thu, 2010-07-22 at 16:09 +0200, Jan Vítek wrote:

> I am trying to convert email box in mbox format to maildir++. It
> converts all folders except INBOX. For example:
..
> mail_location = mbox:~/mail:INBOX=/var/mail/%u

Fixed: http://hg.dovecot.org/dovecot-2.0/rev/459bd9621197