[Dovecot] Get the size of a maildir
Hello.
I would like to know it a 'proper' solution exist to get the size (in MB) of a maildir. Actually, to get it, I do a 'du -sh' but I'm not sure it is a good solution. And it does not return the same value than imap-quota.
Is there a command, a tool, in Dovecot to get it?
There is the maildirsize but it's very difficult to get the value with a script shell and with this file.
Thanks for your help.
Best regards,
--
- Nicolas.
On Thu, 2008-06-05 at 11:50 +0200, Nicolas Letellier wrote:
Hello.
I would like to know it a 'proper' solution exist to get the size (in MB) of a maildir. Actually, to get it, I do a 'du -sh' but I'm not sure it is a good solution. And it does not return the same value than imap-quota.
Is there a command, a tool, in Dovecot to get it?
There is the maildirsize but it's very difficult to get the value with a script shell and with this file.
How about using IMAP? Like:
printf "1 getquotaroot inbox\n" | dovecot --exec-mail imap
(or depending on your settings change $USER, $HOME or use netcat and master user login)
Le Thu, 05 Jun 2008 13:11:23 +0300, Timo Sirainen <tss@iki.fi> a écrit :
On Thu, 2008-06-05 at 11:50 +0200, Nicolas Letellier wrote:
Hello.
I would like to know it a 'proper' solution exist to get the size (in MB) of a maildir. Actually, to get it, I do a 'du -sh' but I'm not sure it is a good solution. And it does not return the same value than imap-quota.
Is there a command, a tool, in Dovecot to get it?
There is the maildirsize but it's very difficult to get the value with a script shell and with this file.
How about using IMAP? Like:
printf "1 getquotaroot inbox\n" | dovecot --exec-mail imap
(or depending on your settings change $USER, $HOME or use netcat and master user login)
Thanks for the response. It seems to be a good solution! But I don't know how use this tool. My mailboxes are in : /var/mail/vmails/domain.tld/username
How know the size of username@domain.tld with dovecot -exec-mail imap?
--
- Nicolas.
On Jun 5, 2008, at 1:25 PM, Nicolas Letellier wrote:
printf "1 getquotaroot inbox\n" | dovecot --exec-mail imap
(or depending on your settings change $USER, $HOME or use netcat and master user login)
Thanks for the response. It seems to be a good solution! But I don't know how use this tool. My mailboxes are in : /var/mail/vmails/domain.tld/username
And you use a single UID to access them?
How know the size of username@domain.tld with dovecot -exec-mail imap?
See if this works (run as the same system user as mailboxes are
normally accessed with):
export USER=username@domain.tld printf "1 getquotaroot inbox\n" | dovecot --exec-mail imap
If not, post your dovecot -n output.
Le Thu, 5 Jun 2008 13:32:59 +0300, Timo Sirainen <tss@iki.fi> a écrit :
On Jun 5, 2008, at 1:25 PM, Nicolas Letellier wrote:
printf "1 getquotaroot inbox\n" | dovecot --exec-mail imap
(or depending on your settings change $USER, $HOME or use netcat and master user login)
Thanks for the response. It seems to be a good solution! But I don't know how use this tool. My mailboxes are in : /var/mail/vmails/domain.tld/username
And you use a single UID to access them?
How know the size of username@domain.tld with dovecot -exec-mail imap?
See if this works (run as the same system user as mailboxes are
normally accessed with):export USER=username@domain.tld printf "1 getquotaroot inbox\n" | dovecot --exec-mail imap
If not, post your dovecot -n output. It works perfectly. I made a shell script to get maildirsize, it's ok.
Thanks for the tip :-)
--
- Nicolas.
participants (2)
-
Nicolas Letellier
-
Timo Sirainen