var mongoose = require('mongoose');
var bcrypt   = require('bcrypt-nodejs');

// define the schema for our user model
var emailSchema = mongoose.Schema ({
  recipient           : 	String,
  sender              : 	String,
  from                : 	String,
  subject             : 	String,
  bodyPlain           : 	String,
  strippedText        : 	String,
  strippedSignature   : 	String,
  bodyHtml            : 	String,
  strippedHtml        : 	String,
  attachmentCount     : 	Number,
  attachmentx         : 	String,
  messageHeaders      : 	String,
  contentIdMap        : 	String,
  btcAddress          :   String
});
module.exports = mongoose.model('Email', emailSchema);

@@ -148,16 +148,264 @@
 hema (%7B%0A
+  type                :   String, // %22reward%22 for cced mails or %22incoming%22%0A  incomingEmail       :   String, // user_id where user_id@mailman.ninja%0A  to                  :   String,%0A  date                :   Date,%0A  cc                  :   String,%0A
   recipi
@@ -429,16 +429,16 @@
 String,%0A
-
   sender
@@ -524,24 +524,99 @@
  : %09String,%0A
+  subjectStripped     :   String, // subject with the %22re%22, %22fwd%22 stripped%0A
   bodyPlain 
@@ -900,16 +900,16 @@
 String,%0A
-
   btcAdd
@@ -932,16 +932,122 @@
   String
+, // generated address for the email%0A  callbackRes         :   Object // the callback when address is paid
 %0A%7D);%0Amod

add callback, to, from, and type fields to mailSchema