Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-14 Thread dpapathanasiou
On Oct 4, 10:27 am, dpapathanasiou wrote: > I'm using python to access an email account via POP, then for each > incoming message, save any attachments. > > This is the function which scans the message for attachments: > > def save_attachments (local_folder, msg_text): >     """Scan the email mess

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 09:17 -0700, dpapathanasiou wrote: > > Which is *really* difficult (for me) to read. Any chance of providing a > > "normal" traceback? > > File "/opt/server/smtp/smtps.py", line 213, in handle > email_replier.post_reply(recipient_mbox, ''.join(data)) > File "/opt/ser

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread dpapathanasiou
> Which is *really* difficult (for me) to read.  Any chance of providing a > "normal" traceback? File "/opt/server/smtp/smtps.py", line 213, in handle email_replier.post_reply(recipient_mbox, ''.join(data)) File "/opt/server/smtp/email_replier.py", line 108, in post_reply save_attachm

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 08:16 -0700, dpapathanasiou wrote: > > And where might we be able to see that stack trace? > > This is it: > > Exception: ('AttributeError', '', [' File "/opt/server/smtp/ > smtps.py", line 213, in handle\ne > mail_replier.post_reply(recipient_mbox, \'\'.join(data))\n',

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread dpapathanasiou
> And where might we be able to see that stack trace? This is it: Exception: ('AttributeError', '', [' File "/opt/server/smtp/ smtps.py", line 213, in handle\ne mail_replier.post_reply(recipient_mbox, \'\'.join(data))\n', ' File "/ opt/server/smtp/email_replier.py", l ine 108, in post_repl

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 07:27 -0700, dpapathanasiou wrote: > When I try to write the filedata to a file system folder, though, I > get an AttributeError in the stack trace. And where might we be able to see that stack trace? -a -- http://mail.python.org/mailman/listinfo/python-list

Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread dpapathanasiou
I'm using python to access an email account via POP, then for each incoming message, save any attachments. This is the function which scans the message for attachments: def save_attachments (local_folder, msg_text): """Scan the email message text and save the attachments (if any) in the local

Re: Email attachments

2007-01-25 Thread Facundo Batista
Steve Holden wrote: > I'm having some trouble getting attachments right for all recipients, > and it seems like Apple's mail.app is the pickiest client at the moment. > It doesn't handle attachments that both Thunderbird and Outlook find > perfectly acceptable. The following code works ok with

Re: Email attachments

2007-01-24 Thread Max M
Steve Holden skrev: > I'm having some trouble getting attachments right for all recipients, > and it seems like Apple's mail.app is the pickiest client at the moment. > It doesn't handle attachments that both Thunderbird and Outlook find > perfectly acceptable. > > Since the code I'm using is c

Email attachments

2007-01-24 Thread Steve Holden
I'm having some trouble getting attachments right for all recipients, and it seems like Apple's mail.app is the pickiest client at the moment. It doesn't handle attachments that both Thunderbird and Outlook find perfectly acceptable. Since the code I'm using is currently ugly and embedded, befo

Re: Filetypes in email attachments.

2005-08-25 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > I would like to use the magic file to detect the filetype, if this is > possible. I have the attachement stored and (generally) decoded in a > variable. There is a Python binding to the libmagic library, see http://mx.gw.com/pipermail/file/2003/55.html Meanwhile,

Filetypes in email attachments.

2005-08-25 Thread justin . vanwinkle
Hello everyone, I'm writing a simple spam filter as a project, partly to learn python. I want to filter by filetype, however, the mime content type I get using .get_content_type gives limited and possibly bogus information, especially when trying to detect viruses or spam. I would like to use the

Re: Getting/Saving email attachments w/ poplib and email modules

2005-06-22 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Hello All, > > Here's what I'm trying to do: > > I need to connect to a pop3 server, download all messages, and copy all > of the attachments into a specific directory. The actual email message > is unimportant. Now, I've found plenty of examples that strip the > at

Re: Getting/Saving email attachments w/ poplib and email modules

2005-06-22 Thread Tim Williams
- Original Message - From: <[EMAIL PROTECTED]> > > Here's what I'm trying to do: > > I need to connect to a pop3 server, download all messages, and copy all > of the attachments into a specific directory. The actual email message ## import email import poplib mimes = ["im

Getting/Saving email attachments w/ poplib and email modules

2005-06-21 Thread brettk
Hello All, Here's what I'm trying to do: I need to connect to a pop3 server, download all messages, and copy all of the attachments into a specific directory. The actual email message is unimportant. Now, I've found plenty of examples that strip the attachments from an email message, but most (

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-03 Thread scrimp
Here is the complete traceback..sorry about that though. I used the run button and entered in "C:\email.txt" for the msgfile parameter thats used for input This email.txt file has a zip file attached to it and is all in text, so hopefully I am working with the correct input file. I used the pop3

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread John Roth
"scrimp" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Im using the winpython IDE to run that script for the unpacking the > email. The usage says unpackmail [options] msgfile. I type unpackmail > -d filename and it gives me a syntax error. What modifications did u do > to that mo

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread Peter Hansen
scrimp wrote: > OK i got past that syntax error I think. This is the error I am getting > nowAttributeError: 'NoneType' object has no attribute 'lower' All > Im reading is a text file of the email message with an attachment --zip > file Always post a *complete* traceback, with the line numbers

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread scrimp
OK i got past that syntax error I think. This is the error I am getting nowAttributeError: 'NoneType' object has no attribute 'lower' All Im reading is a text file of the email message with an attachment --zip file -- http://mail.python.org/mailman/listinfo/python-list

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread scrimp
Im using the winpython IDE to run that script for the unpacking the email. The usage says unpackmail [options] msgfile. I type unpackmail -d filename and it gives me a syntax error. What modifications did u do to that module to make it work? -- http://mail.python.org/mailman/listinfo/python-list

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread John Roth
"scrimp" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How would I go about retriving an email message and stripping out the > attachment into a file. I have seen examples where they would read in > the file and delete the attachment and replace it with text saying that > the attac

saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread scrimp
How would I go about retriving an email message and stripping out the attachment into a file. I have seen examples where they would read in the file and delete the attachment and replace it with text saying that the attachment was removed. For testing purposes Im using a pop3 server to receive mes