Inboxen / infrastructure

obsolete - use https://github.com/Inboxen/Inboxen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fixing the email models (Email, Attachment, Header)

moggers87 opened this issue · comments

Currently these models don't reflect how actual emails look.

Key features that I think we're lacking:

  • The ability to get an email out of the system that is identical to the one that went in
  • The ability to get a pre-rendered "safe" version of HTML

Some bugs that have already been filed:

@xray7224 suggests changing the ManyToMany relationships ForeignKey

I'm going to look at the DBMail E-R model and see if we can learn anything from that.

Another DB email storage system: http://archiveopteryx.org/schema

Where possible, we should leave headers etc. un-decoded, e.g. leave headers in their Q encoded forms for non-ascii chars. It should cost too much to decode (we can always use a cache). Don't know how much decoding Salmon does for us, need to look into that once I've got some models written.

This is pretty much done, however the new models have increased code complexity significantly.

A lot of this code will end up in inboxen/managers.py, hidden from users. However, it still requires a lot of code to be completely rewritten.

I'll have to look at what kind of changes will need to be made but if there are some complex queries that might need to be made it may be useful to have them as properties/methods on the model