Pop3 autosave attachment.

fishboy fishboy at spamspamspam.com
Fri Jun 4 17:00:29 CEST 2004

On Wed, 26 May 2004 03:33:15 GMT, "p-nut" <I-dont-gots-one at dot.com>

>newbie here needing some help.
>Is there a way to set up a script that will check a pop3 account and
>autosave the file attachments to a folder specified?
>The thing is:
>I have 1 single email account that will always have emails with nothing but
>emails with attachments.
>Since there will be thousands of these emails , I would like to be able to
>check a couple times a day this account and have the script auto save all
>attachments by their actual attached name to a specified folder.
>Is this possible?

Little old, but doesn't look like anyone has responded.  So here.

poplib will let you access the mailbox and get messages.  although
poplib docs suggest you use imaplib if you can.

It also says look at the test in the source for poplib for a more
complete example

email module will let you handle message parsing and attachment 

look at get_payload()


More information about the Python-list mailing list