Movatterモバイル変換
[0]ホーム
Writing 'intercepted' e-mail message to a mailbox
Donn Cavedonn at u.washington.edu
Thu Apr 19 11:59:57 EDT 2001
Quoth Jacobus van der Merwe <jacobus at geo.co.za>:| I am redirecting all email sentuser1 at myhost.co.za to a python script,| which| extracts certain data from the e-mail and writes it to file. But now I| still want| user1 to receive this e-mail.|| I read the incoming mail using| mailMessage = rfc822.Message(sys.stdin)|| How can I get the message from my variable mailMessage into user1's| mailbox?? I can not find a method that does it.I'm pretty sure there is no such function in the Python library, andit's a hard one to write. Mailbox files can use one of several differentdata formats, depending on how they do things at your site, and in anycase you must carefully interlock against other software that couldaccidentally try to modify the file at the same time.But in this case I doubt you need to. If you have a ".forward" filethat routes the mail into the Python program, then all you need todo is change its contents from "|/that/path/mailread"to \user1, "|/that/path/mailread", and the mail delivery system will deal with it.Donn Cave,donn at u.washington.edu
More information about the Python-listmailing list
[8]ページ先頭