Built motion from commit 02c0abe.|0.0.118
[motion.git] / server / config / imap / index.js
index d6608a2..fd36342 100644 (file)
@@ -1 +1 @@
-var _0x3a6e=["\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\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","\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","\x69\x6E\x52\x65\x70\x6C\x79\x54\x6F","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x2E\x2E\x2F\x72\x6F\x75\x74\x69\x6E\x67\x2F\x6D\x61\x69\x6C","\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","\x69\x64","\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","\x73\x75\x62\x6A\x65\x63\x74","\x66\x72\x6F\x6D","\x61\x64\x64\x72\x65\x73\x73","\x6D\x61\x70","\x74\x6F","\x63\x63","\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","\x3B","\x6E\x61\x6D\x65","\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","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65\x73","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\x66\x6F\x72\x6D\x61\x74","\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"];_0x3a6e[0];const _=require(_0x3a6e[1]);const util=require(_0x3a6e[2]);const path=require(_0x3a6e[3]);const cp=require(_0x3a6e[4]);const ms=require(_0x3a6e[6])[_0x3a6e[5]];const msg=require(_0x3a6e[6])[_0x3a6e[7]];const Room=require(_0x3a6e[6])[_0x3a6e[8]];const Message=require(_0x3a6e[6])[_0x3a6e[7]];const Account=require(_0x3a6e[6])[_0x3a6e[9]];const Contact=require(_0x3a6e[6])[_0x3a6e[10]];const Company=require(_0x3a6e[6])[_0x3a6e[11]];const Attachment=require(_0x3a6e[6])[_0x3a6e[12]];const Promise=require(_0x3a6e[13]);const moment=require(_0x3a6e[14]);const open=Promise[_0x3a6e[17]](require(_0x3a6e[16])[_0x3a6e[15]]);const close=Promise[_0x3a6e[17]](require(_0x3a6e[16])[_0x3a6e[18]]);const write=Promise[_0x3a6e[17]](require(_0x3a6e[16])[_0x3a6e[19]]);const config=require(_0x3a6e[20]);function handleMessage(msg){var _0x4fc4x14;var _0x4fc4x15;var _0x4fc4x16;var _0x4fc4x17;var _0x4fc4x18;var _0x4fc4x19,_0x4fc4x1a,_0x4fc4x1b,_0x4fc4x1c;if(msg[_0x3a6e[21]]){return Message[_0x3a6e[69]]({where:{messageId:msg[_0x3a6e[21]][0]}})[_0x3a6e[33]](function(_0x4fc4x27){if(_0x4fc4x27){return _0x4fc4x27[_0x3a6e[72]]()[_0x3a6e[33]](function(_0x4fc4x26){if(_0x4fc4x26[_0x3a6e[60]]!== _0x3a6e[61]){return _0x4fc4x26}else {return Account[_0x3a6e[71]](msg[_0x3a6e[70]])[_0x3a6e[33]](function(_0x4fc4x29){_0x4fc4x16= _0x4fc4x29;if(_0x4fc4x16[_0x3a6e[65]]){return Company[_0x3a6e[69]]({where:{emailDomain:msg[_0x3a6e[51]][0][_0x3a6e[52]][_0x3a6e[67]](_0x3a6e[66])[1]}})[_0x3a6e[33]](function(_0x4fc4x2a){return Contact[_0x3a6e[68]]({where:{email:msg[_0x3a6e[51]][0][_0x3a6e[52]]},defaults:{email:msg[_0x3a6e[51]][0][_0x3a6e[52]],firstName:msg[_0x3a6e[51]][0][_0x3a6e[63]]|| msg[_0x3a6e[51]][0][_0x3a6e[52]][_0x3a6e[67]](_0x3a6e[66])[0],ListId:_0x4fc4x16[_0x3a6e[65]],CompanyId:_0x4fc4x2a?_0x4fc4x2a[_0x3a6e[43]]:null}})})}else {return []}})[_0x3a6e[64]](function(_0x4fc4x28){_0x4fc4x17= _0x4fc4x28;return Room[_0x3a6e[44]]({subject:msg[_0x3a6e[50]],from:_[_0x3a6e[53]](msg[_0x3a6e[51]],_0x3a6e[52])[_0x3a6e[41]](_0x3a6e[62]),account:_0x4fc4x16[_0x3a6e[63]],attachment:msg[_0x3a6e[25]]&& msg[_0x3a6e[25]][_0x3a6e[26]],MailAccountId:_0x4fc4x16[_0x3a6e[43]],ParentId:_0x4fc4x26[_0x3a6e[43]]})})}})}else {return Account[_0x3a6e[71]](msg[_0x3a6e[70]])[_0x3a6e[33]](function(_0x4fc4x29){_0x4fc4x16= _0x4fc4x29;if(_0x4fc4x16[_0x3a6e[65]]){return Company[_0x3a6e[69]]({where:{emailDomain:msg[_0x3a6e[51]][0][_0x3a6e[52]][_0x3a6e[67]](_0x3a6e[66])[1]}})[_0x3a6e[33]](function(_0x4fc4x2a){return Contact[_0x3a6e[68]]({where:{email:msg[_0x3a6e[51]][0][_0x3a6e[52]]},defaults:{email:msg[_0x3a6e[51]][0][_0x3a6e[52]],firstName:msg[_0x3a6e[51]][0][_0x3a6e[63]]|| msg[_0x3a6e[51]][0][_0x3a6e[52]][_0x3a6e[67]](_0x3a6e[66])[0],ListId:_0x4fc4x16[_0x3a6e[65]],CompanyId:_0x4fc4x2a?_0x4fc4x2a[_0x3a6e[43]]:null}})})}else {return []}})[_0x3a6e[64]](function(_0x4fc4x28){_0x4fc4x17= _0x4fc4x28;return Room[_0x3a6e[44]]({subject:msg[_0x3a6e[50]],from:_[_0x3a6e[53]](msg[_0x3a6e[51]],_0x3a6e[52])[_0x3a6e[41]](_0x3a6e[62]),account:_0x4fc4x16[_0x3a6e[63]],attachment:msg[_0x3a6e[25]]&& msg[_0x3a6e[25]][_0x3a6e[26]],MailAccountId:_0x4fc4x16[_0x3a6e[43]]})})}})[_0x3a6e[33]](function(_0x4fc4x26){_0x4fc4x14= _0x4fc4x26;return _0x4fc4x14[_0x3a6e[59]]({lastEvent:_0x3a6e[49],mailIn:++_0x4fc4x14[_0x3a6e[58]]})})[_0x3a6e[33]](function(_0x4fc4x26){return Message[_0x3a6e[44]]({fromId:_0x4fc4x17?_0x4fc4x17[_0x3a6e[43]]:null,messageId:msg[_0x3a6e[48]],status:_0x3a6e[49],subject:msg[_0x3a6e[50]],from:_[_0x3a6e[53]](msg[_0x3a6e[51]],_0x3a6e[52]),to:msg[_0x3a6e[54]]?_[_0x3a6e[53]](msg[_0x3a6e[54]],_0x3a6e[52]):[],cc:msg[_0x3a6e[55]]?_[_0x3a6e[53]](msg[_0x3a6e[55]],_0x3a6e[52]):[],bcc:msg[_0x3a6e[56]]?_[_0x3a6e[53]](msg[_0x3a6e[56]],_0x3a6e[52]):[],text:msg[_0x3a6e[57]]|| null,MailRoomId:_0x4fc4x14[_0x3a6e[43]]})})[_0x3a6e[33]](function(_0x4fc4x1e){require(_0x3a6e[24])(_0x4fc4x1e);var _0x4fc4x1f=[];var _0x4fc4x20=_0x4fc4x1e;if(msg[_0x3a6e[25]]&& msg[_0x3a6e[25]][_0x3a6e[26]]){msg[_0x3a6e[25]][_0x3a6e[46]](function(_0x4fc4x21){var _0x4fc4x22=_0x3a6e[27]+ Math[_0x3a6e[28]](32);var _0x4fc4x23;_0x4fc4x1f[_0x3a6e[45]](Attachment[_0x3a6e[44]]({name:_0x4fc4x21[_0x3a6e[30]],basename:_0x4fc4x22,path:path[_0x3a6e[41]](config[_0x3a6e[37]],_0x3a6e[38],_0x3a6e[39],_0x3a6e[25],_0x3a6e[40],_0x4fc4x22),type:_0x4fc4x21[_0x3a6e[42]],size:_0x4fc4x21[_0x3a6e[26]],MailMessageId:_0x4fc4x20[_0x3a6e[43]]})[_0x3a6e[33]](function(_0x4fc4x25){return open(_0x4fc4x25[_0x3a6e[3]],_0x3a6e[36])})[_0x3a6e[33]](function(_0x4fc4x24){_0x4fc4x23= _0x4fc4x24;return write(_0x4fc4x23, new Buffer(_0x4fc4x21[_0x3a6e[35]][_0x3a6e[34]]),0,_0x4fc4x21[_0x3a6e[26]])})[_0x3a6e[33]](function(){return close(_0x4fc4x23)})[_0x3a6e[33]](function(){console[_0x3a6e[32]](_0x3a6e[29],_0x4fc4x21[_0x3a6e[30]],_0x3a6e[31])})[_0x3a6e[23]](function(_0x4fc4x1d){console[_0x3a6e[22]](_0x4fc4x1d)}))})};return Promise[_0x3a6e[47]](_0x4fc4x1f)})[_0x3a6e[23]](function(_0x4fc4x1d){console[_0x3a6e[22]](_0x4fc4x1d)})}else {return Account[_0x3a6e[71]](msg[_0x3a6e[70]])[_0x3a6e[33]](function(_0x4fc4x29){_0x4fc4x16= _0x4fc4x29;if(_0x4fc4x16[_0x3a6e[65]]){return Company[_0x3a6e[69]]({where:{emailDomain:msg[_0x3a6e[51]][0][_0x3a6e[52]][_0x3a6e[67]](_0x3a6e[66])[1]}})[_0x3a6e[33]](function(_0x4fc4x2a){return Contact[_0x3a6e[68]]({where:{email:msg[_0x3a6e[51]][0][_0x3a6e[52]]},defaults:{email:msg[_0x3a6e[51]][0][_0x3a6e[52]],firstName:msg[_0x3a6e[51]][0][_0x3a6e[63]]|| msg[_0x3a6e[51]][0][_0x3a6e[52]][_0x3a6e[67]](_0x3a6e[66])[0],ListId:_0x4fc4x16[_0x3a6e[65]],CompanyId:_0x4fc4x2a?_0x4fc4x2a[_0x3a6e[43]]:null}})})}else {return []}})[_0x3a6e[64]](function(_0x4fc4x28){_0x4fc4x17= _0x4fc4x28;return Room[_0x3a6e[44]]({mailIn:1,account:_0x4fc4x16[_0x3a6e[63]],subject:msg[_0x3a6e[50]],from:_[_0x3a6e[53]](msg[_0x3a6e[51]],_0x3a6e[52])[_0x3a6e[41]](_0x3a6e[62]),lastEvent:_0x3a6e[49],lastEventAt:moment()[_0x3a6e[75]](_0x3a6e[74]),attachment:msg[_0x3a6e[25]]&& msg[_0x3a6e[25]][_0x3a6e[26]],MailMessages:[{messageId:msg[_0x3a6e[48]],subject:msg[_0x3a6e[50]],from:_[_0x3a6e[53]](msg[_0x3a6e[51]],_0x3a6e[52]),fromId:_0x4fc4x17?_0x4fc4x17[_0x3a6e[43]]:null,to:msg[_0x3a6e[54]]?_[_0x3a6e[53]](msg[_0x3a6e[54]],_0x3a6e[52]):[],cc:msg[_0x3a6e[55]]?_[_0x3a6e[53]](msg[_0x3a6e[55]],_0x3a6e[52]):[],bcc:msg[_0x3a6e[56]]?_[_0x3a6e[53]](msg[_0x3a6e[56]],_0x3a6e[52]):[],status:_0x3a6e[49],text:msg[_0x3a6e[57]]|| null}],MailAccountId:msg[_0x3a6e[70]]},{include:[{model:Message}]})})[_0x3a6e[33]](function(_0x4fc4x2b){var _0x4fc4x1f=[];var _0x4fc4x2c=_0x4fc4x2b;require(_0x3a6e[24])(_0x4fc4x2c[_0x3a6e[73]][0]);if(msg[_0x3a6e[25]]&& msg[_0x3a6e[25]][_0x3a6e[26]]){msg[_0x3a6e[25]][_0x3a6e[46]](function(_0x4fc4x21){var _0x4fc4x22=_0x3a6e[27]+ Math[_0x3a6e[28]](32);var _0x4fc4x23;_0x4fc4x1f[_0x3a6e[45]](Attachment[_0x3a6e[44]]({name:_0x4fc4x21[_0x3a6e[30]],basename:_0x4fc4x22,path:path[_0x3a6e[41]](config[_0x3a6e[37]],_0x3a6e[38],_0x3a6e[39],_0x3a6e[25],_0x3a6e[40],_0x4fc4x22),type:_0x4fc4x21[_0x3a6e[42]],size:_0x4fc4x21[_0x3a6e[26]],MailMessageId:_0x4fc4x2c[_0x3a6e[73]][0][_0x3a6e[43]]})[_0x3a6e[33]](function(_0x4fc4x25){return open(_0x4fc4x25[_0x3a6e[3]],_0x3a6e[36])})[_0x3a6e[33]](function(_0x4fc4x24){_0x4fc4x23= _0x4fc4x24;return write(_0x4fc4x23, new Buffer(_0x4fc4x21[_0x3a6e[35]][_0x3a6e[34]]),0,_0x4fc4x21[_0x3a6e[26]])})[_0x3a6e[33]](function(){return close(_0x4fc4x23)})[_0x3a6e[33]](function(){console[_0x3a6e[32]](_0x3a6e[29],_0x4fc4x21[_0x3a6e[30]],_0x3a6e[31])})[_0x3a6e[23]](function(_0x4fc4x1d){console[_0x3a6e[22]](_0x4fc4x1d)}))})};return Promise[_0x3a6e[47]](_0x4fc4x1f)})[_0x3a6e[23]](function(_0x4fc4x1d){console[_0x3a6e[22]](_0x4fc4x1d)})}}function handleState(_0x4fc4x2e,_0x4fc4x2f){return ms[_0x3a6e[71]](_0x4fc4x2e)[_0x3a6e[33]](function(_0x4fc4x30){return _0x4fc4x30[_0x3a6e[59]]({state:_0x4fc4x2f[_0x3a6e[76]],source:_0x4fc4x2f[_0x3a6e[77]]|| null})})[_0x3a6e[23]](function(_0x4fc4x1d){console[_0x3a6e[22]](_0x4fc4x1d)})}function fork(_0x4fc4x2e,_0x4fc4x32){return cp[_0x3a6e[84]](__dirname+ _0x3a6e[83],[_0x4fc4x2e,_0x4fc4x32])[_0x3a6e[78]](_0x3a6e[80],function(_0x4fc4x2f){switch(_0x4fc4x2f[_0x3a6e[82]]){case _0x3a6e[81]:handleMessage(_0x4fc4x2f);break;case _0x3a6e[76]:handleState(_0x4fc4x2e,_0x4fc4x2f);break;default:}})[_0x3a6e[78]](_0x3a6e[18],function(_0x4fc4x33){console[_0x3a6e[32]](util[_0x3a6e[75]](_0x3a6e[79],_0x4fc4x32,_0x4fc4x33))})[_0x3a6e[78]](_0x3a6e[22],function(_0x4fc4x1d){console[_0x3a6e[22]](_0x4fc4x1d)})}module[_0x3a6e[85]]= function(){var _0x4fc4x34={};var _0x4fc4x35;process[_0x3a6e[78]](_0x3a6e[86],function(_0x4fc4x33){for(var _0x4fc4x36 in _0x4fc4x34){if(_0x4fc4x34[_0x4fc4x36]){_0x4fc4x34[_0x4fc4x36][_0x3a6e[87]]()}}});ms[_0x3a6e[89]](function(_0x4fc4x30){_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]]= fork(_0x4fc4x30[_0x3a6e[43]],_0x4fc4x30[_0x3a6e[88]])});ms[_0x3a6e[94]](function(_0x4fc4x30){if(_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]]){if(_0x4fc4x30[_0x3a6e[90]](_0x3a6e[76])|| _0x4fc4x30[_0x3a6e[90]](_0x3a6e[77])){console[_0x3a6e[32]](util[_0x3a6e[75]](_0x3a6e[91],_0x4fc4x30[_0x3a6e[43]],_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]][_0x3a6e[92]]));clearTimeout(_0x4fc4x35);switch(_0x4fc4x30[_0x3a6e[76]]){case _0x3a6e[93]:_0x4fc4x35= setTimeout(function(){_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]]= fork(_0x4fc4x30[_0x3a6e[43]],_0x4fc4x30[_0x3a6e[88]])},10000);break;default:}}else {_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]][_0x3a6e[87]]();_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]]= null;_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]]= fork(_0x4fc4x30[_0x3a6e[43]],_0x4fc4x30[_0x3a6e[88]])}}});ms[_0x3a6e[96]](function(_0x4fc4x30){if(_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]]){console[_0x3a6e[32]](util[_0x3a6e[75]](_0x3a6e[95],_0x4fc4x30[_0x3a6e[43]],_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]][_0x3a6e[92]]));_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]][_0x3a6e[87]]();_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]]= null}});ms[_0x3a6e[97]]()[_0x3a6e[33]](function(_0x4fc4x37){_0x4fc4x37[_0x3a6e[46]](function(_0x4fc4x30){_0x4fc4x34[_0x4fc4x30[_0x3a6e[43]]]= fork(_0x4fc4x30[_0x3a6e[43]],_0x4fc4x30[_0x3a6e[88]])})})[_0x3a6e[23]](function(_0x4fc4x1d){console[_0x3a6e[22]](_0x4fc4x1d)})}
\ No newline at end of file
+var _0xe909=["\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","\x72\x65\x63\x65\x69\x76\x65\x64","\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","\x63\x6C\x6F\x73\x65\x64","\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","\x3B","\x4E\x45\x57","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65\x73","\x52\x45\x43\x45\x49\x56\x45\x44","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\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"];_0xe909[0];const _=require(_0xe909[1]);const util=require(_0xe909[2]);const path=require(_0xe909[3]);const cp=require(_0xe909[4]);const ms=require(_0xe909[6])[_0xe909[5]];const msg=require(_0xe909[6])[_0xe909[7]];const Room=require(_0xe909[6])[_0xe909[8]];const Status=require(_0xe909[6])[_0xe909[9]];const Message=require(_0xe909[6])[_0xe909[7]];const Account=require(_0xe909[6])[_0xe909[10]];const Contact=require(_0xe909[6])[_0xe909[11]];const Company=require(_0xe909[6])[_0xe909[12]];const Attachment=require(_0xe909[6])[_0xe909[13]];const ReportMail=require(_0xe909[6])[_0xe909[14]];const ReportMailRoom=require(_0xe909[6])[_0xe909[15]];const ReportMailSession=require(_0xe909[6])[_0xe909[16]];const Promise=require(_0xe909[17]);const moment=require(_0xe909[18]);const open=Promise[_0xe909[21]](require(_0xe909[20])[_0xe909[19]]);const close=Promise[_0xe909[21]](require(_0xe909[20])[_0xe909[22]]);const write=Promise[_0xe909[21]](require(_0xe909[20])[_0xe909[23]]);const config=require(_0xe909[24]);var Scheduler=require(_0xe909[25]);function handleMessage(msg){var _0x9365x19;var _0x9365x1a;var _0x9365x1b;var _0x9365x1c;var _0x9365x1d;var _0x9365x1e,_0x9365x1f,_0x9365x20,_0x9365x21;if(msg[_0xe909[26]]){return Message[_0xe909[77]]({where:{messageId:msg[_0xe909[26]][0]}})[_0xe909[49]](function(_0x9365x2d){if(_0x9365x2d){return _0x9365x2d[_0xe909[83]]()[_0xe909[49]](function(_0x9365x2c){_0x9365x19= _0x9365x2c;if(_0x9365x2c[_0xe909[70]]!== _0xe909[71]){return _0x9365x19[_0xe909[69]]({status:_0xe909[80]},{individualHooks:true})[_0xe909[49]](function(){return Status[_0xe909[59]]({status:_0xe909[80],MailRoomId:_0x9365x19[_0xe909[32]]})})[_0xe909[49]](function(){return Account[_0xe909[79]](msg[_0xe909[78]])[_0xe909[49]](function(_0x9365x2f){_0x9365x1b= _0x9365x2f;if(_0x9365x1b[_0xe909[73]]){return Company[_0xe909[77]]({where:{emailDomain:msg[_0xe909[37]][0][_0xe909[36]][_0xe909[75]](_0xe909[74])[1]}})[_0xe909[49]](function(_0x9365x30){return Contact[_0xe909[76]]({where:{email:msg[_0xe909[37]][0][_0xe909[36]]},defaults:{email:msg[_0xe909[37]][0][_0xe909[36]],firstName:msg[_0xe909[37]][0][_0xe909[35]]|| msg[_0xe909[37]][0][_0xe909[36]][_0xe909[75]](_0xe909[74])[0],ListId:_0x9365x1b[_0xe909[73]],CompanyId:_0x9365x30?_0x9365x30[_0xe909[32]]:null}})})}else {return []}})[_0xe909[72]](function(_0x9365x2e){_0x9365x1c= _0x9365x2e})})}else {return Account[_0xe909[79]](msg[_0xe909[78]])[_0xe909[49]](function(_0x9365x2f){_0x9365x1b= _0x9365x2f;if(_0x9365x1b[_0xe909[73]]){return Company[_0xe909[77]]({where:{emailDomain:msg[_0xe909[37]][0][_0xe909[36]][_0xe909[75]](_0xe909[74])[1]}})[_0xe909[49]](function(_0x9365x30){return Contact[_0xe909[76]]({where:{email:msg[_0xe909[37]][0][_0xe909[36]]},defaults:{email:msg[_0xe909[37]][0][_0xe909[36]],firstName:msg[_0xe909[37]][0][_0xe909[35]]|| msg[_0xe909[37]][0][_0xe909[36]][_0xe909[75]](_0xe909[74])[0],ListId:_0x9365x1b[_0xe909[73]],CompanyId:_0x9365x30?_0x9365x30[_0xe909[32]]:null}})})}else {return []}})[_0xe909[72]](function(_0x9365x2e){_0x9365x1c= _0x9365x2e;return Room[_0xe909[59]]({subject:msg[_0xe909[34]],from:_[_0xe909[39]](msg[_0xe909[37]],_0xe909[36])[_0xe909[57]](_0xe909[81]),account:_0x9365x1b[_0xe909[35]],attachment:msg[_0xe909[41]]&& msg[_0xe909[41]][_0xe909[42]],MailAccountId:_0x9365x1b[_0xe909[32]],ParentId:_0x9365x2c[_0xe909[32]],MailRoomStatuses:[{status:_0xe909[82]}]},{include:[{model:Status}]})})}})}else {return Account[_0xe909[79]](msg[_0xe909[78]])[_0xe909[49]](function(_0x9365x2f){_0x9365x1b= _0x9365x2f;if(_0x9365x1b[_0xe909[73]]){return Company[_0xe909[77]]({where:{emailDomain:msg[_0xe909[37]][0][_0xe909[36]][_0xe909[75]](_0xe909[74])[1]}})[_0xe909[49]](function(_0x9365x30){return Contact[_0xe909[76]]({where:{email:msg[_0xe909[37]][0][_0xe909[36]]},defaults:{email:msg[_0xe909[37]][0][_0xe909[36]],firstName:msg[_0xe909[37]][0][_0xe909[35]]|| msg[_0xe909[37]][0][_0xe909[36]][_0xe909[75]](_0xe909[74])[0],ListId:_0x9365x1b[_0xe909[73]],CompanyId:_0x9365x30?_0x9365x30[_0xe909[32]]:null}})})}else {return []}})[_0xe909[72]](function(_0x9365x2e){_0x9365x1c= _0x9365x2e;return Room[_0xe909[59]]({subject:msg[_0xe909[34]],from:_[_0xe909[39]](msg[_0xe909[37]],_0xe909[36])[_0xe909[57]](_0xe909[81]),account:_0x9365x1b[_0xe909[35]],attachment:msg[_0xe909[41]]&& msg[_0xe909[41]][_0xe909[42]],MailAccountId:_0x9365x1b[_0xe909[32]]})})[_0xe909[49]](function(_0x9365x2c){_0x9365x19= _0x9365x2c})}})[_0xe909[49]](function(){return _0x9365x19[_0xe909[69]]({lastEvent:_0xe909[64],mailIn:++_0x9365x19[_0xe909[68]]})})[_0xe909[49]](function(_0x9365x2c){return Message[_0xe909[59]]({fromId:_0x9365x1c?_0x9365x1c[_0xe909[32]]:null,messageId:msg[_0xe909[63]],status:_0xe909[64],subject:msg[_0xe909[34]],from:_[_0xe909[39]](msg[_0xe909[37]],_0xe909[36]),to:msg[_0xe909[65]]?_[_0xe909[39]](msg[_0xe909[65]],_0xe909[36]):[],cc:msg[_0xe909[38]]?_[_0xe909[39]](msg[_0xe909[38]],_0xe909[36]):[],bcc:msg[_0xe909[66]]?_[_0xe909[39]](msg[_0xe909[66]],_0xe909[36]):[],text:msg[_0xe909[67]]|| null,MailRoomId:_0x9365x19[_0xe909[32]]})})[_0xe909[49]](function(_0x9365x23){var _0x9365x24=[];var _0x9365x25=_0x9365x23;var _0x9365x26= new Scheduler({channel:_0xe909[29],uniqueid:util[_0xe909[33]](_0xe909[30],moment()[_0xe909[31]](),_0x9365x19[_0xe909[32]]),subject:msg[_0xe909[34]],messageid:_0x9365x25[_0xe909[32]],roomid:_0x9365x19[_0xe909[32]],accountid:_0x9365x1b[_0xe909[32]],accountname:_0x9365x1b[_0xe909[35]],accountaddress:_0x9365x1b[_0xe909[36]],from:msg[_0xe909[37]][0][_0xe909[36]],cc:msg[_0xe909[38]]?_[_0xe909[39]](msg[_0xe909[38]],_0xe909[36]):[]});_0x9365x26[_0xe909[40]]();if(msg[_0xe909[41]]&& msg[_0xe909[41]][_0xe909[42]]){msg[_0xe909[41]][_0xe909[61]](function(_0x9365x27){var _0x9365x28=_0xe909[43]+ Math[_0xe909[44]](32);var _0x9365x29;_0x9365x24[_0xe909[60]](Attachment[_0xe909[59]]({name:_0x9365x27[_0xe909[46]],basename:_0x9365x28,path:path[_0xe909[57]](config[_0xe909[53]],_0xe909[54],_0xe909[55],_0xe909[41],_0xe909[56],_0x9365x28),type:_0x9365x27[_0xe909[58]],size:_0x9365x27[_0xe909[42]],MailMessageId:_0x9365x25[_0xe909[32]]})[_0xe909[49]](function(_0x9365x2b){return open(_0x9365x2b[_0xe909[3]],_0xe909[52])})[_0xe909[49]](function(_0x9365x2a){_0x9365x29= _0x9365x2a;return write(_0x9365x29, new Buffer(_0x9365x27[_0xe909[51]][_0xe909[50]]),0,_0x9365x27[_0xe909[42]])})[_0xe909[49]](function(){return close(_0x9365x29)})[_0xe909[49]](function(){console[_0xe909[48]](_0xe909[45],_0x9365x27[_0xe909[46]],_0xe909[47])})[_0xe909[28]](function(_0x9365x22){console[_0xe909[27]](_0x9365x22)}))})};return Promise[_0xe909[62]](_0x9365x24)})[_0xe909[28]](function(_0x9365x22){console[_0xe909[27]](_0x9365x22)})}else {return Account[_0xe909[79]](msg[_0xe909[78]])[_0xe909[49]](function(_0x9365x2f){_0x9365x1b= _0x9365x2f;if(_0x9365x1b[_0xe909[73]]){return Company[_0xe909[77]]({where:{emailDomain:msg[_0xe909[37]][0][_0xe909[36]][_0xe909[75]](_0xe909[74])[1]}})[_0xe909[49]](function(_0x9365x30){return Contact[_0xe909[76]]({where:{email:msg[_0xe909[37]][0][_0xe909[36]]},defaults:{email:msg[_0xe909[37]][0][_0xe909[36]],firstName:msg[_0xe909[37]][0][_0xe909[35]]|| msg[_0xe909[37]][0][_0xe909[36]][_0xe909[75]](_0xe909[74])[0],ListId:_0x9365x1b[_0xe909[73]],CompanyId:_0x9365x30?_0x9365x30[_0xe909[32]]:null}})})}else {return []}})[_0xe909[72]](function(_0x9365x2e){_0x9365x1c= _0x9365x2e;return Room[_0xe909[59]]({mailIn:1,account:_0x9365x1b[_0xe909[35]],subject:msg[_0xe909[34]],from:_[_0xe909[39]](msg[_0xe909[37]],_0xe909[36])[_0xe909[57]](_0xe909[81]),status:_0xe909[82],lastEvent:_0xe909[85],lastEventAt:moment()[_0xe909[33]](_0xe909[86]),arrivedAt:moment()[_0xe909[33]](_0xe909[86]),attachment:msg[_0xe909[41]]&& msg[_0xe909[41]][_0xe909[42]],MailMessages:[{messageId:msg[_0xe909[63]],subject:msg[_0xe909[34]],from:_[_0xe909[39]](msg[_0xe909[37]],_0xe909[36]),fromId:_0x9365x1c?_0x9365x1c[_0xe909[32]]:null,to:msg[_0xe909[65]]?_[_0xe909[39]](msg[_0xe909[65]],_0xe909[36]):[],cc:msg[_0xe909[38]]?_[_0xe909[39]](msg[_0xe909[38]],_0xe909[36]):[],bcc:msg[_0xe909[66]]?_[_0xe909[39]](msg[_0xe909[66]],_0xe909[36]):[],status:_0xe909[85],text:msg[_0xe909[67]]|| null}],MailRoomStatuses:[{status:_0xe909[82]}],MailAccountId:msg[_0xe909[78]]},{include:[{model:Message},{model:Status}]})})[_0xe909[49]](function(_0x9365x31){var _0x9365x24=[];var _0x9365x32=_0x9365x31;var _0x9365x26= new Scheduler({channel:_0xe909[29],uniqueid:util[_0xe909[33]](_0xe909[30],moment()[_0xe909[31]](),_0x9365x32[_0xe909[32]]),subject:msg[_0xe909[34]],messageid:_0x9365x32[_0xe909[84]][0][_0xe909[32]],roomid:_0x9365x32[_0xe909[32]],accountid:_0x9365x1b[_0xe909[32]],accountname:_0x9365x1b[_0xe909[35]],accountaddress:_0x9365x1b[_0xe909[36]],from:msg[_0xe909[37]][0][_0xe909[36]],cc:msg[_0xe909[38]]?_[_0xe909[39]](msg[_0xe909[38]],_0xe909[36]):[]});_0x9365x26[_0xe909[40]]();if(msg[_0xe909[41]]&& msg[_0xe909[41]][_0xe909[42]]){msg[_0xe909[41]][_0xe909[61]](function(_0x9365x27){var _0x9365x28=_0xe909[43]+ Math[_0xe909[44]](32);var _0x9365x29;_0x9365x24[_0xe909[60]](Attachment[_0xe909[59]]({name:_0x9365x27[_0xe909[46]],basename:_0x9365x28,path:path[_0xe909[57]](config[_0xe909[53]],_0xe909[54],_0xe909[55],_0xe909[41],_0xe909[56],_0x9365x28),type:_0x9365x27[_0xe909[58]],size:_0x9365x27[_0xe909[42]],MailMessageId:_0x9365x32[_0xe909[84]][0][_0xe909[32]]})[_0xe909[49]](function(_0x9365x2b){return open(_0x9365x2b[_0xe909[3]],_0xe909[52])})[_0xe909[49]](function(_0x9365x2a){_0x9365x29= _0x9365x2a;return write(_0x9365x29, new Buffer(_0x9365x27[_0xe909[51]][_0xe909[50]]),0,_0x9365x27[_0xe909[42]])})[_0xe909[49]](function(){return close(_0x9365x29)})[_0xe909[49]](function(){console[_0xe909[48]](_0xe909[45],_0x9365x27[_0xe909[46]],_0xe909[47])})[_0xe909[28]](function(_0x9365x22){console[_0xe909[27]](_0x9365x22)}))})};return Promise[_0xe909[62]](_0x9365x24)})[_0xe909[28]](function(_0x9365x22){console[_0xe909[27]](_0x9365x22)})}}function handleState(_0x9365x34,_0x9365x35){return ms[_0xe909[79]](_0x9365x34)[_0xe909[49]](function(_0x9365x36){return _0x9365x36[_0xe909[69]]({state:_0x9365x35[_0xe909[87]],source:_0x9365x35[_0xe909[88]]|| null})})[_0xe909[28]](function(_0x9365x22){console[_0xe909[27]](_0x9365x22)})}function fork(_0x9365x34,_0x9365x38){return cp[_0xe909[95]](__dirname+ _0xe909[94],[_0x9365x34,_0x9365x38])[_0xe909[89]](_0xe909[91],function(_0x9365x35){switch(_0x9365x35[_0xe909[93]]){case _0xe909[92]:handleMessage(_0x9365x35);break;case _0xe909[87]:handleState(_0x9365x34,_0x9365x35);break;default:}})[_0xe909[89]](_0xe909[22],function(_0x9365x39){console[_0xe909[48]](util[_0xe909[33]](_0xe909[90],_0x9365x38,_0x9365x39))})[_0xe909[89]](_0xe909[27],function(_0x9365x22){console[_0xe909[27]](_0x9365x22)})}module[_0xe909[96]]= function(){var _0x9365x3a={};var _0x9365x3b;process[_0xe909[89]](_0xe909[97],function(_0x9365x39){for(var _0x9365x3c in _0x9365x3a){if(_0x9365x3a[_0x9365x3c]){_0x9365x3a[_0x9365x3c][_0xe909[98]]()}}});ms[_0xe909[100]](function(_0x9365x36){_0x9365x3a[_0x9365x36[_0xe909[32]]]= fork(_0x9365x36[_0xe909[32]],_0x9365x36[_0xe909[99]])});ms[_0xe909[105]](function(_0x9365x36){if(_0x9365x3a[_0x9365x36[_0xe909[32]]]){if(_0x9365x36[_0xe909[101]](_0xe909[87])|| _0x9365x36[_0xe909[101]](_0xe909[88])){console[_0xe909[48]](util[_0xe909[33]](_0xe909[102],_0x9365x36[_0xe909[32]],_0x9365x3a[_0x9365x36[_0xe909[32]]][_0xe909[103]]));clearTimeout(_0x9365x3b);switch(_0x9365x36[_0xe909[87]]){case _0xe909[104]:_0x9365x3b= setTimeout(function(){_0x9365x3a[_0x9365x36[_0xe909[32]]]= fork(_0x9365x36[_0xe909[32]],_0x9365x36[_0xe909[99]])},10000);break;default:}}else {_0x9365x3a[_0x9365x36[_0xe909[32]]][_0xe909[98]]();_0x9365x3a[_0x9365x36[_0xe909[32]]]= null;_0x9365x3a[_0x9365x36[_0xe909[32]]]= fork(_0x9365x36[_0xe909[32]],_0x9365x36[_0xe909[99]])}}});ms[_0xe909[107]](function(_0x9365x36){if(_0x9365x3a[_0x9365x36[_0xe909[32]]]){console[_0xe909[48]](util[_0xe909[33]](_0xe909[106],_0x9365x36[_0xe909[32]],_0x9365x3a[_0x9365x36[_0xe909[32]]][_0xe909[103]]));_0x9365x3a[_0x9365x36[_0xe909[32]]][_0xe909[98]]();_0x9365x3a[_0x9365x36[_0xe909[32]]]= null}});ms[_0xe909[108]]()[_0xe909[49]](function(_0x9365x3d){_0x9365x3d[_0xe909[61]](function(_0x9365x36){_0x9365x3a[_0x9365x36[_0xe909[32]]]= fork(_0x9365x36[_0xe909[32]],_0x9365x36[_0xe909[99]])})})[_0xe909[28]](function(_0x9365x22){console[_0xe909[27]](_0x9365x22)})}
\ No newline at end of file