We (the Math department at the U of Wisconsin) recently switched over from another server to dovecot
One thing that a lot of people here do is set up an on-line form that sends them email. They use formmail for this. I have them edit their procmail config so that all the messages go into a particular mail folder.... So far so good.
With our old system, all messages in a folder were kept in a single file. 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).
I understand that I can make dovecot store messages in a file by leaving the trailing slash off when specifying the folder name. Sample procmail segment:
:0:
- Subject:.*\[feedback\] .feedback
But I can't get the feedback folder to show up in the list of IMAP folders in my mail client. I've tried Outlook Express and Thunderbird. If I put the slash at the end, it creates a .feedback folder and then I can see it in my mail client. But then I can't export it to cvs.
Anybody know why I can't see the .feeback folder? Or maybe somebody has a good way to get data from the body of messages stored in a dovecot folder, for example, .feedback/cur/ and .feedback/new/.
John Heim wrote:
But I can't get the feedback folder to show up in the list of IMAP folders in my mail client. I've tried Outlook Express and Thunderbird. If I put the slash at the end, it creates a .feedback folder and then I can see it in my mail client. But then I can't export it to cvs.
Anybody know why I can't see the .feeback folder? Or maybe somebody has a good way to get data from the body of messages stored in a dovecot folder, for example, .feedback/cur/ and .feedback/new/.
Read the dovecot documentation on default_mail_env - you have to tell dovecot you want to use mbox instead of maildirs
On Wed, 4 Oct 2006, John Heim wrote:
We (the Math department at the U of Wisconsin) recently switched over from another server to dovecot
One thing that a lot of people here do is set up an on-line form that sends them email. They use formmail for this. I have them edit their procmail config so that all the messages go into a particular mail folder.... So far so good.
With our old system, all messages in a folder were kept in a single file. 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).
I understand that I can make dovecot store messages in a file by leaving the trailing slash off when specifying the folder name. Sample procmail segment:
:0:
- Subject:.*\[feedback\] .feedback
But I can't get the feedback folder to show up in the list of IMAP folders in my mail client. I've tried Outlook Express and Thunderbird. If I put the slash at the end, it creates a .feedback folder and then I can see it in my mail client. But then I can't export it to cvs.
Is it possible it would be better to just process one message at a time as they arrive and append whatever info to the CSV file at that time? The procmail rule would look something like this:
:0 c:
* Subject:.*\[feedback\]
| /path/to/script/which/analyzes/message
That copies the message to the pipe command, so that the rest of the procmail file continues to apply to the message. (You might still file them in a folder.)
If you do this, you don't have to worry about the format of the mailboxes that messages are delivered to, and your processing can be completely independent of it.
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/ .
- Logan
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/
participants (3)
-
John Heim
-
Logan Shaw
-
Peter Fern