Writing directly to email
Craig Ringer
craig at postnewspapers.com.au
Wed Apr 28 23:22:15 EDT 2004
On Thu, 2004-04-29 at 07:53, noel at rescommunes.ca wrote:
> I was wondering if it was at all possible to pipe text form something like
> logging into an email file with out screwing things up for Cyrus.
>
> For example, say i have a crown tab that appends new mail.err data to the
> file /var/spool/imap/m/user/me/1. with just simple stdout redirection >>.
I suspect it should be safe to modify an existing message, but of course
many clients won't notice that it's changed. You'll run into problems
when the user deletes that message, because when you recreate it Cyrus
won't see it. You'd have to reconstruct the mailbox - not a cool
solution.
I'd be inclined to use IMAP to do this instead - Cyrus::IMAP under Perl,
and Python's imaplib, are both quite handy for this sort of thing.
> And what about properly inserted mime encoded info or just completely
> rewriting an email file all together?
No idea. Use Python's 'email' module (I'm sure there's a similar module
in perl to work with RFC822 messages, too) to mangle the messages?
Craig Ringer
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
More information about the Info-cyrus
mailing list