The Enron scandal, publicized in October 2001, eventually led to the bankruptcy of the Enron Corporation, an American energy company based in Houston, Texas, and the de facto dissolution of Arthur Andersen, which was one of the five largest audit and accountancy partnerships in the world. In addition to being the largest bankruptcy reorganization in American history at that time, Enron was cited as the biggest audit failure Wikipedia (https://en.wikipedia.org/wiki/Enron_scandal)
In this excercise your task is to build a email server for storing Enron-emails.
You can choose your tooling pretty freely but the API should have following methods or ways to accomplish these tasks (at root level):
- Show all emails received by single user, recognized by
email-address. ie.mailboxOf(rosalee.fleming@enron.com) { .. } - Show all emails sent by single user, recognized by
email-address. ie.sentMailsOf(rosalee.fleming@enron.com) { .. } - Full text search of the emails from
subject,cc,recipients,sender,bccortextfields. iesearch(Rosalee Fleming) { .. }
Mail and User should be distinct models inside the API.
Should have following fields/resolvables:
address, that equals fully qualified email-address of the Userreceived(relation) that should be a list of received Mails (also when User was inccorbccfields)sent(relation) that should be a list of sent Mails
Should have following fields/resolvables:
id, Scalar, mail unique identifiertext, mail contentsender, a relation to User who sent the Mailrecipients, a relation to Users that are direct recipients of the messagecc, a relation to Users that are carbon copy recipients of the messagebcc, a relation to Users that are blind carbon copy recipients of the messagedate, a strictly defined scalar
http://jsonstudio.com/wp-content/uploads/2014/02/enron.zip
{
"_id": {
"$oid": "52af48b5d55148fa0c19964c"
},
"sender": "rosalee.fleming@enron.com",
"recipients": [
"lizard_ar@yahoo.com"
],
"cc": [],
"text": "Liz, I don't know how the address shows up when sent, but they tell us it's \nkenneth.lay@enron.com.\n\nTalk to you soon, I hope.\n\nRosie",
"mid": "32285792.1075840285818.JavaMail.evans@thyme",
"fpath": "enron_mail_20110402/maildir/lay-k/_sent/108.",
"bcc": [],
"to": [
"lizard_ar@yahoo.com"
],
"replyto": null,
"ctype": "text/plain; charset=us-ascii",
"fname": "108.",
"date": "2000-08-10 03:27:00-07:00",
"folder": "_sent",
"subject": "KLL's e-mail address"
}You can ignore folder, ctype, replyto, fname, fpath and mid-fields.
Map _id.$oid -> id, that should be sufficient for forming unique identifier for each Mail
Beware duplicating data.
You can ignore folder, ctype, replyto, fname, fpath and mid-fields.
Full-text search is very easy to implement using Elasticsearch.