Python TNEF (winmail.dat attachment access) library?
Hello, has anyone seen such a beast? I tried googling, PyPI, Parnassus etc. but could not find any pure-python code nor extensions to interface with any of the existing implementations. I am thinking about taking the Ruby code I found at http://www.zweknu.org/technical/index.rhtml?s=p%7c15 and converting that to Python. I have no experience with Ruby so this will be rather interesting... I guess another option would be to use CTypes to plug into some tnef shared library/DLL. I'd prefer a pure-python route though... Any pointers/recommendations appreciated. Thanks, Petri -- http://mail.python.org/mailman/listinfo/python-list
Re: Python TNEF (winmail.dat attachment access) library?
Thanks for your comments. I just posted the first draft of a pure-python library called "pytnef" at python cheeseshop. Note that this is so far merely a conversion of the Ruby library. Some important functionality is missing, there seem to be some problems, but it's a start. I also tried a few tools that claim to decode TNEF and most of them actually fail to extract attachments according my tests (used winmail.dat attachments saved from Mozilla Thunderbird). So if you'd happen to know of TNEF decoders that _work_, please let me know. Regards, Petri Petri Savolainen wrote: > Hello, > > has anyone seen such a beast? I tried googling, PyPI, Parnassus etc. but > could not find any pure-python code nor extensions to interface with any > of the existing implementations. > > I am thinking about taking the Ruby code I found at > > http://www.zweknu.org/technical/index.rhtml?s=p%7c15 > > and converting that to Python. I have no experience with Ruby so this > will be rather interesting... > > I guess another option would be to use CTypes to plug into some tnef > shared library/DLL. I'd prefer a pure-python route though... > > Any pointers/recommendations appreciated. > > Thanks, > > Petri > -- http://mail.python.org/mailman/listinfo/python-list
[ANN] win32 binaries for zope.interface 3.3.0
Both eggs and installers (exe) are available for Python 2.4 & 2.5 from: http://www.zope.org/Members/saffe/zope_interface/folder_contents Compiled on winxp pro using mingw32 "current". Cheers, Petri -- http://mail.python.org/mailman/listinfo/python-list
imaplib & Received: header(s)???
Hello, Is there a way to get at the "Received" header(s) or is there something in imaplib or imap server implementations that hides these? If not, what IMAP FETCH command should be used? I've used for example "BODY[HEADER.FIELDS (RECEIVED)]" and it always returns empty ("\r\n"). Despite the Received - header existing, as demonstrated by taking a look at message sources via desktop email clients. I need to get at the Received-for header to figure out at which address we received an email. We subscribe to a number of mailing lists using per-mailing-list addresses, and often, To: field contains something else than our address, thus the need for Received-for. Any help would be much appreciated - this is baffling me and I've not found anything recent that would help. Thanks, Petri -- http://mail.python.org/mailman/listinfo/python-list
Re: imaplib & Received: header(s)???
Donn Cave wrote: > | I need to get at the Received-for header to figure out at which address > | we received an email. We subscribe to a number of mailing lists using > | per-mailing-list addresses, and often, To: field contains something else > | than our address, thus the need for Received-for. > | > > "Anything recent"? If you're getting IMAP advice from comp.lang.python, > I think it's fair to say you will need to be more resourceful. The > RFC for IMAP4rev1 should be helpful. I don't know the IMAP to get a > single header field, but my guess is that your error is there. Can you > retrieve other fields that way? Does the one you're looking for appear > in the data if you get the whole header, for example with 'RFC822.HEADER'? > It certainly does in my Python IMAP client, and this would have at least > helped you refine your question. Thanks Donn, I had already checked everything relevant, including what you suggested. The only examples that I found including the Received header utilized the now-obsoleted rfc822 library in python from many years and versions back. Thus nothing recent. However, you mentioning "RFC822.HEADER" working for you prompted me to try another mail server... to my surprise, everything worked. It appears some imap servers do not allow programmatic fetching of Received: information. Should've done this check sooner :-( Thanks, Petri -- http://mail.python.org/mailman/listinfo/python-list