mail-trends+Dovecot

Odhiambo Washington odhiambo at gmail.com
Sat Jan 21 21:11:13 UTC 2017


Hi,

Out of curiosity, has anyone managed to use mail-trends[0] to analyse their
e-mails.

I thought about trying it out, but got stuck midstream.

The mail-trends scripts work very well with gmail, but because they say it
is supposed to work with _any_ IMAP server, I thought I could get it
running with Dovecot too.

I know this is NOT a mail-trends support group though, but I believe there
is something minor that I am missing, which Dovecot admins could figure out.

My idea was to see what comes out of my e-mails stored either in Maildir or
mdbox.

In my test env, I have

mail_location = maildir:/var/spool/virtual/%d/%n/Maildir:INDEX=MEMORY

I am testing with a virtual account, whose e-mails are in Maildir/ - some
30,000 mails.

The gotcha is that I cannot figure out exactly what to specify in mail.py
(for mail-trends [0]) for this situation.

There is another modified version of mail-trends[1] which is supposed to be
a lot easier than the original one, but this too doesn't seem to work in my
setup:

1. My doveconf output -> http://bit.ly/2k11iKb
2. Accounts are virtual, so I have a user - johndoe at dom.ain who MUST login
as johndoe at dom.ain with a password.
3. His mailbox is in /var/spool/virtual/dom.ain/johndoe/Maildir/

So I try this - using the mail-trends code from [1]

root at gw:/scripts/mail-trends # ./main.py --server=localhost
--username=johndoe at dom.ain --password=1234 --use_ssl
[2017-01-21 22:24:08,552] Initializing
{'username': 'johndoe at dom.ain', 'use_ssl': '', 'password': '1234',
'server': 'localhost'}
[2017-01-21 22:24:08,552] Connecting
[2017-01-21 22:24:08,747] Logging in
[2017-01-21 22:24:08,752] Getting mailboxes
*[2017-01-21 22:24:08,753] Found INBOX.spam *<-- Where it is getting this
from beats me!
*[2017-01-21 22:24:08,753] Found INBOX*
Traceback (most recent call last):
  File "./main.py", line 304, in <module>
    message_infos = GetMessageInfos(opts)
  File "./main.py", line 104, in GetMessageInfos
    for mailbox in m.GetMailboxes():
  File "/scripts/mail-trends/mail.py", line 61, in GetMailboxes
    mailboxes.remove('[Gmail]')
ValueError: list.remove(x): x not in list
root at gw:/scripts/mail-trends #

root at gw:/scripts/mail-trends # *ls -al
/var/spool/virtual/dom.ain/johndoe/Maildir/*
total 3256
drwx------  5 mailnull  mailnull      512 Jan 22 00:04 .
drwx------  3 mailnull  mailnull      512 Jan 21 18:48 ..
drwx------  2 mailnull  mailnull  1084416 Jan 22 00:04 cur
-rw-------  1 mailnull  mailnull  1074769 Jan 21 18:52 dovecot-uidlist
-rw-------  1 mailnull  mailnull        8 Jan 21 18:32 dovecot-uidvalidity
-r--r--r--  1 mailnull  mailnull        0 Jan 21 18:32
dovecot-uidvalidity.58837ef3
drwx------  2 mailnull  mailnull  1084416 Jan 21 18:47 new
-rw-r--r--  1 mailnull  mailnull        0 Jan 21 18:30 subscriptions
drwx------  2 mailnull  mailnull      512 Jan 21 17:44 tmp


If anyone is able to hack this with Dovecot, please share the details.



[0] http://code.google.com/p/mail-trends/
[1] https://github.com/jpbarraca/mail-trends

-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft."


More information about the dovecot mailing list