Re: Simple way to get mailbox size by folder.

2016-12-13 Thread Aki Tuomi
Hi!

You could use doveadm http api instead. See 
http://wiki2.dovecot.org/Design/DoveadmProtocol/HTTP

It takes same parameters as command line.

Aki

> On December 13, 2016 at 6:25 PM Vijay Sarvepalli  wrote:
> 
> 
> Hello Mike and Aki,
> 
> Thanks for the response.  I had  been using FETCH 1:* in my IMAP module,
> but found it slow with folders with lots of messages or even large-sized
> messages folder.  The doveadm seems elegant and faster but I hate to fork a
> command line from web-UI, for obvious security and performance reasons.  It
> will be great if dovecot team will consider IMAP extensions to release
> doveadm features when useful/relevant like this.
> 
> Regards
> Vijay
> 
> On Mon, Dec 5, 2016 at 6:27 PM, Michael Slusarz 
> wrote:
> 
> > On 12/3/2016 2:53 PM, Aki Tuomi wrote:
> >
> >>
> >> On December 3, 2016 at 11:16 PM Vijay Sarvepalli 
> >>> wrote:
> >>>
> >>>
> >>> Is there a simple way to get each mailbox size using dovecot's IMAP
> >>> interface?  The GETQUOTAROOT and GETQUOTA seems to work with the full
> >>> maildir size and not the individual folders.
> >>>
> >>> I am finding a simple way for the webmail client to show usage of each
> >>> folder.
> >>>
> >>> Thanks
> >>> Vijay
> >>>
> >>
> >> $ doveadm mailbox status -u cmouse all INBOX
> >> INBOX messages=9206 recent=0 uidnext=33115 uidvalidity=1451655531
> >> unseen=7 highestmodseq=39954  vsize=538582181 
> >> guid=d595a62d65818656f72c7
> >> 4be03de
> >>
> >> $ doveadm -fjson mailbox status -u cmo...@cmouse.fi all INBOX
> >> [{"mailbox":"INBOX","messages":"9206","recent":"0","uidnext"
> >> :"33115","uidvalidity":"1451655531","unseen":"7","highestmod
> >> seq":"39954","vsize":"538582181","guid":"d595a62d658
> >> 18656f72c74be03de"}]
> >>
> >
> > If you want an IMAP specific method (rather than doveadm), you are stuck
> > with "FETCH 1:* (RFC822.SIZE)".  With the nasty requirement - if you want
> > 100% full accuracy - that you need to track responses to ensure that each
> > size is only counted once.  Practically speaking this shouldn't happen by
> > any reasonable server, but the warning needs to be made.
> >
> > michael
> >


Re: Simple way to get mailbox size by folder.

2016-12-13 Thread Aki Tuomi
Hi!

You could use doveadm http api instead. See 
http://wiki2.dovecot.org/Design/DoveadmProtocol/HTTP

It takes same parameters as command line.

Aki

> On December 13, 2016 at 6:25 PM Vijay Sarvepalli  wrote:
> 
> 
> Hello Mike and Aki,
> 
> Thanks for the response.  I had  been using FETCH 1:* in my IMAP module,
> but found it slow with folders with lots of messages or even large-sized
> messages folder.  The doveadm seems elegant and faster but I hate to fork a
> command line from web-UI, for obvious security and performance reasons.  It
> will be great if dovecot team will consider IMAP extensions to release
> doveadm features when useful/relevant like this.
> 
> Regards
> Vijay
> 
> On Mon, Dec 5, 2016 at 6:27 PM, Michael Slusarz 
> wrote:
> 
> > On 12/3/2016 2:53 PM, Aki Tuomi wrote:
> >
> >>
> >> On December 3, 2016 at 11:16 PM Vijay Sarvepalli 
> >>> wrote:
> >>>
> >>>
> >>> Is there a simple way to get each mailbox size using dovecot's IMAP
> >>> interface?  The GETQUOTAROOT and GETQUOTA seems to work with the full
> >>> maildir size and not the individual folders.
> >>>
> >>> I am finding a simple way for the webmail client to show usage of each
> >>> folder.
> >>>
> >>> Thanks
> >>> Vijay
> >>>
> >>
> >> $ doveadm mailbox status -u cmouse all INBOX
> >> INBOX messages=9206 recent=0 uidnext=33115 uidvalidity=1451655531
> >> unseen=7 highestmodseq=39954  vsize=538582181 
> >> guid=d595a62d65818656f72c7
> >> 4be03de
> >>
> >> $ doveadm -fjson mailbox status -u cmo...@cmouse.fi all INBOX
> >> [{"mailbox":"INBOX","messages":"9206","recent":"0","uidnext"
> >> :"33115","uidvalidity":"1451655531","unseen":"7","highestmod
> >> seq":"39954","vsize":"538582181","guid":"d595a62d658
> >> 18656f72c74be03de"}]
> >>
> >
> > If you want an IMAP specific method (rather than doveadm), you are stuck
> > with "FETCH 1:* (RFC822.SIZE)".  With the nasty requirement - if you want
> > 100% full accuracy - that you need to track responses to ensure that each
> > size is only counted once.  Practically speaking this shouldn't happen by
> > any reasonable server, but the warning needs to be made.
> >
> > michael
> >


Re: Simple way to get mailbox size by folder.

2016-12-13 Thread Sami Ketola

Hi,

In that case you might be better of using the doveadm http api for accessing 
the information over http/json interface:

http://wiki2.dovecot.org/Design/DoveadmProtocol/HTTP

Sami

> On 14 Dec 2016, at 1.25, Vijay Sarvepalli  wrote:
> 
> Hello Mike and Aki,
> 
> Thanks for the response.  I had  been using FETCH 1:* in my IMAP module,
> but found it slow with folders with lots of messages or even large-sized
> messages folder.  The doveadm seems elegant and faster but I hate to fork a
> command line from web-UI, for obvious security and performance reasons.  It
> will be great if dovecot team will consider IMAP extensions to release
> doveadm features when useful/relevant like this.
> 
> Regards
> Vijay
> 
> On Mon, Dec 5, 2016 at 6:27 PM, Michael Slusarz 
> wrote:
> 
>> On 12/3/2016 2:53 PM, Aki Tuomi wrote:
>> 
>>> 
>>> On December 3, 2016 at 11:16 PM Vijay Sarvepalli 
 wrote:
 
 
 Is there a simple way to get each mailbox size using dovecot's IMAP
 interface?  The GETQUOTAROOT and GETQUOTA seems to work with the full
 maildir size and not the individual folders.
 
 I am finding a simple way for the webmail client to show usage of each
 folder.
 
 Thanks
 Vijay
 
>>> 
>>> $ doveadm mailbox status -u cmouse all INBOX
>>> INBOX messages=9206 recent=0 uidnext=33115 uidvalidity=1451655531
>>> unseen=7 highestmodseq=39954  vsize=538582181 guid=d595a62d65818656f72c7
>>> 4be03de
>>> 
>>> $ doveadm -fjson mailbox status -u cmo...@cmouse.fi all INBOX
>>> [{"mailbox":"INBOX","messages":"9206","recent":"0","uidnext"
>>> :"33115","uidvalidity":"1451655531","unseen":"7","highestmod
>>> seq":"39954","vsize":"538582181","guid":"d595a62d658
>>> 18656f72c74be03de"}]
>>> 
>> 
>> If you want an IMAP specific method (rather than doveadm), you are stuck
>> with "FETCH 1:* (RFC822.SIZE)".  With the nasty requirement - if you want
>> 100% full accuracy - that you need to track responses to ensure that each
>> size is only counted once.  Practically speaking this shouldn't happen by
>> any reasonable server, but the warning needs to be made.
>> 
>> michael
>> 


Re: Simple way to get mailbox size by folder.

2016-12-13 Thread Vijay Sarvepalli
Hello Mike and Aki,

Thanks for the response.  I had  been using FETCH 1:* in my IMAP module,
but found it slow with folders with lots of messages or even large-sized
messages folder.  The doveadm seems elegant and faster but I hate to fork a
command line from web-UI, for obvious security and performance reasons.  It
will be great if dovecot team will consider IMAP extensions to release
doveadm features when useful/relevant like this.

Regards
Vijay

On Mon, Dec 5, 2016 at 6:27 PM, Michael Slusarz 
wrote:

> On 12/3/2016 2:53 PM, Aki Tuomi wrote:
>
>>
>> On December 3, 2016 at 11:16 PM Vijay Sarvepalli 
>>> wrote:
>>>
>>>
>>> Is there a simple way to get each mailbox size using dovecot's IMAP
>>> interface?  The GETQUOTAROOT and GETQUOTA seems to work with the full
>>> maildir size and not the individual folders.
>>>
>>> I am finding a simple way for the webmail client to show usage of each
>>> folder.
>>>
>>> Thanks
>>> Vijay
>>>
>>
>> $ doveadm mailbox status -u cmouse all INBOX
>> INBOX messages=9206 recent=0 uidnext=33115 uidvalidity=1451655531
>> unseen=7 highestmodseq=39954  vsize=538582181 guid=d595a62d65818656f72c7
>> 4be03de
>>
>> $ doveadm -fjson mailbox status -u cmo...@cmouse.fi all INBOX
>> [{"mailbox":"INBOX","messages":"9206","recent":"0","uidnext"
>> :"33115","uidvalidity":"1451655531","unseen":"7","highestmod
>> seq":"39954","vsize":"538582181","guid":"d595a62d658
>> 18656f72c74be03de"}]
>>
>
> If you want an IMAP specific method (rather than doveadm), you are stuck
> with "FETCH 1:* (RFC822.SIZE)".  With the nasty requirement - if you want
> 100% full accuracy - that you need to track responses to ensure that each
> size is only counted once.  Practically speaking this shouldn't happen by
> any reasonable server, but the warning needs to be made.
>
> michael
>


Re: Simple way to get mailbox size by folder.

2016-12-05 Thread Michael Slusarz

On 12/3/2016 2:53 PM, Aki Tuomi wrote:



On December 3, 2016 at 11:16 PM Vijay Sarvepalli  wrote:


Is there a simple way to get each mailbox size using dovecot's IMAP
interface?  The GETQUOTAROOT and GETQUOTA seems to work with the full
maildir size and not the individual folders.

I am finding a simple way for the webmail client to show usage of each
folder.

Thanks
Vijay


$ doveadm mailbox status -u cmouse all INBOX
INBOX messages=9206 recent=0 uidnext=33115 uidvalidity=1451655531 unseen=7 
highestmodseq=39954  vsize=538582181 guid=d595a62d65818656f72c74be03de

$ doveadm -fjson mailbox status -u cmo...@cmouse.fi all INBOX
[{"mailbox":"INBOX","messages":"9206","recent":"0","uidnext":"33115","uidvalidity":"1451655531","unseen":"7","highestmodseq":"39954","vsize":"538582181","guid":"d595a62d65818656f72c74be03de"}]


If you want an IMAP specific method (rather than doveadm), you are 
stuck with "FETCH 1:* (RFC822.SIZE)".  With the nasty requirement - if 
you want 100% full accuracy - that you need to track responses to ensure 
that each size is only counted once.  Practically speaking this 
shouldn't happen by any reasonable server, but the warning needs to be made.


michael


Re: Simple way to get mailbox size by folder.

2016-12-03 Thread Aki Tuomi

> On December 3, 2016 at 11:16 PM Vijay Sarvepalli  wrote:
> 
> 
> Is there a simple way to get each mailbox size using dovecot's IMAP
> interface?  The GETQUOTAROOT and GETQUOTA seems to work with the full
> maildir size and not the individual folders.
> 
> I am finding a simple way for the webmail client to show usage of each
> folder.
> 
> Thanks
> Vijay

$ doveadm mailbox status -u cmouse all INBOX
INBOX messages=9206 recent=0 uidnext=33115 uidvalidity=1451655531 unseen=7 
highestmodseq=39954  vsize=538582181 guid=d595a62d65818656f72c74be03de

$ doveadm -fjson mailbox status -u cmo...@cmouse.fi all INBOX
[{"mailbox":"INBOX","messages":"9206","recent":"0","uidnext":"33115","uidvalidity":"1451655531","unseen":"7","highestmodseq":"39954","vsize":"538582181","guid":"d595a62d65818656f72c74be03de"}]

JSON support might not be available in your version, if it's old enough.

Aki


Simple way to get mailbox size by folder.

2016-12-03 Thread Vijay Sarvepalli
Is there a simple way to get each mailbox size using dovecot's IMAP
interface?  The GETQUOTAROOT and GETQUOTA seems to work with the full
maildir size and not the individual folders.

I am finding a simple way for the webmail client to show usage of each
folder.

Thanks
Vijay