[Dovecot] dovecot mailbox to csv

John Heim jheim at math.wisc.edu
Thu Oct 5 23:06:35 UTC 2006


>> With dovecot, they go into a couple of different directories.  This is
>> problematic because we often need to convert the form field data to csv 
>> values so it can be imported into a spreadsheet. So a professor can 
>> create an on-line form and end up with the data from it in an Excell 
>> spreadsheet. Slick (when it works).
>>[...]

>
> Alternatively, if you'd like to do it all in a batch, the
> format you are now using (with each message in a separate
> folder) is called "maildir", rather than "mbox".  There are
> tools to convert from one to the other.  Or, you can use a
> Perl script and use the tools from the Mail-Box distribution of
> Perl modules.  These modules can read LOTS of different formats.
> See http://search.cpan.org/~markov/Mail-Box-2.068/ .


As it turns out, the script I wrote for the old mail server *almost* worked 
on the new server with dovecot maildir  folders. I just had a mistake in the 
way it processed the message date. That made it appear as if the script 
would open the folder but not process the messages. When I rewrote that code 
to be more portable, it worked.

I don't know if this is of interest to anybody but here is a link to the 
perl script:
http://www.math.wisc.edu/~jheim/stuff//mbox2csv

I believe that will work with formmail.php from sourceforge:
http://freshmeat.net/projects/formmail.php/





More information about the dovecot mailing list