Built motion from commit fd18f58.|0.0.129
[motion.git] / server / config / imap / index.js
index 4f1c6be..5ab9789 100644 (file)
@@ -1 +1 @@
-var _0xad34=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x70\x61\x74\x68","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x49\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x43\x6F\x6D\x70\x61\x6E\x79","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x6F\x6D\x65\x6E\x74","\x6F\x70\x65\x6E","\x66\x73","\x70\x72\x6F\x6D\x69\x73\x69\x66\x79","\x63\x6C\x6F\x73\x65","\x77\x72\x69\x74\x65","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x2E\x2E\x2F\x72\x6F\x75\x74\x69\x6E\x67\x2F\x73\x63\x68\x65\x64\x75\x6C\x65\x72","\x2E\x2E\x2F\x75\x74\x69\x6C","\x69\x6E\x52\x65\x70\x6C\x79\x54\x6F","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6D\x61\x69\x6C","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x69\x64","\x66\x6F\x72\x6D\x61\x74","\x73\x75\x62\x6A\x65\x63\x74","\x6E\x61\x6D\x65","\x61\x64\x64\x72\x65\x73\x73","\x66\x72\x6F\x6D","\x63\x63","\x6D\x61\x70","\x69\x6E\x69\x74","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x5F","\x72\x61\x6E\x64\x6F\x6D","\x46\x69\x6C\x65","\x66\x69\x6C\x65\x4E\x61\x6D\x65","\x70\x72\x6F\x70\x65\x72\x6C\x79\x20\x73\x61\x76\x65\x64\x2E","\x6C\x6F\x67","\x74\x68\x65\x6E","\x64\x61\x74\x61","\x63\x6F\x6E\x74\x65\x6E\x74","\x77","\x72\x6F\x6F\x74","\x73\x65\x72\x76\x65\x72","\x66\x69\x6C\x65\x73","\x2F","\x6A\x6F\x69\x6E","\x63\x6F\x6E\x74\x65\x6E\x74\x54\x79\x70\x65","\x63\x72\x65\x61\x74\x65","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x61\x6C\x6C","\x6D\x65\x73\x73\x61\x67\x65\x49\x64","\x52\x45\x43\x45\x49\x56\x45\x44","\x74\x6F","\x62\x63\x63","\x74\x65\x78\x74","\x6D\x61\x69\x6C\x49\x6E","\x75\x70\x64\x61\x74\x65","\x73\x74\x61\x74\x75\x73","\x43\x4C\x4F\x53\x45\x44","\x73\x70\x72\x65\x61\x64","\x4C\x69\x73\x74\x49\x64","\x40","\x73\x70\x6C\x69\x74","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x6D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x4F\x50\x45\x4E","\x73\x79\x73\x74\x65\x6D","\x3B","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x4E\x45\x57","\x73\x74\x61\x74\x65","\x73\x6F\x75\x72\x63\x65","\x6F\x6E","\x49\x4D\x41\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x45\x58\x49\x54\x45\x44\x20\x57\x49\x54\x48\x20\x43\x4F\x44\x45\x20\x25\x73","\x6D\x65\x73\x73\x61\x67\x65","\x6D\x73\x67","\x74\x79\x70\x65","\x2F\x69\x6D\x61\x70","\x66\x6F\x72\x6B","\x72\x65\x71\x75\x65\x73\x74\x20\x66\x61\x69\x6C\x65\x64\x21","\x72\x65\x71\x75\x65\x73\x74\x20\x73\x75\x63\x63\x65\x73\x73\x65\x66\x75\x6C\x21","\x73\x65\x6E\x64\x52\x65\x71\x75\x65\x73\x74","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x64","\x63\x68\x61\x6E\x67\x65\x64","\x65\x72\x72","\x4D\x61\x69\x6C\x20\x61\x63\x63\x6F\x75\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x61\x63\x63\x65\x70\x74\x4D\x65\x74\x68\x6F\x64","\x61\x63\x63\x65\x70\x74\x55\x72\x6C","\x4D\x61\x69\x6C\x20\x41\x63\x63\x6F\x75\x6E\x74\x20\x48\x54\x54\x50\x20\x4D\x65\x74\x68\x6F\x64\x20\x6F\x72\x20\x55\x52\x4C\x20\x69\x73\x20\x6E\x6F\x74\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x64\x2E\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x79\x6F\x75\x72\x20\x61\x64\x6D\x69\x6E\x69\x73\x74\x72\x61\x74\x6F\x72\x21\x21","\x61\x63\x74\x69\x6F\x6E\x73","\x65\x6E\x61\x62\x6C\x65\x64","\x65\x78\x65\x63\x41\x63\x74\x69\x6F\x6E","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x72\x65\x6A\x65\x63\x74\x65\x64\x41\x74","\x46\x61\x78\x20\x61\x63\x63\x6F\x75\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x72\x65\x6A\x65\x63\x74\x4D\x65\x74\x68\x6F\x64","\x72\x65\x6A\x65\x63\x74\x55\x72\x6C","\x65\x78\x70\x6F\x72\x74\x73","\x65\x78\x69\x74","\x6B\x69\x6C\x6C","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x49\x4D\x41\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x55\x50\x44\x41\x54\x45\x44\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x70\x69\x64","\x44\x49\x53\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44","\x49\x4D\x41\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x44\x45\x53\x54\x52\x4F\x59\x45\x44\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x66\x69\x6E\x64\x41\x6C\x6C"];_0xad34[0];const _=require(_0xad34[1]);const util=require(_0xad34[2]);const path=require(_0xad34[3]);const cp=require(_0xad34[4]);const ms=require(_0xad34[6])[_0xad34[5]];const msg=require(_0xad34[6])[_0xad34[7]];const Room=require(_0xad34[6])[_0xad34[8]];const Status=require(_0xad34[6])[_0xad34[9]];const Message=require(_0xad34[6])[_0xad34[7]];const Account=require(_0xad34[6])[_0xad34[10]];const Contact=require(_0xad34[6])[_0xad34[11]];const Company=require(_0xad34[6])[_0xad34[12]];const Attachment=require(_0xad34[6])[_0xad34[13]];const ReportMail=require(_0xad34[6])[_0xad34[14]];const ReportMailRoom=require(_0xad34[6])[_0xad34[15]];const ReportMailSession=require(_0xad34[6])[_0xad34[16]];const Promise=require(_0xad34[17]);const moment=require(_0xad34[18]);const open=Promise[_0xad34[21]](require(_0xad34[20])[_0xad34[19]]);const close=Promise[_0xad34[21]](require(_0xad34[20])[_0xad34[22]]);const write=Promise[_0xad34[21]](require(_0xad34[20])[_0xad34[23]]);const config=require(_0xad34[24]);var Scheduler=require(_0xad34[25]);var Util=require(_0xad34[26]);function handleMessage(msg){var _0xf261x1a;var _0xf261x1b;var _0xf261x1c;var _0xf261x1d;var _0xf261x1e;var _0xf261x1f,_0xf261x20,_0xf261x21,_0xf261x22;if(msg[_0xad34[27]]){return Message[_0xad34[78]]({where:{messageId:msg[_0xad34[27]][0]}})[_0xad34[50]](function(_0xf261x2e){if(_0xf261x2e){return _0xf261x2e[_0xad34[85]]()[_0xad34[50]](function(_0xf261x2d){_0xf261x1a= _0xf261x2d;if(_0xf261x2d[_0xad34[71]]!== _0xad34[72]){return _0xf261x1a[_0xad34[70]]({status:_0xad34[81],openReason:_0xad34[82]},{individualHooks:true})[_0xad34[50]](function(){return Account[_0xad34[80]](msg[_0xad34[79]])[_0xad34[50]](function(_0xf261x30){_0xf261x1c= _0xf261x30;if(_0xf261x1c[_0xad34[74]]){return Company[_0xad34[78]]({where:{emailDomain:msg[_0xad34[38]][0][_0xad34[37]][_0xad34[76]](_0xad34[75])[1]}})[_0xad34[50]](function(_0xf261x31){return Contact[_0xad34[77]]({where:{email:msg[_0xad34[38]][0][_0xad34[37]]},defaults:{email:msg[_0xad34[38]][0][_0xad34[37]],firstName:msg[_0xad34[38]][0][_0xad34[36]]|| msg[_0xad34[38]][0][_0xad34[37]][_0xad34[76]](_0xad34[75])[0],ListId:_0xf261x1c[_0xad34[74]],CompanyId:_0xf261x31?_0xf261x31[_0xad34[33]]:null}})})}else {return []}})[_0xad34[73]](function(_0xf261x2f){_0xf261x1d= _0xf261x2f})})}else {return Account[_0xad34[80]](msg[_0xad34[79]])[_0xad34[50]](function(_0xf261x30){_0xf261x1c= _0xf261x30;if(_0xf261x1c[_0xad34[74]]){return Company[_0xad34[78]]({where:{emailDomain:msg[_0xad34[38]][0][_0xad34[37]][_0xad34[76]](_0xad34[75])[1]}})[_0xad34[50]](function(_0xf261x31){return Contact[_0xad34[77]]({where:{email:msg[_0xad34[38]][0][_0xad34[37]]},defaults:{email:msg[_0xad34[38]][0][_0xad34[37]],firstName:msg[_0xad34[38]][0][_0xad34[36]]|| msg[_0xad34[38]][0][_0xad34[37]][_0xad34[76]](_0xad34[75])[0],ListId:_0xf261x1c[_0xad34[74]],CompanyId:_0xf261x31?_0xf261x31[_0xad34[33]]:null}})})}else {return []}})[_0xad34[73]](function(_0xf261x2f){_0xf261x1d= _0xf261x2f;return Room[_0xad34[60]]({subject:msg[_0xad34[35]],from:_[_0xad34[40]](msg[_0xad34[38]],_0xad34[37])[_0xad34[58]](_0xad34[83]),account:_0xf261x1c[_0xad34[36]],attachment:msg[_0xad34[42]]&& msg[_0xad34[42]][_0xad34[43]],lastEvent:_0xad34[65],lastEventAt:moment()[_0xad34[34]](_0xad34[84]),arrivedAt:moment()[_0xad34[34]](_0xad34[84]),MailAccountId:_0xf261x1c[_0xad34[33]],ParentId:_0xf261x2d[_0xad34[33]]})})[_0xad34[50]](function(_0xf261x2d){_0xf261x1a= _0xf261x2d})}})}else {return Account[_0xad34[80]](msg[_0xad34[79]])[_0xad34[50]](function(_0xf261x30){_0xf261x1c= _0xf261x30;if(_0xf261x1c[_0xad34[74]]){return Company[_0xad34[78]]({where:{emailDomain:msg[_0xad34[38]][0][_0xad34[37]][_0xad34[76]](_0xad34[75])[1]}})[_0xad34[50]](function(_0xf261x31){return Contact[_0xad34[77]]({where:{email:msg[_0xad34[38]][0][_0xad34[37]]},defaults:{email:msg[_0xad34[38]][0][_0xad34[37]],firstName:msg[_0xad34[38]][0][_0xad34[36]]|| msg[_0xad34[38]][0][_0xad34[37]][_0xad34[76]](_0xad34[75])[0],ListId:_0xf261x1c[_0xad34[74]],CompanyId:_0xf261x31?_0xf261x31[_0xad34[33]]:null}})})}else {return []}})[_0xad34[73]](function(_0xf261x2f){_0xf261x1d= _0xf261x2f;return Room[_0xad34[60]]({subject:msg[_0xad34[35]],from:_[_0xad34[40]](msg[_0xad34[38]],_0xad34[37])[_0xad34[58]](_0xad34[83]),account:_0xf261x1c[_0xad34[36]],attachment:msg[_0xad34[42]]&& msg[_0xad34[42]][_0xad34[43]],lastEvent:_0xad34[65],lastEventAt:moment()[_0xad34[34]](_0xad34[84]),arrivedAt:moment()[_0xad34[34]](_0xad34[84]),MailAccountId:_0xf261x1c[_0xad34[33]]})})[_0xad34[50]](function(_0xf261x2d){_0xf261x1a= _0xf261x2d})}})[_0xad34[50]](function(){return _0xf261x1a[_0xad34[70]]({lastEvent:_0xad34[65],mailIn:++_0xf261x1a[_0xad34[69]]})})[_0xad34[50]](function(_0xf261x2d){return Message[_0xad34[60]]({fromId:_0xf261x1d?_0xf261x1d[_0xad34[33]]:null,messageId:msg[_0xad34[64]],status:_0xad34[65],subject:msg[_0xad34[35]],from:_[_0xad34[40]](msg[_0xad34[38]],_0xad34[37]),to:msg[_0xad34[66]]?_[_0xad34[40]](msg[_0xad34[66]],_0xad34[37]):[],cc:msg[_0xad34[39]]?_[_0xad34[40]](msg[_0xad34[39]],_0xad34[37]):[],bcc:msg[_0xad34[67]]?_[_0xad34[40]](msg[_0xad34[67]],_0xad34[37]):[],text:msg[_0xad34[68]]|| null,MailRoomId:_0xf261x1a[_0xad34[33]]})})[_0xad34[50]](function(_0xf261x24){var _0xf261x25=[];var _0xf261x26=_0xf261x24;var _0xf261x27= new Scheduler({channel:_0xad34[30],uniqueid:util[_0xad34[34]](_0xad34[31],moment()[_0xad34[32]](),_0xf261x1a[_0xad34[33]]),subject:msg[_0xad34[35]],messageid:_0xf261x26[_0xad34[33]],roomid:_0xf261x1a[_0xad34[33]],accountid:_0xf261x1c[_0xad34[33]],accountname:_0xf261x1c[_0xad34[36]],accountaddress:_0xf261x1c[_0xad34[37]],from:msg[_0xad34[38]][0][_0xad34[37]],cc:msg[_0xad34[39]]?_[_0xad34[40]](msg[_0xad34[39]],_0xad34[37]):[]});_0xf261x27[_0xad34[41]]();if(msg[_0xad34[42]]&& msg[_0xad34[42]][_0xad34[43]]){msg[_0xad34[42]][_0xad34[62]](function(_0xf261x28){var _0xf261x29=_0xad34[44]+ Math[_0xad34[45]](32);var _0xf261x2a;_0xf261x25[_0xad34[61]](Attachment[_0xad34[60]]({name:_0xf261x28[_0xad34[47]],basename:_0xf261x29,path:path[_0xad34[58]](config[_0xad34[54]],_0xad34[55],_0xad34[56],_0xad34[42],_0xad34[57],_0xf261x29),type:_0xf261x28[_0xad34[59]],size:_0xf261x28[_0xad34[43]],MailMessageId:_0xf261x26[_0xad34[33]]})[_0xad34[50]](function(_0xf261x2c){return open(_0xf261x2c[_0xad34[3]],_0xad34[53])})[_0xad34[50]](function(_0xf261x2b){_0xf261x2a= _0xf261x2b;return write(_0xf261x2a, new Buffer(_0xf261x28[_0xad34[52]][_0xad34[51]]),0,_0xf261x28[_0xad34[43]])})[_0xad34[50]](function(){return close(_0xf261x2a)})[_0xad34[50]](function(){console[_0xad34[49]](_0xad34[46],_0xf261x28[_0xad34[47]],_0xad34[48])})[_0xad34[29]](function(_0xf261x23){console[_0xad34[28]](_0xf261x23)}))})};return Promise[_0xad34[63]](_0xf261x25)})[_0xad34[29]](function(_0xf261x23){console[_0xad34[28]](_0xf261x23)})}else {return Account[_0xad34[80]](msg[_0xad34[79]])[_0xad34[50]](function(_0xf261x30){_0xf261x1c= _0xf261x30;if(_0xf261x1c[_0xad34[74]]){return Company[_0xad34[78]]({where:{emailDomain:msg[_0xad34[38]][0][_0xad34[37]][_0xad34[76]](_0xad34[75])[1]}})[_0xad34[50]](function(_0xf261x31){return Contact[_0xad34[77]]({where:{email:msg[_0xad34[38]][0][_0xad34[37]]},defaults:{email:msg[_0xad34[38]][0][_0xad34[37]],firstName:msg[_0xad34[38]][0][_0xad34[36]]|| msg[_0xad34[38]][0][_0xad34[37]][_0xad34[76]](_0xad34[75])[0],ListId:_0xf261x1c[_0xad34[74]],CompanyId:_0xf261x31?_0xf261x31[_0xad34[33]]:null}})})}else {return []}})[_0xad34[73]](function(_0xf261x2f){_0xf261x1d= _0xf261x2f;return Room[_0xad34[60]]({mailIn:1,account:_0xf261x1c[_0xad34[36]],subject:msg[_0xad34[35]],from:_[_0xad34[40]](msg[_0xad34[38]],_0xad34[37])[_0xad34[58]](_0xad34[83]),status:_0xad34[88],lastEvent:_0xad34[65],lastEventAt:moment()[_0xad34[34]](_0xad34[84]),arrivedAt:moment()[_0xad34[34]](_0xad34[84]),attachment:msg[_0xad34[42]]&& msg[_0xad34[42]][_0xad34[43]],MailMessages:[{messageId:msg[_0xad34[64]],subject:msg[_0xad34[35]],from:_[_0xad34[40]](msg[_0xad34[38]],_0xad34[37]),fromId:_0xf261x1d?_0xf261x1d[_0xad34[33]]:null,to:msg[_0xad34[66]]?_[_0xad34[40]](msg[_0xad34[66]],_0xad34[37]):[],cc:msg[_0xad34[39]]?_[_0xad34[40]](msg[_0xad34[39]],_0xad34[37]):[],bcc:msg[_0xad34[67]]?_[_0xad34[40]](msg[_0xad34[67]],_0xad34[37]):[],status:_0xad34[65],text:msg[_0xad34[68]]|| null}],MailAccountId:msg[_0xad34[79]]},{include:[{model:Message}]})})[_0xad34[50]](function(_0xf261x32){var _0xf261x25=[];var _0xf261x33=_0xf261x32;var _0xf261x27= new Scheduler({channel:_0xad34[30],uniqueid:util[_0xad34[34]](_0xad34[31],moment()[_0xad34[32]](),_0xf261x33[_0xad34[33]]),subject:msg[_0xad34[35]],messageid:_0xf261x33[_0xad34[86]][0][_0xad34[33]],roomid:_0xf261x33[_0xad34[33]],accountid:_0xf261x1c[_0xad34[33]],accountname:_0xf261x1c[_0xad34[36]],accountaddress:_0xf261x1c[_0xad34[37]],from:msg[_0xad34[38]][0][_0xad34[37]],cc:msg[_0xad34[39]]?_[_0xad34[40]](msg[_0xad34[39]],_0xad34[37]):[]},_0xf261x33[_0xad34[86]][0][_0xad34[87]]);_0xf261x27[_0xad34[41]]();if(msg[_0xad34[42]]&& msg[_0xad34[42]][_0xad34[43]]){msg[_0xad34[42]][_0xad34[62]](function(_0xf261x28){var _0xf261x29=_0xad34[44]+ Math[_0xad34[45]](32);var _0xf261x2a;_0xf261x25[_0xad34[61]](Attachment[_0xad34[60]]({name:_0xf261x28[_0xad34[47]],basename:_0xf261x29,path:path[_0xad34[58]](config[_0xad34[54]],_0xad34[55],_0xad34[56],_0xad34[42],_0xad34[57],_0xf261x29),type:_0xf261x28[_0xad34[59]],size:_0xf261x28[_0xad34[43]],MailMessageId:_0xf261x33[_0xad34[86]][0][_0xad34[33]]})[_0xad34[50]](function(_0xf261x2c){return open(_0xf261x2c[_0xad34[3]],_0xad34[53])})[_0xad34[50]](function(_0xf261x2b){_0xf261x2a= _0xf261x2b;return write(_0xf261x2a, new Buffer(_0xf261x28[_0xad34[52]][_0xad34[51]]),0,_0xf261x28[_0xad34[43]])})[_0xad34[50]](function(){return close(_0xf261x2a)})[_0xad34[50]](function(){console[_0xad34[49]](_0xad34[46],_0xf261x28[_0xad34[47]],_0xad34[48])})[_0xad34[29]](function(_0xf261x23){console[_0xad34[28]](_0xf261x23)}))})};return Promise[_0xad34[63]](_0xf261x25)})[_0xad34[29]](function(_0xf261x23){console[_0xad34[28]](_0xf261x23)})}}function handleState(_0xf261x35,_0xf261x36){return ms[_0xad34[80]](_0xf261x35)[_0xad34[50]](function(_0xf261x37){return _0xf261x37[_0xad34[70]]({state:_0xf261x36[_0xad34[89]],source:_0xf261x36[_0xad34[90]]|| null})})[_0xad34[29]](function(_0xf261x23){console[_0xad34[28]](_0xf261x23)})}function fork(_0xf261x35,_0xf261x39){return cp[_0xad34[97]](__dirname+ _0xad34[96],[_0xf261x35,_0xf261x39])[_0xad34[91]](_0xad34[93],function(_0xf261x36){switch(_0xf261x36[_0xad34[95]]){case _0xad34[94]:handleMessage(_0xf261x36);break;case _0xad34[89]:handleState(_0xf261x35,_0xf261x36);break;default:}})[_0xad34[91]](_0xad34[22],function(_0xf261x3a){console[_0xad34[49]](util[_0xad34[34]](_0xad34[92],_0xf261x39,_0xf261x3a))})[_0xad34[91]](_0xad34[28],function(_0xf261x23){console[_0xad34[28]](_0xf261x23)})}function execRequest(_0xf261x3c,_0xf261x3d,_0xf261x3e){Util[_0xad34[100]](_0xf261x3c,_0xf261x3d,_0xf261x3e)[_0xad34[50]](function(_0xf261x3f){console[_0xad34[49]](_0xad34[99])})[_0xad34[29]](function(_0xf261x23){console[_0xad34[49]](_0xad34[98])})}function onReportUpdate(_0xf261x3c){var _0xf261x41;if(_0xf261x3c[_0xad34[102]](_0xad34[101])){return Account[_0xad34[80]](parseInt(_0xf261x3c[_0xad34[111]]))[_0xad34[50]](function(_0xf261x30){if(!_0xf261x30){throw  new Error(_0xad34[104])};_0xf261x41= _0xf261x30;if(_0xf261x41[_0xad34[105]]&& _0xf261x41[_0xad34[106]]){execRequest(_0xf261x3c[_0xad34[87]],_0xf261x41[_0xad34[105]],_0xf261x41[_0xad34[106]])}else {throw  new Error(_0xad34[107])};if(_0xf261x41[_0xad34[108]][_0xad34[43]]){_[_0xad34[62]](_0xf261x41[_0xad34[108]],function(_0xf261x42){if(_0xf261x42[_0xad34[109]]){Util[_0xad34[110]](_0xf261x42,_0xf261x3c)}})}})[_0xad34[29]](function(_0xf261x23){console[_0xad34[49]](_0xad34[103],_0xf261x23)})};if(_0xf261x3c[_0xad34[102]](_0xad34[112])){return Account[_0xad34[80]](_0xf261x3c[_0xad34[111]])[_0xad34[50]](function(_0xf261x30){if(!_0xf261x30){throw  new Error(_0xad34[113])};_0xf261x41= _0xf261x30;if(_0xf261x41[_0xad34[114]]&& _0xf261x41[_0xad34[115]]){execRequest(_0xf261x3c[_0xad34[87]],_0xf261x41[_0xad34[114]],_0xf261x41[_0xad34[115]])}})[_0xad34[29]](function(_0xf261x23){console[_0xad34[49]](_0xad34[103],_0xf261x23)})}}module[_0xad34[116]]= function(){var _0xf261x43={};var _0xf261x44;process[_0xad34[91]](_0xad34[117],function(_0xf261x3a){for(var _0xf261x45 in _0xf261x43){if(_0xf261x43[_0xf261x45]){_0xf261x43[_0xf261x45][_0xad34[118]]()}}});ReportMail[_0xad34[119]](function(_0xf261x3c){onReportUpdate(_0xf261x3c)});ms[_0xad34[121]](function(_0xf261x37){_0xf261x43[_0xf261x37[_0xad34[33]]]= fork(_0xf261x37[_0xad34[33]],_0xf261x37[_0xad34[120]])});ms[_0xad34[119]](function(_0xf261x37){if(_0xf261x43[_0xf261x37[_0xad34[33]]]){if(_0xf261x37[_0xad34[102]](_0xad34[89])|| _0xf261x37[_0xad34[102]](_0xad34[90])){console[_0xad34[49]](util[_0xad34[34]](_0xad34[122],_0xf261x37[_0xad34[33]],_0xf261x43[_0xf261x37[_0xad34[33]]][_0xad34[123]]));clearTimeout(_0xf261x44);switch(_0xf261x37[_0xad34[89]]){case _0xad34[124]:_0xf261x44= setTimeout(function(){_0xf261x43[_0xf261x37[_0xad34[33]]]= fork(_0xf261x37[_0xad34[33]],_0xf261x37[_0xad34[120]])},10000);break;default:}}else {_0xf261x43[_0xf261x37[_0xad34[33]]][_0xad34[118]]();_0xf261x43[_0xf261x37[_0xad34[33]]]= null;_0xf261x43[_0xf261x37[_0xad34[33]]]= fork(_0xf261x37[_0xad34[33]],_0xf261x37[_0xad34[120]])}}});ms[_0xad34[126]](function(_0xf261x37){if(_0xf261x43[_0xf261x37[_0xad34[33]]]){console[_0xad34[49]](util[_0xad34[34]](_0xad34[125],_0xf261x37[_0xad34[33]],_0xf261x43[_0xf261x37[_0xad34[33]]][_0xad34[123]]));_0xf261x43[_0xf261x37[_0xad34[33]]][_0xad34[118]]();_0xf261x43[_0xf261x37[_0xad34[33]]]= null}});ms[_0xad34[127]]()[_0xad34[50]](function(_0xf261x46){_0xf261x46[_0xad34[62]](function(_0xf261x37){_0xf261x43[_0xf261x37[_0xad34[33]]]= fork(_0xf261x37[_0xad34[33]],_0xf261x37[_0xad34[120]])})})[_0xad34[29]](function(_0xf261x23){console[_0xad34[28]](_0xf261x23)})}
\ No newline at end of file
+var _0xc007=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x70\x61\x74\x68","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x49\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x43\x6F\x6D\x70\x61\x6E\x79","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x6F\x6D\x65\x6E\x74","\x6F\x70\x65\x6E","\x66\x73","\x70\x72\x6F\x6D\x69\x73\x69\x66\x79","\x63\x6C\x6F\x73\x65","\x77\x72\x69\x74\x65","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x2E\x2E\x2F\x72\x6F\x75\x74\x69\x6E\x67\x2F\x73\x63\x68\x65\x64\x75\x6C\x65\x72","\x2E\x2E\x2F\x75\x74\x69\x6C","\x69\x6E\x52\x65\x70\x6C\x79\x54\x6F","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6D\x61\x69\x6C","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x69\x64","\x66\x6F\x72\x6D\x61\x74","\x73\x75\x62\x6A\x65\x63\x74","\x6E\x61\x6D\x65","\x61\x64\x64\x72\x65\x73\x73","\x66\x72\x6F\x6D","\x63\x63","\x6D\x61\x70","\x69\x6E\x69\x74","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x5F","\x72\x61\x6E\x64\x6F\x6D","\x46\x69\x6C\x65","\x66\x69\x6C\x65\x4E\x61\x6D\x65","\x70\x72\x6F\x70\x65\x72\x6C\x79\x20\x73\x61\x76\x65\x64\x2E","\x6C\x6F\x67","\x74\x68\x65\x6E","\x64\x61\x74\x61","\x63\x6F\x6E\x74\x65\x6E\x74","\x77","\x72\x6F\x6F\x74","\x73\x65\x72\x76\x65\x72","\x66\x69\x6C\x65\x73","\x2F","\x6A\x6F\x69\x6E","\x63\x6F\x6E\x74\x65\x6E\x74\x54\x79\x70\x65","\x63\x72\x65\x61\x74\x65","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x61\x6C\x6C","\x6D\x65\x73\x73\x61\x67\x65\x49\x64","\x52\x45\x43\x45\x49\x56\x45\x44","\x74\x6F","\x62\x63\x63","\x74\x65\x78\x74","\x6D\x61\x69\x6C\x49\x6E","\x75\x70\x64\x61\x74\x65","\x73\x74\x61\x74\x75\x73","\x43\x4C\x4F\x53\x45\x44","\x73\x70\x72\x65\x61\x64","\x4C\x69\x73\x74\x49\x64","\x40","\x73\x70\x6C\x69\x74","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x6D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x4F\x50\x45\x4E","\x73\x79\x73\x74\x65\x6D","\x3B","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x4E\x45\x57","\x73\x74\x61\x74\x65","\x73\x6F\x75\x72\x63\x65","\x6F\x6E","\x49\x4D\x41\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x45\x58\x49\x54\x45\x44\x20\x57\x49\x54\x48\x20\x43\x4F\x44\x45\x20\x25\x73","\x6D\x65\x73\x73\x61\x67\x65","\x6D\x73\x67","\x74\x79\x70\x65","\x2F\x69\x6D\x61\x70","\x66\x6F\x72\x6B","\x72\x65\x71\x75\x65\x73\x74\x20\x66\x61\x69\x6C\x65\x64\x21","\x72\x65\x71\x75\x65\x73\x74\x20\x73\x75\x63\x63\x65\x73\x73\x65\x66\x75\x6C\x21","\x73\x65\x6E\x64\x52\x65\x71\x75\x65\x73\x74","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x64","\x63\x68\x61\x6E\x67\x65\x64","\x65\x72\x72","\x4D\x61\x69\x6C\x20\x61\x63\x63\x6F\x75\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x61\x63\x63\x65\x70\x74\x4D\x65\x74\x68\x6F\x64","\x61\x63\x63\x65\x70\x74\x55\x72\x6C","\x4D\x61\x69\x6C\x20\x41\x63\x63\x6F\x75\x6E\x74\x3A\x20","\x20\x48\x54\x54\x50\x20\x4D\x65\x74\x68\x6F\x64\x20\x6F\x72\x20\x55\x52\x4C\x20\x69\x73\x20\x6E\x6F\x74\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x64","\x61\x63\x74\x69\x6F\x6E\x73","\x65\x6E\x61\x62\x6C\x65\x64","\x65\x78\x65\x63\x41\x63\x74\x69\x6F\x6E","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x72\x65\x6A\x65\x63\x74\x65\x64\x41\x74","\x46\x61\x78\x20\x61\x63\x63\x6F\x75\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x72\x65\x6A\x65\x63\x74\x4D\x65\x74\x68\x6F\x64","\x72\x65\x6A\x65\x63\x74\x55\x72\x6C","\x65\x78\x70\x6F\x72\x74\x73","\x65\x78\x69\x74","\x6B\x69\x6C\x6C","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x49\x4D\x41\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x55\x50\x44\x41\x54\x45\x44\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x70\x69\x64","\x44\x49\x53\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44","\x49\x4D\x41\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x44\x45\x53\x54\x52\x4F\x59\x45\x44\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x66\x69\x6E\x64\x41\x6C\x6C"];_0xc007[0];const _=require(_0xc007[1]);const util=require(_0xc007[2]);const path=require(_0xc007[3]);const cp=require(_0xc007[4]);const ms=require(_0xc007[6])[_0xc007[5]];const msg=require(_0xc007[6])[_0xc007[7]];const Room=require(_0xc007[6])[_0xc007[8]];const Status=require(_0xc007[6])[_0xc007[9]];const Message=require(_0xc007[6])[_0xc007[7]];const Account=require(_0xc007[6])[_0xc007[10]];const Contact=require(_0xc007[6])[_0xc007[11]];const Company=require(_0xc007[6])[_0xc007[12]];const Attachment=require(_0xc007[6])[_0xc007[13]];const ReportMail=require(_0xc007[6])[_0xc007[14]];const ReportMailRoom=require(_0xc007[6])[_0xc007[15]];const ReportMailSession=require(_0xc007[6])[_0xc007[16]];const Promise=require(_0xc007[17]);const moment=require(_0xc007[18]);const open=Promise[_0xc007[21]](require(_0xc007[20])[_0xc007[19]]);const close=Promise[_0xc007[21]](require(_0xc007[20])[_0xc007[22]]);const write=Promise[_0xc007[21]](require(_0xc007[20])[_0xc007[23]]);const config=require(_0xc007[24]);var Scheduler=require(_0xc007[25]);var Util=require(_0xc007[26]);function handleMessage(msg){var _0x3286x1a;var _0x3286x1b;var _0x3286x1c;var _0x3286x1d;var _0x3286x1e;var _0x3286x1f,_0x3286x20,_0x3286x21,_0x3286x22;if(msg[_0xc007[27]]){return Message[_0xc007[78]]({where:{messageId:msg[_0xc007[27]][0]}})[_0xc007[50]](function(_0x3286x2e){if(_0x3286x2e){return _0x3286x2e[_0xc007[85]]()[_0xc007[50]](function(_0x3286x2d){_0x3286x1a= _0x3286x2d;if(_0x3286x2d[_0xc007[71]]!== _0xc007[72]){return _0x3286x1a[_0xc007[70]]({status:_0xc007[81],openReason:_0xc007[82]},{individualHooks:true})[_0xc007[50]](function(){return Account[_0xc007[80]](msg[_0xc007[79]])[_0xc007[50]](function(_0x3286x30){_0x3286x1c= _0x3286x30;if(_0x3286x1c[_0xc007[74]]){return Company[_0xc007[78]]({where:{emailDomain:msg[_0xc007[38]][0][_0xc007[37]][_0xc007[76]](_0xc007[75])[1]}})[_0xc007[50]](function(_0x3286x31){return Contact[_0xc007[77]]({where:{email:msg[_0xc007[38]][0][_0xc007[37]]},defaults:{email:msg[_0xc007[38]][0][_0xc007[37]],firstName:msg[_0xc007[38]][0][_0xc007[36]]|| msg[_0xc007[38]][0][_0xc007[37]][_0xc007[76]](_0xc007[75])[0],ListId:_0x3286x1c[_0xc007[74]],CompanyId:_0x3286x31?_0x3286x31[_0xc007[33]]:null}})})}else {return []}})[_0xc007[73]](function(_0x3286x2f){_0x3286x1d= _0x3286x2f})})}else {return Account[_0xc007[80]](msg[_0xc007[79]])[_0xc007[50]](function(_0x3286x30){_0x3286x1c= _0x3286x30;if(_0x3286x1c[_0xc007[74]]){return Company[_0xc007[78]]({where:{emailDomain:msg[_0xc007[38]][0][_0xc007[37]][_0xc007[76]](_0xc007[75])[1]}})[_0xc007[50]](function(_0x3286x31){return Contact[_0xc007[77]]({where:{email:msg[_0xc007[38]][0][_0xc007[37]]},defaults:{email:msg[_0xc007[38]][0][_0xc007[37]],firstName:msg[_0xc007[38]][0][_0xc007[36]]|| msg[_0xc007[38]][0][_0xc007[37]][_0xc007[76]](_0xc007[75])[0],ListId:_0x3286x1c[_0xc007[74]],CompanyId:_0x3286x31?_0x3286x31[_0xc007[33]]:null}})})}else {return []}})[_0xc007[73]](function(_0x3286x2f){_0x3286x1d= _0x3286x2f;return Room[_0xc007[60]]({subject:msg[_0xc007[35]],from:_[_0xc007[40]](msg[_0xc007[38]],_0xc007[37])[_0xc007[58]](_0xc007[83]),account:_0x3286x1c[_0xc007[36]],attachment:msg[_0xc007[42]]&& msg[_0xc007[42]][_0xc007[43]],lastEvent:_0xc007[65],lastEventAt:moment()[_0xc007[34]](_0xc007[84]),arrivedAt:moment()[_0xc007[34]](_0xc007[84]),MailAccountId:_0x3286x1c[_0xc007[33]],ParentId:_0x3286x2d[_0xc007[33]]})})[_0xc007[50]](function(_0x3286x2d){_0x3286x1a= _0x3286x2d})}})}else {return Account[_0xc007[80]](msg[_0xc007[79]])[_0xc007[50]](function(_0x3286x30){_0x3286x1c= _0x3286x30;if(_0x3286x1c[_0xc007[74]]){return Company[_0xc007[78]]({where:{emailDomain:msg[_0xc007[38]][0][_0xc007[37]][_0xc007[76]](_0xc007[75])[1]}})[_0xc007[50]](function(_0x3286x31){return Contact[_0xc007[77]]({where:{email:msg[_0xc007[38]][0][_0xc007[37]]},defaults:{email:msg[_0xc007[38]][0][_0xc007[37]],firstName:msg[_0xc007[38]][0][_0xc007[36]]|| msg[_0xc007[38]][0][_0xc007[37]][_0xc007[76]](_0xc007[75])[0],ListId:_0x3286x1c[_0xc007[74]],CompanyId:_0x3286x31?_0x3286x31[_0xc007[33]]:null}})})}else {return []}})[_0xc007[73]](function(_0x3286x2f){_0x3286x1d= _0x3286x2f;return Room[_0xc007[60]]({subject:msg[_0xc007[35]],from:_[_0xc007[40]](msg[_0xc007[38]],_0xc007[37])[_0xc007[58]](_0xc007[83]),account:_0x3286x1c[_0xc007[36]],attachment:msg[_0xc007[42]]&& msg[_0xc007[42]][_0xc007[43]],lastEvent:_0xc007[65],lastEventAt:moment()[_0xc007[34]](_0xc007[84]),arrivedAt:moment()[_0xc007[34]](_0xc007[84]),MailAccountId:_0x3286x1c[_0xc007[33]]})})[_0xc007[50]](function(_0x3286x2d){_0x3286x1a= _0x3286x2d})}})[_0xc007[50]](function(){return _0x3286x1a[_0xc007[70]]({lastEvent:_0xc007[65],mailIn:++_0x3286x1a[_0xc007[69]]})})[_0xc007[50]](function(_0x3286x2d){return Message[_0xc007[60]]({fromId:_0x3286x1d?_0x3286x1d[_0xc007[33]]:null,messageId:msg[_0xc007[64]],status:_0xc007[65],subject:msg[_0xc007[35]],from:_[_0xc007[40]](msg[_0xc007[38]],_0xc007[37]),to:msg[_0xc007[66]]?_[_0xc007[40]](msg[_0xc007[66]],_0xc007[37]):[],cc:msg[_0xc007[39]]?_[_0xc007[40]](msg[_0xc007[39]],_0xc007[37]):[],bcc:msg[_0xc007[67]]?_[_0xc007[40]](msg[_0xc007[67]],_0xc007[37]):[],text:msg[_0xc007[68]]|| null,MailRoomId:_0x3286x1a[_0xc007[33]]})})[_0xc007[50]](function(_0x3286x24){var _0x3286x25=[];var _0x3286x26=_0x3286x24;var _0x3286x27= new Scheduler({channel:_0xc007[30],uniqueid:util[_0xc007[34]](_0xc007[31],moment()[_0xc007[32]](),_0x3286x1a[_0xc007[33]]),subject:msg[_0xc007[35]],messageid:_0x3286x26[_0xc007[33]],roomid:_0x3286x1a[_0xc007[33]],accountid:_0x3286x1c[_0xc007[33]],accountname:_0x3286x1c[_0xc007[36]],accountaddress:_0x3286x1c[_0xc007[37]],from:msg[_0xc007[38]][0][_0xc007[37]],cc:msg[_0xc007[39]]?_[_0xc007[40]](msg[_0xc007[39]],_0xc007[37]):[]});_0x3286x27[_0xc007[41]]();if(msg[_0xc007[42]]&& msg[_0xc007[42]][_0xc007[43]]){msg[_0xc007[42]][_0xc007[62]](function(_0x3286x28){var _0x3286x29=_0xc007[44]+ Math[_0xc007[45]](32);var _0x3286x2a;_0x3286x25[_0xc007[61]](Attachment[_0xc007[60]]({name:_0x3286x28[_0xc007[47]],basename:_0x3286x29,path:path[_0xc007[58]](config[_0xc007[54]],_0xc007[55],_0xc007[56],_0xc007[42],_0xc007[57],_0x3286x29),type:_0x3286x28[_0xc007[59]],size:_0x3286x28[_0xc007[43]],MailMessageId:_0x3286x26[_0xc007[33]]})[_0xc007[50]](function(_0x3286x2c){return open(_0x3286x2c[_0xc007[3]],_0xc007[53])})[_0xc007[50]](function(_0x3286x2b){_0x3286x2a= _0x3286x2b;return write(_0x3286x2a, new Buffer(_0x3286x28[_0xc007[52]][_0xc007[51]]),0,_0x3286x28[_0xc007[43]])})[_0xc007[50]](function(){return close(_0x3286x2a)})[_0xc007[50]](function(){console[_0xc007[49]](_0xc007[46],_0x3286x28[_0xc007[47]],_0xc007[48])})[_0xc007[29]](function(_0x3286x23){console[_0xc007[28]](_0x3286x23)}))})};return Promise[_0xc007[63]](_0x3286x25)})[_0xc007[29]](function(_0x3286x23){console[_0xc007[28]](_0x3286x23)})}else {return Account[_0xc007[80]](msg[_0xc007[79]])[_0xc007[50]](function(_0x3286x30){_0x3286x1c= _0x3286x30;if(_0x3286x1c[_0xc007[74]]){return Company[_0xc007[78]]({where:{emailDomain:msg[_0xc007[38]][0][_0xc007[37]][_0xc007[76]](_0xc007[75])[1]}})[_0xc007[50]](function(_0x3286x31){return Contact[_0xc007[77]]({where:{email:msg[_0xc007[38]][0][_0xc007[37]]},defaults:{email:msg[_0xc007[38]][0][_0xc007[37]],firstName:msg[_0xc007[38]][0][_0xc007[36]]|| msg[_0xc007[38]][0][_0xc007[37]][_0xc007[76]](_0xc007[75])[0],ListId:_0x3286x1c[_0xc007[74]],CompanyId:_0x3286x31?_0x3286x31[_0xc007[33]]:null}})})}else {return []}})[_0xc007[73]](function(_0x3286x2f){_0x3286x1d= _0x3286x2f;return Room[_0xc007[60]]({mailIn:1,account:_0x3286x1c[_0xc007[36]],subject:msg[_0xc007[35]],from:_[_0xc007[40]](msg[_0xc007[38]],_0xc007[37])[_0xc007[58]](_0xc007[83]),status:_0xc007[88],lastEvent:_0xc007[65],lastEventAt:moment()[_0xc007[34]](_0xc007[84]),arrivedAt:moment()[_0xc007[34]](_0xc007[84]),attachment:msg[_0xc007[42]]&& msg[_0xc007[42]][_0xc007[43]],MailMessages:[{messageId:msg[_0xc007[64]],subject:msg[_0xc007[35]],from:_[_0xc007[40]](msg[_0xc007[38]],_0xc007[37]),fromId:_0x3286x1d?_0x3286x1d[_0xc007[33]]:null,to:msg[_0xc007[66]]?_[_0xc007[40]](msg[_0xc007[66]],_0xc007[37]):[],cc:msg[_0xc007[39]]?_[_0xc007[40]](msg[_0xc007[39]],_0xc007[37]):[],bcc:msg[_0xc007[67]]?_[_0xc007[40]](msg[_0xc007[67]],_0xc007[37]):[],status:_0xc007[65],text:msg[_0xc007[68]]|| null}],MailAccountId:msg[_0xc007[79]]},{include:[{model:Message}]})})[_0xc007[50]](function(_0x3286x32){var _0x3286x25=[];var _0x3286x33=_0x3286x32;var _0x3286x27= new Scheduler({channel:_0xc007[30],uniqueid:util[_0xc007[34]](_0xc007[31],moment()[_0xc007[32]](),_0x3286x33[_0xc007[33]]),subject:msg[_0xc007[35]],messageid:_0x3286x33[_0xc007[86]][0][_0xc007[33]],roomid:_0x3286x33[_0xc007[33]],accountid:_0x3286x1c[_0xc007[33]],accountname:_0x3286x1c[_0xc007[36]],accountaddress:_0x3286x1c[_0xc007[37]],from:msg[_0xc007[38]][0][_0xc007[37]],cc:msg[_0xc007[39]]?_[_0xc007[40]](msg[_0xc007[39]],_0xc007[37]):[]},_0x3286x33[_0xc007[86]][0][_0xc007[87]]);_0x3286x27[_0xc007[41]]();if(msg[_0xc007[42]]&& msg[_0xc007[42]][_0xc007[43]]){msg[_0xc007[42]][_0xc007[62]](function(_0x3286x28){var _0x3286x29=_0xc007[44]+ Math[_0xc007[45]](32);var _0x3286x2a;_0x3286x25[_0xc007[61]](Attachment[_0xc007[60]]({name:_0x3286x28[_0xc007[47]],basename:_0x3286x29,path:path[_0xc007[58]](config[_0xc007[54]],_0xc007[55],_0xc007[56],_0xc007[42],_0xc007[57],_0x3286x29),type:_0x3286x28[_0xc007[59]],size:_0x3286x28[_0xc007[43]],MailMessageId:_0x3286x33[_0xc007[86]][0][_0xc007[33]]})[_0xc007[50]](function(_0x3286x2c){return open(_0x3286x2c[_0xc007[3]],_0xc007[53])})[_0xc007[50]](function(_0x3286x2b){_0x3286x2a= _0x3286x2b;return write(_0x3286x2a, new Buffer(_0x3286x28[_0xc007[52]][_0xc007[51]]),0,_0x3286x28[_0xc007[43]])})[_0xc007[50]](function(){return close(_0x3286x2a)})[_0xc007[50]](function(){console[_0xc007[49]](_0xc007[46],_0x3286x28[_0xc007[47]],_0xc007[48])})[_0xc007[29]](function(_0x3286x23){console[_0xc007[28]](_0x3286x23)}))})};return Promise[_0xc007[63]](_0x3286x25)})[_0xc007[29]](function(_0x3286x23){console[_0xc007[28]](_0x3286x23)})}}function handleState(_0x3286x35,_0x3286x36){return ms[_0xc007[80]](_0x3286x35)[_0xc007[50]](function(_0x3286x37){return _0x3286x37[_0xc007[70]]({state:_0x3286x36[_0xc007[89]],source:_0x3286x36[_0xc007[90]]|| null})})[_0xc007[29]](function(_0x3286x23){console[_0xc007[28]](_0x3286x23)})}function fork(_0x3286x35,_0x3286x39){return cp[_0xc007[97]](__dirname+ _0xc007[96],[_0x3286x35,_0x3286x39])[_0xc007[91]](_0xc007[93],function(_0x3286x36){switch(_0x3286x36[_0xc007[95]]){case _0xc007[94]:handleMessage(_0x3286x36);break;case _0xc007[89]:handleState(_0x3286x35,_0x3286x36);break;default:}})[_0xc007[91]](_0xc007[22],function(_0x3286x3a){console[_0xc007[49]](util[_0xc007[34]](_0xc007[92],_0x3286x39,_0x3286x3a))})[_0xc007[91]](_0xc007[28],function(_0x3286x23){console[_0xc007[28]](_0x3286x23)})}function execRequest(_0x3286x3c,_0x3286x3d,_0x3286x3e){Util[_0xc007[100]](_0x3286x3c,_0x3286x3d,_0x3286x3e)[_0xc007[50]](function(_0x3286x3f){console[_0xc007[49]](_0xc007[99])})[_0xc007[29]](function(_0x3286x23){console[_0xc007[49]](_0xc007[98])})}function onReportUpdate(_0x3286x3c){var _0x3286x41;if(_0x3286x3c[_0xc007[102]](_0xc007[101])){return Account[_0xc007[80]](parseInt(_0x3286x3c[_0xc007[112]]))[_0xc007[50]](function(_0x3286x30){if(!_0x3286x30){throw  new Error(_0xc007[104])};_0x3286x41= _0x3286x30;if(_0x3286x41[_0xc007[105]]&& _0x3286x41[_0xc007[106]]){execRequest(_0x3286x3c[_0xc007[87]],_0x3286x41[_0xc007[105]],_0x3286x41[_0xc007[106]])}else {console[_0xc007[49]](_0xc007[107]+ _0x3286x41[_0xc007[36]]+ _0xc007[108])};if(_0x3286x41[_0xc007[109]][_0xc007[43]]){_[_0xc007[62]](_0x3286x41[_0xc007[109]],function(_0x3286x42){if(_0x3286x42[_0xc007[110]]){Util[_0xc007[111]](_0x3286x42,_0x3286x3c)}})}})[_0xc007[29]](function(_0x3286x23){console[_0xc007[49]](_0xc007[103],_0x3286x23)})};if(_0x3286x3c[_0xc007[102]](_0xc007[113])){return Account[_0xc007[80]](_0x3286x3c[_0xc007[112]])[_0xc007[50]](function(_0x3286x30){if(!_0x3286x30){throw  new Error(_0xc007[114])};_0x3286x41= _0x3286x30;if(_0x3286x41[_0xc007[115]]&& _0x3286x41[_0xc007[116]]){execRequest(_0x3286x3c[_0xc007[87]],_0x3286x41[_0xc007[115]],_0x3286x41[_0xc007[116]])}})[_0xc007[29]](function(_0x3286x23){console[_0xc007[49]](_0xc007[103],_0x3286x23)})}}module[_0xc007[117]]= function(){var _0x3286x43={};var _0x3286x44;process[_0xc007[91]](_0xc007[118],function(_0x3286x3a){for(var _0x3286x45 in _0x3286x43){if(_0x3286x43[_0x3286x45]){_0x3286x43[_0x3286x45][_0xc007[119]]()}}});ReportMail[_0xc007[120]](function(_0x3286x3c){onReportUpdate(_0x3286x3c)});ms[_0xc007[122]](function(_0x3286x37){_0x3286x43[_0x3286x37[_0xc007[33]]]= fork(_0x3286x37[_0xc007[33]],_0x3286x37[_0xc007[121]])});ms[_0xc007[120]](function(_0x3286x37){if(_0x3286x43[_0x3286x37[_0xc007[33]]]){if(_0x3286x37[_0xc007[102]](_0xc007[89])|| _0x3286x37[_0xc007[102]](_0xc007[90])){console[_0xc007[49]](util[_0xc007[34]](_0xc007[123],_0x3286x37[_0xc007[33]],_0x3286x43[_0x3286x37[_0xc007[33]]][_0xc007[124]]));clearTimeout(_0x3286x44);switch(_0x3286x37[_0xc007[89]]){case _0xc007[125]:_0x3286x44= setTimeout(function(){_0x3286x43[_0x3286x37[_0xc007[33]]]= fork(_0x3286x37[_0xc007[33]],_0x3286x37[_0xc007[121]])},10000);break;default:}}else {_0x3286x43[_0x3286x37[_0xc007[33]]][_0xc007[119]]();_0x3286x43[_0x3286x37[_0xc007[33]]]= null;_0x3286x43[_0x3286x37[_0xc007[33]]]= fork(_0x3286x37[_0xc007[33]],_0x3286x37[_0xc007[121]])}}});ms[_0xc007[127]](function(_0x3286x37){if(_0x3286x43[_0x3286x37[_0xc007[33]]]){console[_0xc007[49]](util[_0xc007[34]](_0xc007[126],_0x3286x37[_0xc007[33]],_0x3286x43[_0x3286x37[_0xc007[33]]][_0xc007[124]]));_0x3286x43[_0x3286x37[_0xc007[33]]][_0xc007[119]]();_0x3286x43[_0x3286x37[_0xc007[33]]]= null}});ms[_0xc007[128]]()[_0xc007[50]](function(_0x3286x46){_0x3286x46[_0xc007[62]](function(_0x3286x37){_0x3286x43[_0x3286x37[_0xc007[33]]]= fork(_0x3286x37[_0xc007[33]],_0x3286x37[_0xc007[121]])})})[_0xc007[29]](function(_0x3286x23){console[_0xc007[28]](_0x3286x23)})}
\ No newline at end of file