Jeroen Massar
2013-Jul-08 10:17 UTC
[Dovecot] Mailbox statistics (sdbox / indexes) (+ wiki2 frontpage notes)
Hi, I used to, with a simple script, loop over the filenames in a Maildir, grab the From from the contents of the file and grab the flags (especially "READ" and "REPLIED") from the filename, but after moving to sdbox these flags are hidden in the index file. Is there anyway to get these out of there programmatically without having to resort to using an imap-client or is that the way to go? (I am effectively counting who has sent the most mail to a mailbox and how many of the the messages have been and have not been replied to; thus another answer would be: "I got a stats program for mailboxes") Greets, Jeroen PS: just reverted the wiki2 Frontpage, apparently even bots know who the author of the IMAP protocol is (leading me to believe that that check does not work): http://wiki2.dovecot.org/FrontPage?action=info I could not find a "revert" button thus copied&pasta'd the previous edition in there. PS2: there seems to be a master.wiki2.dovecot.org and a wiki2.dovecot.org; logging in on the one does not log in on the other, and accounts on the one are different from the other, and it seems cookies go missing also somewhere, hence why an IP is logged and not my account (which I used to have, now was missing and thus I recreated, but needed to do that on both boxes)
Robert Schetterer
2013-Jul-08 10:55 UTC
[Dovecot] Mailbox statistics (sdbox / indexes) (+ wiki2 frontpage notes)
Am 08.07.2013 12:17, schrieb Jeroen Massar:> Hi, > > I used to, with a simple script, loop over the filenames in a Maildir, > grab the From from the contents of the file and grab the flags > (especially "READ" and "REPLIED") from the filename, but after moving to > sdbox these flags are hidden in the index file. > > Is there anyway to get these out of there programmatically without > having to resort to using an imap-client or is that the way to go? > > (I am effectively counting who has sent the most mail to a mailbox and > how many of the the messages have been and have not been replied to; > thus another answer would be: "I got a stats program for mailboxes") > > Greets, > Jeroenyou may have a look at http://wiki2.dovecot.org/Tools/Doveadm/SearchQuery> > PS: just reverted the wiki2 Frontpage, apparently even bots know who the > author of the IMAP protocol is (leading me to believe that that check > does not work): http://wiki2.dovecot.org/FrontPage?action=info > I could not find a "revert" button thus copied&pasta'd the previous > edition in there. > > PS2: there seems to be a master.wiki2.dovecot.org and a > wiki2.dovecot.org; logging in on the one does not log in on the other, > and accounts on the one are different from the other, and it seems > cookies go missing also somewhere, hence why an IP is logged and not my > account (which I used to have, now was missing and thus I recreated, but > needed to do that on both boxes) >Best Regards MfG Robert Schetterer -- [*] sys4 AG http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstra?e 15, 81669 M?nchen Sitz der Gesellschaft: M?nchen, Amtsgericht M?nchen: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
Timo Sirainen
2013-Jul-10 06:24 UTC
[Dovecot] Mailbox statistics (sdbox / indexes) (+ wiki2 frontpage notes)
On Mon, 2013-07-08 at 12:17 +0200, Jeroen Massar wrote:> I used to, with a simple script, loop over the filenames in a Maildir, > grab the From from the contents of the file and grab the flags > (especially "READ" and "REPLIED") from the filename, but after moving to > sdbox these flags are hidden in the index file. > > Is there anyway to get these out of there programmatically without > having to resort to using an imap-client or is that the way to go?\Seen flags can be very efficiently looked up with doveadm mailbox status 'messages unseen' INBOX. \Replied flag requires going through the index, which is a little bit slower, but still quite fast: doveadm search mailbox INBOX replied> PS: just reverted the wiki2 Frontpage, apparently even bots know who the > author of the IMAP protocol is (leading me to believe that that check > does not work): http://wiki2.dovecot.org/FrontPage?action=info > I could not find a "revert" button thus copied&pasta'd the previous > edition in there.The check works well enough currently. I change it only when enough bots learn the answer that I have to keep reverting the changes several times a week.> PS2: there seems to be a master.wiki2.dovecot.org and a > wiki2.dovecot.org; logging in on the one does not log in on the other, > and accounts on the one are different from the other, and it seems > cookies go missing also somewhere, hence why an IP is logged and not my > account (which I used to have, now was missing and thus I recreated, but > needed to do that on both boxes)Hmm. The way it works is that all edits go to master.wiki* server and they are rsynced to the two mirror wiki* servers. I hadn't really thought of users before. Only users created on master.wiki* are preserved, the others will get deleted after the next rsync. I guess there should be some kind of redirection to master.wiki also when creating a user, maybe also when logging in, but that would require some more moinmoin patching.. Anyone want to do that? :) http://dovecot.org/tmp/moin-1.9.3-master-mirror.diff is my current patch.