Email gateway

55 views
Skip to first unread message

Kenneth Lundström

unread,
Jan 10, 2011, 4:34:22 PM1/10/11
to web...@googlegroups.com
A gateway that works the other way. Instead of sending emails from
web2py I�d like to receive emails.

I�m working on a app where you upload PDF:s containing receipts. Those
PDF:s are usually scanned in a photocopier that emails the PDF to your
email. Then you have to login in to my app and upload it. So my idea was
to give the photocopier another email adress which my app reads and
extracts the PDF from it.

Has anybody made anything like this? Where should I start? I guess it
should be some kind of pop/imap client polling the postbox and reading
and extrating everything from it.


Kenneth

Bruno Rocha

unread,
Jan 10, 2011, 4:44:24 PM1/10/11
to web...@googlegroups.com
You should look to the built in modules:

from poplib import *

or

from imaplib import *

I used poplib to get raw text messages, but I never get attached files, but I guess it can do it.


2011/1/10 Kenneth Lundström <kenneth.t...@gmail.com>
A gateway that works the other way. Instead of sending emails from web2py I悲 like to receive emails.

I惴 working on a app where you upload PDF:s containing receipts. Those PDF:s are usually scanned in a photocopier that emails the PDF to your email. Then you have to login in to my app and upload it. So my idea was to give the photocopier another email adress which my app reads and extracts the PDF from it


Has anybody made anything like this? Where should I start? I guess it should be some kind of pop/imap client polling the postbox and reading and extrating everything from it.


Kenneth

Alexandre Andrade

unread,
Jan 10, 2011, 4:46:20 PM1/10/11
to web...@googlegroups.com
You can start from

http://docs.python.org/library/poplib.html
http://docs.python.org/library/imaplib.html

http://docs.python.org/library/email.parser.html


Atenciosamente


Alexandre Andrade
Hipercenter.com Classificados Gratuitos e Inteligentes



2011/1/10 Kenneth Lundström <kenneth.t...@gmail.com>
A gateway that works the other way. Instead of sending emails from web2py I悲 like to receive emails.

I惴 working on a app where you upload PDF:s containing receipts. Those PDF:s are usually scanned in a photocopier that emails the PDF to your email. Then you have to login in to my app and upload it. So my idea was to give the photocopier another email adress which my app reads and extracts the PDF from it.


Has anybody made anything like this? Where should I start? I guess it should be some kind of pop/imap client polling the postbox and reading and extrating everything from it.


Kenneth




--

Kenneth Lundström

unread,
Jan 10, 2011, 8:27:40 PM1/10/11
to web...@googlegroups.com
Thank You Bruno and Alexandre for your answers.

I think I have now downloaded the attachment but not written it anywhere yet. Would it be possible to use the uploads function i web2py to save the file in uploads and update a table with info about the new file?


Kenneth

Alexandre Andrade

unread,
Jan 12, 2011, 7:09:39 AM1/12/11
to web...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages