Built motion from commit 832e619.|0.0.137
[motion.git] / server / config / imap / index.js
index 274101e..01c7373 100644 (file)
@@ -1 +1 @@
-var _0x3653=["\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","\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","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65\x73","\x4E\x45\x57","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\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","\x65\x78\x70\x6F\x72\x74\x73","\x65\x78\x69\x74","\x6B\x69\x6C\x6C","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x63\x68\x61\x6E\x67\x65\x64","\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","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\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"];_0x3653[0];const _=require(_0x3653[1]);const util=require(_0x3653[2]);const path=require(_0x3653[3]);const cp=require(_0x3653[4]);const ms=require(_0x3653[6])[_0x3653[5]];const msg=require(_0x3653[6])[_0x3653[7]];const Room=require(_0x3653[6])[_0x3653[8]];const Status=require(_0x3653[6])[_0x3653[9]];const Message=require(_0x3653[6])[_0x3653[7]];const Account=require(_0x3653[6])[_0x3653[10]];const Contact=require(_0x3653[6])[_0x3653[11]];const Company=require(_0x3653[6])[_0x3653[12]];const Attachment=require(_0x3653[6])[_0x3653[13]];const ReportMail=require(_0x3653[6])[_0x3653[14]];const ReportMailRoom=require(_0x3653[6])[_0x3653[15]];const ReportMailSession=require(_0x3653[6])[_0x3653[16]];const Promise=require(_0x3653[17]);const moment=require(_0x3653[18]);const open=Promise[_0x3653[21]](require(_0x3653[20])[_0x3653[19]]);const close=Promise[_0x3653[21]](require(_0x3653[20])[_0x3653[22]]);const write=Promise[_0x3653[21]](require(_0x3653[20])[_0x3653[23]]);const config=require(_0x3653[24]);var Scheduler=require(_0x3653[25]);function handleMessage(msg){var _0x8835x19;var _0x8835x1a;var _0x8835x1b;var _0x8835x1c;var _0x8835x1d;var _0x8835x1e,_0x8835x1f,_0x8835x20,_0x8835x21;if(msg[_0x3653[26]]){return Message[_0x3653[77]]({where:{messageId:msg[_0x3653[26]][0]}})[_0x3653[49]](function(_0x8835x2d){if(_0x8835x2d){return _0x8835x2d[_0x3653[83]]()[_0x3653[49]](function(_0x8835x2c){_0x8835x19= _0x8835x2c;if(_0x8835x2c[_0x3653[70]]!== _0x3653[71]){return _0x8835x19[_0x3653[69]]({status:_0x3653[80],openReason:_0x3653[81]},{individualHooks:true})[_0x3653[49]](function(){return Account[_0x3653[79]](msg[_0x3653[78]])[_0x3653[49]](function(_0x8835x2f){_0x8835x1b= _0x8835x2f;if(_0x8835x1b[_0x3653[73]]){return Company[_0x3653[77]]({where:{emailDomain:msg[_0x3653[37]][0][_0x3653[36]][_0x3653[75]](_0x3653[74])[1]}})[_0x3653[49]](function(_0x8835x30){return Contact[_0x3653[76]]({where:{email:msg[_0x3653[37]][0][_0x3653[36]]},defaults:{email:msg[_0x3653[37]][0][_0x3653[36]],firstName:msg[_0x3653[37]][0][_0x3653[35]]|| msg[_0x3653[37]][0][_0x3653[36]][_0x3653[75]](_0x3653[74])[0],ListId:_0x8835x1b[_0x3653[73]],CompanyId:_0x8835x30?_0x8835x30[_0x3653[32]]:null}})})}else {return []}})[_0x3653[72]](function(_0x8835x2e){_0x8835x1c= _0x8835x2e})})}else {return Account[_0x3653[79]](msg[_0x3653[78]])[_0x3653[49]](function(_0x8835x2f){_0x8835x1b= _0x8835x2f;if(_0x8835x1b[_0x3653[73]]){return Company[_0x3653[77]]({where:{emailDomain:msg[_0x3653[37]][0][_0x3653[36]][_0x3653[75]](_0x3653[74])[1]}})[_0x3653[49]](function(_0x8835x30){return Contact[_0x3653[76]]({where:{email:msg[_0x3653[37]][0][_0x3653[36]]},defaults:{email:msg[_0x3653[37]][0][_0x3653[36]],firstName:msg[_0x3653[37]][0][_0x3653[35]]|| msg[_0x3653[37]][0][_0x3653[36]][_0x3653[75]](_0x3653[74])[0],ListId:_0x8835x1b[_0x3653[73]],CompanyId:_0x8835x30?_0x8835x30[_0x3653[32]]:null}})})}else {return []}})[_0x3653[72]](function(_0x8835x2e){_0x8835x1c= _0x8835x2e;return Room[_0x3653[59]]({subject:msg[_0x3653[34]],from:_[_0x3653[39]](msg[_0x3653[37]],_0x3653[36])[_0x3653[57]](_0x3653[82]),account:_0x8835x1b[_0x3653[35]],attachment:msg[_0x3653[41]]&& msg[_0x3653[41]][_0x3653[42]],MailAccountId:_0x8835x1b[_0x3653[32]],ParentId:_0x8835x2c[_0x3653[32]]})})[_0x3653[49]](function(_0x8835x2c){_0x8835x19= _0x8835x2c})}})}else {return Account[_0x3653[79]](msg[_0x3653[78]])[_0x3653[49]](function(_0x8835x2f){_0x8835x1b= _0x8835x2f;if(_0x8835x1b[_0x3653[73]]){return Company[_0x3653[77]]({where:{emailDomain:msg[_0x3653[37]][0][_0x3653[36]][_0x3653[75]](_0x3653[74])[1]}})[_0x3653[49]](function(_0x8835x30){return Contact[_0x3653[76]]({where:{email:msg[_0x3653[37]][0][_0x3653[36]]},defaults:{email:msg[_0x3653[37]][0][_0x3653[36]],firstName:msg[_0x3653[37]][0][_0x3653[35]]|| msg[_0x3653[37]][0][_0x3653[36]][_0x3653[75]](_0x3653[74])[0],ListId:_0x8835x1b[_0x3653[73]],CompanyId:_0x8835x30?_0x8835x30[_0x3653[32]]:null}})})}else {return []}})[_0x3653[72]](function(_0x8835x2e){_0x8835x1c= _0x8835x2e;return Room[_0x3653[59]]({subject:msg[_0x3653[34]],from:_[_0x3653[39]](msg[_0x3653[37]],_0x3653[36])[_0x3653[57]](_0x3653[82]),account:_0x8835x1b[_0x3653[35]],attachment:msg[_0x3653[41]]&& msg[_0x3653[41]][_0x3653[42]],MailAccountId:_0x8835x1b[_0x3653[32]]})})[_0x3653[49]](function(_0x8835x2c){_0x8835x19= _0x8835x2c})}})[_0x3653[49]](function(){return _0x8835x19[_0x3653[69]]({lastEvent:_0x3653[64],mailIn:++_0x8835x19[_0x3653[68]]})})[_0x3653[49]](function(_0x8835x2c){return Message[_0x3653[59]]({fromId:_0x8835x1c?_0x8835x1c[_0x3653[32]]:null,messageId:msg[_0x3653[63]],status:_0x3653[64],subject:msg[_0x3653[34]],from:_[_0x3653[39]](msg[_0x3653[37]],_0x3653[36]),to:msg[_0x3653[65]]?_[_0x3653[39]](msg[_0x3653[65]],_0x3653[36]):[],cc:msg[_0x3653[38]]?_[_0x3653[39]](msg[_0x3653[38]],_0x3653[36]):[],bcc:msg[_0x3653[66]]?_[_0x3653[39]](msg[_0x3653[66]],_0x3653[36]):[],text:msg[_0x3653[67]]|| null,MailRoomId:_0x8835x19[_0x3653[32]]})})[_0x3653[49]](function(_0x8835x23){var _0x8835x24=[];var _0x8835x25=_0x8835x23;var _0x8835x26= new Scheduler({channel:_0x3653[29],uniqueid:util[_0x3653[33]](_0x3653[30],moment()[_0x3653[31]](),_0x8835x19[_0x3653[32]]),subject:msg[_0x3653[34]],messageid:_0x8835x25[_0x3653[32]],roomid:_0x8835x19[_0x3653[32]],accountid:_0x8835x1b[_0x3653[32]],accountname:_0x8835x1b[_0x3653[35]],accountaddress:_0x8835x1b[_0x3653[36]],from:msg[_0x3653[37]][0][_0x3653[36]],cc:msg[_0x3653[38]]?_[_0x3653[39]](msg[_0x3653[38]],_0x3653[36]):[]});_0x8835x26[_0x3653[40]]();if(msg[_0x3653[41]]&& msg[_0x3653[41]][_0x3653[42]]){msg[_0x3653[41]][_0x3653[61]](function(_0x8835x27){var _0x8835x28=_0x3653[43]+ Math[_0x3653[44]](32);var _0x8835x29;_0x8835x24[_0x3653[60]](Attachment[_0x3653[59]]({name:_0x8835x27[_0x3653[46]],basename:_0x8835x28,path:path[_0x3653[57]](config[_0x3653[53]],_0x3653[54],_0x3653[55],_0x3653[41],_0x3653[56],_0x8835x28),type:_0x8835x27[_0x3653[58]],size:_0x8835x27[_0x3653[42]],MailMessageId:_0x8835x25[_0x3653[32]]})[_0x3653[49]](function(_0x8835x2b){return open(_0x8835x2b[_0x3653[3]],_0x3653[52])})[_0x3653[49]](function(_0x8835x2a){_0x8835x29= _0x8835x2a;return write(_0x8835x29, new Buffer(_0x8835x27[_0x3653[51]][_0x3653[50]]),0,_0x8835x27[_0x3653[42]])})[_0x3653[49]](function(){return close(_0x8835x29)})[_0x3653[49]](function(){console[_0x3653[48]](_0x3653[45],_0x8835x27[_0x3653[46]],_0x3653[47])})[_0x3653[28]](function(_0x8835x22){console[_0x3653[27]](_0x8835x22)}))})};return Promise[_0x3653[62]](_0x8835x24)})[_0x3653[28]](function(_0x8835x22){console[_0x3653[27]](_0x8835x22)})}else {return Account[_0x3653[79]](msg[_0x3653[78]])[_0x3653[49]](function(_0x8835x2f){_0x8835x1b= _0x8835x2f;if(_0x8835x1b[_0x3653[73]]){return Company[_0x3653[77]]({where:{emailDomain:msg[_0x3653[37]][0][_0x3653[36]][_0x3653[75]](_0x3653[74])[1]}})[_0x3653[49]](function(_0x8835x30){return Contact[_0x3653[76]]({where:{email:msg[_0x3653[37]][0][_0x3653[36]]},defaults:{email:msg[_0x3653[37]][0][_0x3653[36]],firstName:msg[_0x3653[37]][0][_0x3653[35]]|| msg[_0x3653[37]][0][_0x3653[36]][_0x3653[75]](_0x3653[74])[0],ListId:_0x8835x1b[_0x3653[73]],CompanyId:_0x8835x30?_0x8835x30[_0x3653[32]]:null}})})}else {return []}})[_0x3653[72]](function(_0x8835x2e){_0x8835x1c= _0x8835x2e;return Room[_0x3653[59]]({mailIn:1,account:_0x8835x1b[_0x3653[35]],subject:msg[_0x3653[34]],from:_[_0x3653[39]](msg[_0x3653[37]],_0x3653[36])[_0x3653[57]](_0x3653[82]),status:_0x3653[85],lastEvent:_0x3653[64],lastEventAt:moment()[_0x3653[33]](_0x3653[86]),arrivedAt:moment()[_0x3653[33]](_0x3653[86]),attachment:msg[_0x3653[41]]&& msg[_0x3653[41]][_0x3653[42]],MailMessages:[{messageId:msg[_0x3653[63]],subject:msg[_0x3653[34]],from:_[_0x3653[39]](msg[_0x3653[37]],_0x3653[36]),fromId:_0x8835x1c?_0x8835x1c[_0x3653[32]]:null,to:msg[_0x3653[65]]?_[_0x3653[39]](msg[_0x3653[65]],_0x3653[36]):[],cc:msg[_0x3653[38]]?_[_0x3653[39]](msg[_0x3653[38]],_0x3653[36]):[],bcc:msg[_0x3653[66]]?_[_0x3653[39]](msg[_0x3653[66]],_0x3653[36]):[],status:_0x3653[64],text:msg[_0x3653[67]]|| null}],MailAccountId:msg[_0x3653[78]]},{include:[{model:Message}]})})[_0x3653[49]](function(_0x8835x31){var _0x8835x24=[];var _0x8835x32=_0x8835x31;var _0x8835x26= new Scheduler({channel:_0x3653[29],uniqueid:util[_0x3653[33]](_0x3653[30],moment()[_0x3653[31]](),_0x8835x32[_0x3653[32]]),subject:msg[_0x3653[34]],messageid:_0x8835x32[_0x3653[84]][0][_0x3653[32]],roomid:_0x8835x32[_0x3653[32]],accountid:_0x8835x1b[_0x3653[32]],accountname:_0x8835x1b[_0x3653[35]],accountaddress:_0x8835x1b[_0x3653[36]],from:msg[_0x3653[37]][0][_0x3653[36]],cc:msg[_0x3653[38]]?_[_0x3653[39]](msg[_0x3653[38]],_0x3653[36]):[]});_0x8835x26[_0x3653[40]]();if(msg[_0x3653[41]]&& msg[_0x3653[41]][_0x3653[42]]){msg[_0x3653[41]][_0x3653[61]](function(_0x8835x27){var _0x8835x28=_0x3653[43]+ Math[_0x3653[44]](32);var _0x8835x29;_0x8835x24[_0x3653[60]](Attachment[_0x3653[59]]({name:_0x8835x27[_0x3653[46]],basename:_0x8835x28,path:path[_0x3653[57]](config[_0x3653[53]],_0x3653[54],_0x3653[55],_0x3653[41],_0x3653[56],_0x8835x28),type:_0x8835x27[_0x3653[58]],size:_0x8835x27[_0x3653[42]],MailMessageId:_0x8835x32[_0x3653[84]][0][_0x3653[32]]})[_0x3653[49]](function(_0x8835x2b){return open(_0x8835x2b[_0x3653[3]],_0x3653[52])})[_0x3653[49]](function(_0x8835x2a){_0x8835x29= _0x8835x2a;return write(_0x8835x29, new Buffer(_0x8835x27[_0x3653[51]][_0x3653[50]]),0,_0x8835x27[_0x3653[42]])})[_0x3653[49]](function(){return close(_0x8835x29)})[_0x3653[49]](function(){console[_0x3653[48]](_0x3653[45],_0x8835x27[_0x3653[46]],_0x3653[47])})[_0x3653[28]](function(_0x8835x22){console[_0x3653[27]](_0x8835x22)}))})};return Promise[_0x3653[62]](_0x8835x24)})[_0x3653[28]](function(_0x8835x22){console[_0x3653[27]](_0x8835x22)})}}function handleState(_0x8835x34,_0x8835x35){return ms[_0x3653[79]](_0x8835x34)[_0x3653[49]](function(_0x8835x36){return _0x8835x36[_0x3653[69]]({state:_0x8835x35[_0x3653[87]],source:_0x8835x35[_0x3653[88]]|| null})})[_0x3653[28]](function(_0x8835x22){console[_0x3653[27]](_0x8835x22)})}function fork(_0x8835x34,_0x8835x38){return cp[_0x3653[95]](__dirname+ _0x3653[94],[_0x8835x34,_0x8835x38])[_0x3653[89]](_0x3653[91],function(_0x8835x35){switch(_0x8835x35[_0x3653[93]]){case _0x3653[92]:handleMessage(_0x8835x35);break;case _0x3653[87]:handleState(_0x8835x34,_0x8835x35);break;default:}})[_0x3653[89]](_0x3653[22],function(_0x8835x39){console[_0x3653[48]](util[_0x3653[33]](_0x3653[90],_0x8835x38,_0x8835x39))})[_0x3653[89]](_0x3653[27],function(_0x8835x22){console[_0x3653[27]](_0x8835x22)})}module[_0x3653[96]]= function(){var _0x8835x3a={};var _0x8835x3b;process[_0x3653[89]](_0x3653[97],function(_0x8835x39){for(var _0x8835x3c in _0x8835x3a){if(_0x8835x3a[_0x8835x3c]){_0x8835x3a[_0x8835x3c][_0x3653[98]]()}}});ms[_0x3653[100]](function(_0x8835x36){_0x8835x3a[_0x8835x36[_0x3653[32]]]= fork(_0x8835x36[_0x3653[32]],_0x8835x36[_0x3653[99]])});ms[_0x3653[105]](function(_0x8835x36){if(_0x8835x3a[_0x8835x36[_0x3653[32]]]){if(_0x8835x36[_0x3653[101]](_0x3653[87])|| _0x8835x36[_0x3653[101]](_0x3653[88])){console[_0x3653[48]](util[_0x3653[33]](_0x3653[102],_0x8835x36[_0x3653[32]],_0x8835x3a[_0x8835x36[_0x3653[32]]][_0x3653[103]]));clearTimeout(_0x8835x3b);switch(_0x8835x36[_0x3653[87]]){case _0x3653[104]:_0x8835x3b= setTimeout(function(){_0x8835x3a[_0x8835x36[_0x3653[32]]]= fork(_0x8835x36[_0x3653[32]],_0x8835x36[_0x3653[99]])},10000);break;default:}}else {_0x8835x3a[_0x8835x36[_0x3653[32]]][_0x3653[98]]();_0x8835x3a[_0x8835x36[_0x3653[32]]]= null;_0x8835x3a[_0x8835x36[_0x3653[32]]]= fork(_0x8835x36[_0x3653[32]],_0x8835x36[_0x3653[99]])}}});ms[_0x3653[107]](function(_0x8835x36){if(_0x8835x3a[_0x8835x36[_0x3653[32]]]){console[_0x3653[48]](util[_0x3653[33]](_0x3653[106],_0x8835x36[_0x3653[32]],_0x8835x3a[_0x8835x36[_0x3653[32]]][_0x3653[103]]));_0x8835x3a[_0x8835x36[_0x3653[32]]][_0x3653[98]]();_0x8835x3a[_0x8835x36[_0x3653[32]]]= null}});ms[_0x3653[108]]()[_0x3653[49]](function(_0x8835x3d){_0x8835x3d[_0x3653[61]](function(_0x8835x36){_0x8835x3a[_0x8835x36[_0x3653[32]]]= fork(_0x8835x36[_0x3653[32]],_0x8835x36[_0x3653[99]])})})[_0x3653[28]](function(_0x8835x22){console[_0x3653[27]](_0x8835x22)})}
\ No newline at end of file
+var _0x47a9=["\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","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\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","\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","\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\x61\x63\x63\x6F\x75\x6E\x74\x20\x3C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x61\x63\x63\x65\x70\x74\x20\x77\x65\x62\x68\x6F\x6F\x6B","\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\x65\x70\x74","\x72\x65\x6A\x65\x63\x74\x4D\x65\x74\x68\x6F\x64","\x72\x65\x6A\x65\x63\x74\x55\x72\x6C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x72\x65\x6A\x65\x63\x74\x20\x77\x65\x62\x68\x6F\x6F\x6B","\x72\x65\x6A\x65\x63\x74","\x63\x6C\x6F\x73\x65\x4D\x65\x74\x68\x6F\x64","\x63\x6C\x6F\x73\x65\x55\x72\x6C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x63\x6C\x6F\x73\x65\x20\x77\x65\x62\x68\x6F\x6F\x6B","\x57\x65\x62\x68\x6F\x6F\x6B\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64","\x4D\x61\x69\x6C\x20\x61\x63\x63\x6F\x75\x6E\x74\x3A\x20","\x20\x43\x72\x65\x61\x74\x65","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x66\x69\x6E\x64","\x20\x55\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x75\x6E\x73\x68\x69\x66\x74","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x72\x65\x6D\x6F\x76\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x65\x78\x70\x6F\x72\x74\x73","\x65\x78\x69\x74","\x6B\x69\x6C\x6C","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x64","\x63\x68\x61\x6E\x67\x65\x64","\x72\x65\x6A\x65\x63\x74\x65\x64\x41\x74","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x66\x69\x6E\x64\x41\x6C\x6C","\x75\x73\x65\x72\x6E\x61\x6D\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"];_0x47a9[0];const _=require(_0x47a9[1]);const util=require(_0x47a9[2]);const path=require(_0x47a9[3]);const cp=require(_0x47a9[4]);const ms=require(_0x47a9[6])[_0x47a9[5]];const msg=require(_0x47a9[6])[_0x47a9[7]];const Room=require(_0x47a9[6])[_0x47a9[8]];const Status=require(_0x47a9[6])[_0x47a9[9]];const Message=require(_0x47a9[6])[_0x47a9[7]];const Account=require(_0x47a9[6])[_0x47a9[10]];const Contact=require(_0x47a9[6])[_0x47a9[11]];const Company=require(_0x47a9[6])[_0x47a9[12]];const Attachment=require(_0x47a9[6])[_0x47a9[13]];const ReportMail=require(_0x47a9[6])[_0x47a9[14]];const ReportMailRoom=require(_0x47a9[6])[_0x47a9[15]];const ReportMailSession=require(_0x47a9[6])[_0x47a9[16]];const Promise=require(_0x47a9[17]);const moment=require(_0x47a9[18]);const open=Promise[_0x47a9[21]](require(_0x47a9[20])[_0x47a9[19]]);const close=Promise[_0x47a9[21]](require(_0x47a9[20])[_0x47a9[22]]);const write=Promise[_0x47a9[21]](require(_0x47a9[20])[_0x47a9[23]]);const config=require(_0x47a9[24]);var mailaccounts;var Scheduler=require(_0x47a9[25]);var Util=require(_0x47a9[26]);function handleMessage(msg){var _0x3f5dx1b;var _0x3f5dx1c;var _0x3f5dx1d;var _0x3f5dx1e;var _0x3f5dx1f;var _0x3f5dx20,_0x3f5dx21,_0x3f5dx22,_0x3f5dx23;if(msg[_0x47a9[27]]){return Message[_0x47a9[79]]({where:{messageId:msg[_0x47a9[27]][0]}})[_0x47a9[51]](function(_0x3f5dx2f){if(_0x3f5dx2f){return _0x3f5dx2f[_0x47a9[86]]()[_0x47a9[51]](function(_0x3f5dx2e){_0x3f5dx1b= _0x3f5dx2e;if(_0x3f5dx2e[_0x47a9[72]]!== _0x47a9[73]){return _0x3f5dx1b[_0x47a9[71]]({status:_0x47a9[82],openReason:_0x47a9[83]},{individualHooks:true})[_0x47a9[51]](function(){return Account[_0x47a9[81]](msg[_0x47a9[80]])[_0x47a9[51]](function(_0x3f5dx31){_0x3f5dx1d= _0x3f5dx31;if(_0x3f5dx1d[_0x47a9[75]]){return Company[_0x47a9[79]]({where:{emailDomain:msg[_0x47a9[38]][0][_0x47a9[37]][_0x47a9[77]](_0x47a9[76])[1]}})[_0x47a9[51]](function(_0x3f5dx32){return Contact[_0x47a9[78]]({where:{email:msg[_0x47a9[38]][0][_0x47a9[37]]},defaults:{email:msg[_0x47a9[38]][0][_0x47a9[37]],firstName:msg[_0x47a9[38]][0][_0x47a9[36]]|| msg[_0x47a9[38]][0][_0x47a9[37]][_0x47a9[77]](_0x47a9[76])[0],ListId:_0x3f5dx1d[_0x47a9[75]],CompanyId:_0x3f5dx32?_0x3f5dx32[_0x47a9[33]]:null}})})}else {return []}})[_0x47a9[74]](function(_0x3f5dx30){_0x3f5dx1e= _0x3f5dx30})})}else {return Account[_0x47a9[81]](msg[_0x47a9[80]])[_0x47a9[51]](function(_0x3f5dx31){_0x3f5dx1d= _0x3f5dx31;if(_0x3f5dx1d[_0x47a9[75]]){return Company[_0x47a9[79]]({where:{emailDomain:msg[_0x47a9[38]][0][_0x47a9[37]][_0x47a9[77]](_0x47a9[76])[1]}})[_0x47a9[51]](function(_0x3f5dx32){return Contact[_0x47a9[78]]({where:{email:msg[_0x47a9[38]][0][_0x47a9[37]]},defaults:{email:msg[_0x47a9[38]][0][_0x47a9[37]],firstName:msg[_0x47a9[38]][0][_0x47a9[36]]|| msg[_0x47a9[38]][0][_0x47a9[37]][_0x47a9[77]](_0x47a9[76])[0],ListId:_0x3f5dx1d[_0x47a9[75]],CompanyId:_0x3f5dx32?_0x3f5dx32[_0x47a9[33]]:null}})})}else {return []}})[_0x47a9[74]](function(_0x3f5dx30){_0x3f5dx1e= _0x3f5dx30;return Room[_0x47a9[61]]({subject:msg[_0x47a9[35]],from:_[_0x47a9[40]](msg[_0x47a9[38]],_0x47a9[37])[_0x47a9[59]](_0x47a9[84]),account:_0x3f5dx1d[_0x47a9[36]],attachment:msg[_0x47a9[43]]&& msg[_0x47a9[43]][_0x47a9[44]],lastEvent:_0x47a9[66],lastEventAt:moment()[_0x47a9[34]](_0x47a9[85]),arrivedAt:moment()[_0x47a9[34]](_0x47a9[85]),MailAccountId:_0x3f5dx1d[_0x47a9[33]],ParentId:_0x3f5dx2e[_0x47a9[33]]})})[_0x47a9[51]](function(_0x3f5dx2e){_0x3f5dx1b= _0x3f5dx2e})}})}else {return Account[_0x47a9[81]](msg[_0x47a9[80]])[_0x47a9[51]](function(_0x3f5dx31){_0x3f5dx1d= _0x3f5dx31;if(_0x3f5dx1d[_0x47a9[75]]){return Company[_0x47a9[79]]({where:{emailDomain:msg[_0x47a9[38]][0][_0x47a9[37]][_0x47a9[77]](_0x47a9[76])[1]}})[_0x47a9[51]](function(_0x3f5dx32){return Contact[_0x47a9[78]]({where:{email:msg[_0x47a9[38]][0][_0x47a9[37]]},defaults:{email:msg[_0x47a9[38]][0][_0x47a9[37]],firstName:msg[_0x47a9[38]][0][_0x47a9[36]]|| msg[_0x47a9[38]][0][_0x47a9[37]][_0x47a9[77]](_0x47a9[76])[0],ListId:_0x3f5dx1d[_0x47a9[75]],CompanyId:_0x3f5dx32?_0x3f5dx32[_0x47a9[33]]:null}})})}else {return []}})[_0x47a9[74]](function(_0x3f5dx30){_0x3f5dx1e= _0x3f5dx30;return Room[_0x47a9[61]]({subject:msg[_0x47a9[35]],from:_[_0x47a9[40]](msg[_0x47a9[38]],_0x47a9[37])[_0x47a9[59]](_0x47a9[84]),account:_0x3f5dx1d[_0x47a9[36]],attachment:msg[_0x47a9[43]]&& msg[_0x47a9[43]][_0x47a9[44]],lastEvent:_0x47a9[66],lastEventAt:moment()[_0x47a9[34]](_0x47a9[85]),arrivedAt:moment()[_0x47a9[34]](_0x47a9[85]),MailAccountId:_0x3f5dx1d[_0x47a9[33]]})})[_0x47a9[51]](function(_0x3f5dx2e){_0x3f5dx1b= _0x3f5dx2e})}})[_0x47a9[51]](function(){return _0x3f5dx1b[_0x47a9[71]]({lastEvent:_0x47a9[66],mailIn:++_0x3f5dx1b[_0x47a9[70]]})})[_0x47a9[51]](function(_0x3f5dx2e){return Message[_0x47a9[61]]({fromId:_0x3f5dx1e?_0x3f5dx1e[_0x47a9[33]]:null,messageId:msg[_0x47a9[65]],status:_0x47a9[66],subject:msg[_0x47a9[35]],from:_[_0x47a9[40]](msg[_0x47a9[38]],_0x47a9[37]),to:msg[_0x47a9[67]]?_[_0x47a9[40]](msg[_0x47a9[67]],_0x47a9[37]):[],cc:msg[_0x47a9[39]]?_[_0x47a9[40]](msg[_0x47a9[39]],_0x47a9[37]):[],bcc:msg[_0x47a9[68]]?_[_0x47a9[40]](msg[_0x47a9[68]],_0x47a9[37]):[],text:msg[_0x47a9[69]]|| null,MailRoomId:_0x3f5dx1b[_0x47a9[33]],accountName:_0x3f5dx1d[_0x47a9[36]],accountId:_0x3f5dx1d[_0x47a9[33]]})})[_0x47a9[51]](function(_0x3f5dx25){var _0x3f5dx26=[];var _0x3f5dx27=_0x3f5dx25;var _0x3f5dx28= new Scheduler({channel:_0x47a9[30],uniqueid:util[_0x47a9[34]](_0x47a9[31],moment()[_0x47a9[32]](),_0x3f5dx1b[_0x47a9[33]]),subject:msg[_0x47a9[35]],messageid:_0x3f5dx27[_0x47a9[33]],roomid:_0x3f5dx1b[_0x47a9[33]],accountid:_0x3f5dx1d[_0x47a9[33]],accountname:_0x3f5dx1d[_0x47a9[36]],accountaddress:_0x3f5dx1d[_0x47a9[37]],from:msg[_0x47a9[38]][0][_0x47a9[37]],cc:msg[_0x47a9[39]]?_[_0x47a9[40]](msg[_0x47a9[39]],_0x47a9[37]):[]},_0x3f5dx27[_0x47a9[41]]);_0x3f5dx28[_0x47a9[42]]();if(msg[_0x47a9[43]]&& msg[_0x47a9[43]][_0x47a9[44]]){msg[_0x47a9[43]][_0x47a9[63]](function(_0x3f5dx29){var _0x3f5dx2a=_0x47a9[45]+ Math[_0x47a9[46]](32);var _0x3f5dx2b;_0x3f5dx26[_0x47a9[62]](Attachment[_0x47a9[61]]({name:_0x3f5dx29[_0x47a9[48]],basename:_0x3f5dx2a,path:path[_0x47a9[59]](config[_0x47a9[55]],_0x47a9[56],_0x47a9[57],_0x47a9[43],_0x47a9[58],_0x3f5dx2a),type:_0x3f5dx29[_0x47a9[60]],size:_0x3f5dx29[_0x47a9[44]],MailMessageId:_0x3f5dx27[_0x47a9[33]]})[_0x47a9[51]](function(_0x3f5dx2d){return open(_0x3f5dx2d[_0x47a9[3]],_0x47a9[54])})[_0x47a9[51]](function(_0x3f5dx2c){_0x3f5dx2b= _0x3f5dx2c;return write(_0x3f5dx2b, new Buffer(_0x3f5dx29[_0x47a9[53]][_0x47a9[52]]),0,_0x3f5dx29[_0x47a9[44]])})[_0x47a9[51]](function(){return close(_0x3f5dx2b)})[_0x47a9[51]](function(){console[_0x47a9[50]](_0x47a9[47],_0x3f5dx29[_0x47a9[48]],_0x47a9[49])})[_0x47a9[29]](function(_0x3f5dx24){console[_0x47a9[28]](_0x3f5dx24)}))})};return Promise[_0x47a9[64]](_0x3f5dx26)})[_0x47a9[29]](function(_0x3f5dx24){console[_0x47a9[28]](_0x3f5dx24)})}else {return Account[_0x47a9[81]](msg[_0x47a9[80]])[_0x47a9[51]](function(_0x3f5dx31){_0x3f5dx1d= _0x3f5dx31;if(_0x3f5dx1d[_0x47a9[75]]){return Company[_0x47a9[79]]({where:{emailDomain:msg[_0x47a9[38]][0][_0x47a9[37]][_0x47a9[77]](_0x47a9[76])[1]}})[_0x47a9[51]](function(_0x3f5dx32){return Contact[_0x47a9[78]]({where:{email:msg[_0x47a9[38]][0][_0x47a9[37]]},defaults:{email:msg[_0x47a9[38]][0][_0x47a9[37]],firstName:msg[_0x47a9[38]][0][_0x47a9[36]]|| msg[_0x47a9[38]][0][_0x47a9[37]][_0x47a9[77]](_0x47a9[76])[0],ListId:_0x3f5dx1d[_0x47a9[75]],CompanyId:_0x3f5dx32?_0x3f5dx32[_0x47a9[33]]:null}})})}else {return []}})[_0x47a9[74]](function(_0x3f5dx30){_0x3f5dx1e= _0x3f5dx30;return Room[_0x47a9[61]]({mailIn:1,account:_0x3f5dx1d[_0x47a9[36]],subject:msg[_0x47a9[35]],from:_[_0x47a9[40]](msg[_0x47a9[38]],_0x47a9[37])[_0x47a9[59]](_0x47a9[84]),status:_0x47a9[88],lastEvent:_0x47a9[66],lastEventAt:moment()[_0x47a9[34]](_0x47a9[85]),arrivedAt:moment()[_0x47a9[34]](_0x47a9[85]),attachment:msg[_0x47a9[43]]&& msg[_0x47a9[43]][_0x47a9[44]],MailMessages:[{messageId:msg[_0x47a9[65]],subject:msg[_0x47a9[35]],from:_[_0x47a9[40]](msg[_0x47a9[38]],_0x47a9[37]),fromId:_0x3f5dx1e?_0x3f5dx1e[_0x47a9[33]]:null,to:msg[_0x47a9[67]]?_[_0x47a9[40]](msg[_0x47a9[67]],_0x47a9[37]):[],cc:msg[_0x47a9[39]]?_[_0x47a9[40]](msg[_0x47a9[39]],_0x47a9[37]):[],bcc:msg[_0x47a9[68]]?_[_0x47a9[40]](msg[_0x47a9[68]],_0x47a9[37]):[],status:_0x47a9[66],text:msg[_0x47a9[69]]|| null,accountName:_0x3f5dx1d[_0x47a9[36]],accountId:_0x3f5dx1d[_0x47a9[33]]}],MailAccountId:msg[_0x47a9[80]]},{include:[{model:Message}]})})[_0x47a9[51]](function(_0x3f5dx33){var _0x3f5dx26=[];var _0x3f5dx34=_0x3f5dx33;var _0x3f5dx28= new Scheduler({channel:_0x47a9[30],uniqueid:util[_0x47a9[34]](_0x47a9[31],moment()[_0x47a9[32]](),_0x3f5dx34[_0x47a9[33]]),subject:msg[_0x47a9[35]],messageid:_0x3f5dx34[_0x47a9[87]][0][_0x47a9[33]],roomid:_0x3f5dx34[_0x47a9[33]],accountid:_0x3f5dx1d[_0x47a9[33]],accountname:_0x3f5dx1d[_0x47a9[36]],accountaddress:_0x3f5dx1d[_0x47a9[37]],from:msg[_0x47a9[38]][0][_0x47a9[37]],cc:msg[_0x47a9[39]]?_[_0x47a9[40]](msg[_0x47a9[39]],_0x47a9[37]):[]},_0x3f5dx34[_0x47a9[87]][0][_0x47a9[41]]);_0x3f5dx28[_0x47a9[42]]();if(msg[_0x47a9[43]]&& msg[_0x47a9[43]][_0x47a9[44]]){msg[_0x47a9[43]][_0x47a9[63]](function(_0x3f5dx29){var _0x3f5dx2a=_0x47a9[45]+ Math[_0x47a9[46]](32);var _0x3f5dx2b;_0x3f5dx26[_0x47a9[62]](Attachment[_0x47a9[61]]({name:_0x3f5dx29[_0x47a9[48]],basename:_0x3f5dx2a,path:path[_0x47a9[59]](config[_0x47a9[55]],_0x47a9[56],_0x47a9[57],_0x47a9[43],_0x47a9[58],_0x3f5dx2a),type:_0x3f5dx29[_0x47a9[60]],size:_0x3f5dx29[_0x47a9[44]],MailMessageId:_0x3f5dx34[_0x47a9[87]][0][_0x47a9[33]]})[_0x47a9[51]](function(_0x3f5dx2d){return open(_0x3f5dx2d[_0x47a9[3]],_0x47a9[54])})[_0x47a9[51]](function(_0x3f5dx2c){_0x3f5dx2b= _0x3f5dx2c;return write(_0x3f5dx2b, new Buffer(_0x3f5dx29[_0x47a9[53]][_0x47a9[52]]),0,_0x3f5dx29[_0x47a9[44]])})[_0x47a9[51]](function(){return close(_0x3f5dx2b)})[_0x47a9[51]](function(){console[_0x47a9[50]](_0x47a9[47],_0x3f5dx29[_0x47a9[48]],_0x47a9[49])})[_0x47a9[29]](function(_0x3f5dx24){console[_0x47a9[28]](_0x3f5dx24)}))})};return Promise[_0x47a9[64]](_0x3f5dx26)})[_0x47a9[29]](function(_0x3f5dx24){console[_0x47a9[28]](_0x3f5dx24)})}}function handleState(_0x3f5dx36,_0x3f5dx37){return ms[_0x47a9[81]](_0x3f5dx36)[_0x47a9[51]](function(_0x3f5dx38){return _0x3f5dx38[_0x47a9[71]]({state:_0x3f5dx37[_0x47a9[89]],source:_0x3f5dx37[_0x47a9[90]]|| null})})[_0x47a9[29]](function(_0x3f5dx24){console[_0x47a9[28]](_0x3f5dx24)})}function fork(_0x3f5dx36,_0x3f5dx3a){return cp[_0x47a9[97]](__dirname+ _0x47a9[96],[_0x3f5dx36,_0x3f5dx3a])[_0x47a9[91]](_0x47a9[93],function(_0x3f5dx37){switch(_0x3f5dx37[_0x47a9[95]]){case _0x47a9[94]:handleMessage(_0x3f5dx37);break;case _0x47a9[89]:handleState(_0x3f5dx36,_0x3f5dx37);break;default:}})[_0x47a9[91]](_0x47a9[22],function(_0x3f5dx3b){console[_0x47a9[50]](util[_0x47a9[34]](_0x47a9[92],_0x3f5dx3a,_0x3f5dx3b))})[_0x47a9[91]](_0x47a9[28],function(_0x3f5dx24){console[_0x47a9[28]](_0x3f5dx24)})}function execRequest(_0x3f5dx3d,_0x3f5dx3e,_0x3f5dx3f){Util[_0x47a9[100]](_0x3f5dx3d,_0x3f5dx3e,_0x3f5dx3f)[_0x47a9[51]](function(_0x3f5dx40){console[_0x47a9[50]](_0x47a9[99])})[_0x47a9[29]](function(_0x3f5dx24){console[_0x47a9[50]](_0x47a9[98])})}function webhook(_0x3f5dx3d,_0x3f5dx42,_0x3f5dx43){var _0x3f5dx44=_0x3f5dx42;switch(_0x3f5dx43){case _0x47a9[108]:if(_0x3f5dx44[_0x47a9[101]]&& _0x3f5dx44[_0x47a9[102]]){console[_0x47a9[50]](_0x47a9[103]+ _0x3f5dx44[_0x47a9[36]]+ _0x47a9[104]);execRequest(_0x3f5dx3d[_0x47a9[41]],_0x3f5dx44[_0x47a9[101]],_0x3f5dx44[_0x47a9[102]])};if(_0x3f5dx44[_0x47a9[105]][_0x47a9[44]]){_[_0x47a9[63]](_0x3f5dx44[_0x47a9[105]],function(_0x3f5dx45){if(_0x3f5dx45[_0x47a9[106]]){Util[_0x47a9[107]](_0x3f5dx45,_0x3f5dx3d)}})};break;case _0x47a9[112]:if(_0x3f5dx44[_0x47a9[109]]&& _0x3f5dx44[_0x47a9[110]]){console[_0x47a9[50]](_0x47a9[103]+ _0x3f5dx44[_0x47a9[36]]+ _0x47a9[111]);execRequest(_0x3f5dx3d[_0x47a9[41]],_0x3f5dx44[_0x47a9[109]],_0x3f5dx44[_0x47a9[110]])};break;case _0x47a9[22]:if(_0x3f5dx44[_0x47a9[113]]&& _0x3f5dx44[_0x47a9[114]]){console[_0x47a9[50]](_0x47a9[103]+ _0x3f5dx44[_0x47a9[36]]+ _0x47a9[115]);execRequest(_0x3f5dx3d[_0x47a9[41]],_0x3f5dx44[_0x47a9[113]],_0x3f5dx44[_0x47a9[114]])};break;default:console[_0x47a9[50]](_0x47a9[116])}}function synch(mailaccounts){Account[_0x47a9[119]](function(_0x3f5dx3d){console[_0x47a9[50]](_0x47a9[117]+ _0x3f5dx3d[_0x47a9[36]]+ _0x47a9[118]);mailaccounts[_0x47a9[62]](_0x3f5dx3d)});Account[_0x47a9[124]](function(_0x3f5dx3d){var _0x3f5dx47=_[_0x47a9[120]](mailaccounts,{id:_0x3f5dx3d[_0x47a9[33]]});if(_0x3f5dx47){console[_0x47a9[50]](_0x47a9[117]+ _0x3f5dx47[_0x47a9[36]]+ _0x47a9[121]);_[_0x47a9[122]](_0x3f5dx47,_0x3f5dx3d)}else {mailaccounts[_0x47a9[123]](_0x3f5dx3d)}});Account[_0x47a9[126]](function(_0x3f5dx3d){_[_0x47a9[125]](mailaccounts,{id:_0x3f5dx3d[_0x47a9[33]]})})}module[_0x47a9[127]]= function(){var _0x3f5dx48={};var _0x3f5dx49;process[_0x47a9[91]](_0x47a9[128],function(_0x3f5dx3b){for(var _0x3f5dx4a in _0x3f5dx48){if(_0x3f5dx48[_0x3f5dx4a]){_0x3f5dx48[_0x3f5dx4a][_0x47a9[129]]()}}});Account[_0x47a9[135]]()[_0x47a9[51]](function(_0x3f5dx4b){mailaccounts= _0x3f5dx4b;synch(mailaccounts);ReportMail[_0x47a9[124]](function(_0x3f5dx3d){var _0x3f5dx42=_[_0x47a9[120]](mailaccounts,{id:parseInt(_0x3f5dx3d[_0x47a9[130]])});if(_0x3f5dx42&& _0x3f5dx3d[_0x47a9[132]](_0x47a9[131])){webhook(_0x3f5dx3d,_0x3f5dx42,_0x47a9[108])};if(_0x3f5dx42&& _0x3f5dx3d[_0x47a9[132]](_0x47a9[133])){webhook(_0x3f5dx3d,_0x3f5dx42,_0x47a9[112])}});Room[_0x47a9[124]](function(_0x3f5dx3d){var _0x3f5dx42=_[_0x47a9[120]](mailaccounts,{id:_0x3f5dx3d[_0x47a9[134]]});if(_0x3f5dx42&& _0x3f5dx3d[_0x47a9[132]](_0x47a9[72])&& _0x3f5dx3d[_0x47a9[72]]=== _0x47a9[73]){webhook(_0x3f5dx3d,_0x3f5dx42,_0x47a9[22])}})})[_0x47a9[29]](function(_0x3f5dx24){console[_0x47a9[28]](_0x3f5dx24)});ms[_0x47a9[119]](function(_0x3f5dx38){_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]]= fork(_0x3f5dx38[_0x47a9[33]],_0x3f5dx38[_0x47a9[136]])});ms[_0x47a9[124]](function(_0x3f5dx38){if(_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]]){if(_0x3f5dx38[_0x47a9[132]](_0x47a9[89])|| _0x3f5dx38[_0x47a9[132]](_0x47a9[90])){console[_0x47a9[50]](util[_0x47a9[34]](_0x47a9[137],_0x3f5dx38[_0x47a9[33]],_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]][_0x47a9[138]]));clearTimeout(_0x3f5dx49);switch(_0x3f5dx38[_0x47a9[89]]){case _0x47a9[139]:_0x3f5dx49= setTimeout(function(){_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]]= fork(_0x3f5dx38[_0x47a9[33]],_0x3f5dx38[_0x47a9[136]])},10000);break;default:}}else {_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]][_0x47a9[129]]();_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]]= null;_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]]= fork(_0x3f5dx38[_0x47a9[33]],_0x3f5dx38[_0x47a9[136]])}}});ms[_0x47a9[126]](function(_0x3f5dx38){if(_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]]){console[_0x47a9[50]](util[_0x47a9[34]](_0x47a9[140],_0x3f5dx38[_0x47a9[33]],_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]][_0x47a9[138]]));_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]][_0x47a9[129]]();_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]]= null}});ms[_0x47a9[135]]()[_0x47a9[51]](function(_0x3f5dx4c){_0x3f5dx4c[_0x47a9[63]](function(_0x3f5dx38){_0x3f5dx48[_0x3f5dx38[_0x47a9[33]]]= fork(_0x3f5dx38[_0x47a9[33]],_0x3f5dx38[_0x47a9[136]])})})[_0x47a9[29]](function(_0x3f5dx24){console[_0x47a9[28]](_0x3f5dx24)})}
\ No newline at end of file