Live data from Hacker News

Accessing GMail through Python

users.physik.fu-berlin.de

1–10 of 13 posts

Re: Accessing GMail through Python

#2
This reminds me of a problem I've been wanting to solve for a long time.

A lot of web apps use email to deliver notifications and other data like reports. I want to take these emails and process them whenever a new email arrives. A few qualifications: The email server and the processing server are separate. Need to access any attached files as well as the message body and other headers. *Ideally, I don't want to deal with any email related libraries at all i.e. want to use something like a Rest API or even FTP (like in the libgmail library linked to in this post). This would make it usable from any language without needing a special email library.

Example Use Case: Your web analytics software sends you a daily report with an attached CSV file. You want to grab the data from the CSV and put it in a database so you can create a nice dashboard for your site.

Would love to hear from anyone that has had experience with a system like this and could point me in the right direction.

Re: Accessing GMail through Python

#3
post #2

This reminds me of a problem I've been wanting to solve for a long time. A lot of web apps use email to deliver notifications and other data like reports. I want to take these emails and process them whenever a new email arrives. A few qualifications: The email server and the processing server are separate. Need to access any attached files as well as the message body and other headers. *Ideally, I don't want to deal…

[deleted]

Re: Accessing GMail through Python

#5
post #2

This reminds me of a problem I've been wanting to solve for a long time. A lot of web apps use email to deliver notifications and other data like reports. I want to take these emails and process them whenever a new email arrives. A few qualifications: The email server and the processing server are separate. Need to access any attached files as well as the message body and other headers. *Ideally, I don't want to deal…

I don't know about this, I mean if an application's only API is email, is that something we really want to encourage?

Google analytics has a API now.

Re: Accessing GMail through Python

#6

For a hacker, what is the compelling reason to even use gmail? The web interface? Isn't there a way to run your own email server with a web interface?

Amount of time saved using an existing, established service like Gmail versus running your own and fighting the never-ending fight with spam.

You can take that free time to hack something up ;-)

Re: Accessing GMail through Python

#7

For a hacker, what is the compelling reason to even use gmail? The web interface? Isn't there a way to run your own email server with a web interface?

I don't want to be responsible for the upkeep (and downtime) of my primary form of non-face-to-face communication.

Re: Accessing GMail through Python

#8

For a hacker, what is the compelling reason to even use gmail? The web interface? Isn't there a way to run your own email server with a web interface?

Amount of time saved using an existing, established service like Gmail versus running your own and fighting the never-ending fight with spam. You can take that free time to hack something up ;-)

the gmail spam filter is one of the best i've seen ... they have a far larger corpus of training data than any individual hacker could ever access ;)

Re: Accessing GMail through Python

#9
post #2

This reminds me of a problem I've been wanting to solve for a long time. A lot of web apps use email to deliver notifications and other data like reports. I want to take these emails and process them whenever a new email arrives. A few qualifications: The email server and the processing server are separate. Need to access any attached files as well as the message body and other headers. *Ideally, I don't want to deal…

Selectively forward the email to an account connected to Google App Engine: http://code.google.com/appengine/docs/python/mail/receivingm...

Then you can write a handler that basically treats the email as if it had been a web request. (This amazing new feature was just added about a month ago!)

Let me know how it went.

Re: Accessing GMail through Python

#10
post #2

This reminds me of a problem I've been wanting to solve for a long time. A lot of web apps use email to deliver notifications and other data like reports. I want to take these emails and process them whenever a new email arrives. A few qualifications: The email server and the processing server are separate. Need to access any attached files as well as the message body and other headers. *Ideally, I don't want to deal…

The best answer might be Lamson, by Zed Shaw:

http://lamsonproject.org/

An extensible SMTP server in Python.

You might still have to write some email-specific plugins, but they would probably be reusable. For instance, a CSV-receiver plugin that inserts rows into MySQL.

Post reply on HN