Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How hard is it to build an Email client? - Python

Tags:

I'm venturing in unknown territory here...

I am trying to work out how hard it could be to implement an Email client using Python:

  • Email retrieval
  • Email sending
  • Email formatting
  • Email rendering

Also I'm wondering if all protocols are easy/hard to support e.g. SMTP, IMAP, POP3, ...


Hopefully someone could point me in the right direction :)

like image 894
RadiantHex Avatar asked Apr 13 '11 10:04

RadiantHex


People also ask

Can python send emails?

Python comes with the built-in smtplib module for sending emails using the Simple Mail Transfer Protocol (SMTP). smtplib uses the RFC 821 protocol for SMTP. The examples in this tutorial will use the Gmail SMTP server to send emails, but the same principles apply to other email services.


1 Answers

The Python language does offer raw support for the needed protocols in its standard library. Properly using then, and, properly parsing and assembling a "modern day" e-mail message, however can be tough to do.

Also, you didn't say if you want to create a graphical interface for your e-mail client -- if you want to have a proper graphical interface -- up to the point of being usable, it is quite a lot of work.

Local e-mail storage would be the easier part - unless you want to properly implement an mbox file format RFC-4155 so that other software can easily read/write the messgaes you have fetched, you can store them in as Python Objects using an ORM or an Object Oriented database, such as ZODB, or MongoDB.

If you want more than a toy e-mail app, you will have a lot of work - properly encoding e-mail headers, for example, server authentication and secure authentication and transport layers, decoding of the e-mail text body itself for non ASCII messages. Although the modules on the Python standard library do implement a lot of that, their documentation falls short on examples - and a complete e-mail client would have to use all of then.

Certainly the place to start an e-mail client, even a toy one, would be taking a look on the most recent RFC's for e-mail (and you will have to pick then from here http://www.ietf.org/rfc/rfc-index since just looking for "email rfc" on google gives a poor result).

like image 135
jsbueno Avatar answered Sep 26 '22 02:09

jsbueno