Built motion from commit b18b7a808.|1.0.23
[motion.git] / server / config / imap / index.js
index 2039392..1acc3c2 100644 (file)
@@ -1 +1 @@
-var _0x7f92=["\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","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x53\x6D\x73\x4D\x65\x73\x73\x61\x67\x65","\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\x6F\x6F\x6D","\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\x75\x74\x69\x6C","\x67\x65\x74","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x64","\x63\x68\x61\x6E\x67\x65\x64","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6D\x65\x73\x73\x61\x67\x65\x69\x64","\x6D\x61\x69\x6C","\x66\x69\x6E\x64","\x73\x74\x6F\x70","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x73\x65\x6E\x64","\x70\x72\x6F\x63\x65\x73\x73","\x74\x68\x65\x6E","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x75\x6E\x69\x71\x75\x65\x69\x64","\x75\x70\x64\x61\x74\x65","\x72\x65\x6A\x65\x63\x74\x65\x64\x41\x74","\x72\x65\x6A\x65\x63\x74","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x69\x6E\x52\x65\x70\x6C\x79\x54\x6F","\x6D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65\x41\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\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","\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","\x68\x74\x6D\x6C","\x6E\x61\x6D\x65","\x6D\x61\x69\x6C\x49\x6E","\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","\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","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\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","\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","\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","\x70\x69\x64","\x6B\x69\x6C\x6C","\x72\x65\x6D\x6F\x76\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x4D\x61\x69\x6C\x20\x61\x63\x63\x6F\x75\x6E\x74\x3A\x20","\x20\x55\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x75\x6E\x73\x68\x69\x66\x74","\x65\x78\x69\x74","\x72\x6F\x6F\x6D\x69\x64","\x63\x72\x65\x61\x74\x65\x4D\x61\x69\x6C","\x63\x72\x65\x61\x74\x65\x53\x6D\x73","\x2F\x73\x65\x72\x76\x65\x72\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x66\x6F\x72\x6B\x65\x64\x5F\x72\x6F\x75\x74\x69\x6E\x67\x2F\x6D\x61\x69\x6C\x2F\x69\x6E\x64\x65\x78\x2E\x6A\x73","\x73\x74\x61\x72\x74","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x65\x78\x70\x6F\x72\x74\x73","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x66\x69\x6E\x64\x41\x6C\x6C","\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"];_0x7f92[0];const _=require(_0x7f92[1]);const util=require(_0x7f92[2]);const path=require(_0x7f92[3]);const cp=require(_0x7f92[4]);const ms=require(_0x7f92[6])[_0x7f92[5]];const msg=require(_0x7f92[6])[_0x7f92[7]];const Room=require(_0x7f92[6])[_0x7f92[8]];const Report=require(_0x7f92[6])[_0x7f92[9]];const Status=require(_0x7f92[6])[_0x7f92[10]];const Session=require(_0x7f92[6])[_0x7f92[11]];const Message=require(_0x7f92[6])[_0x7f92[7]];const SmsMessage=require(_0x7f92[6])[_0x7f92[12]];const Account=require(_0x7f92[6])[_0x7f92[13]];const Contact=require(_0x7f92[6])[_0x7f92[14]];const Company=require(_0x7f92[6])[_0x7f92[15]];const Attachment=require(_0x7f92[6])[_0x7f92[16]];const ReportMail=require(_0x7f92[6])[_0x7f92[9]];const ReportMailRoom=require(_0x7f92[6])[_0x7f92[17]];const ReportMailSession=require(_0x7f92[6])[_0x7f92[11]];const Promise=require(_0x7f92[18]);const moment=require(_0x7f92[19]);const open=Promise[_0x7f92[22]](require(_0x7f92[21])[_0x7f92[20]]);const close=Promise[_0x7f92[22]](require(_0x7f92[21])[_0x7f92[23]]);const write=Promise[_0x7f92[22]](require(_0x7f92[21])[_0x7f92[24]]);const config=require(_0x7f92[25]);var Util=require(_0x7f92[26]);var processes=[];ReportMail[_0x7f92[47]](function(_0x1c1fx1c,_0x1c1fx1d){var _0x1c1fx1e=_0x1c1fx1c[_0x7f92[27]]({plain:true});if(_0x1c1fx1c[_0x7f92[29]](_0x7f92[28])){return Session[_0x7f92[44]]({memberid:_0x1c1fx1e[_0x7f92[40]],membername:_0x1c1fx1e[_0x7f92[36]],leaveAt:moment()[_0x7f92[42]](_0x7f92[41])},{where:{uniqueid:_0x1c1fx1e[_0x7f92[43]],leaveAt:null},individualHooks:true})[_0x7f92[39]](function(){var _0x1c1fx20=_[_0x7f92[34]](processes,{id:_0x1c1fx1e[_0x7f92[32]],channel:_0x7f92[33]});if(_0x1c1fx20){_0x1c1fx20[_0x7f92[38]][_0x7f92[37]]({type:_0x7f92[35],membername:_0x1c1fx1e[_0x7f92[36]]})}})[_0x7f92[31]](function(_0x1c1fx1f){console[_0x7f92[30]](_0x1c1fx1f)})}else {if(_0x1c1fx1c[_0x7f92[29]](_0x7f92[45])){var _0x1c1fx20=_[_0x7f92[34]](processes,{id:_0x1c1fx1e[_0x7f92[32]],channel:_0x7f92[33]});if(_0x1c1fx20){_0x1c1fx20[_0x7f92[38]][_0x7f92[37]]({type:_0x7f92[46],id:_0x1c1fx1e[_0x7f92[40]],membername:_0x1c1fx1e[_0x7f92[36]]})}}}});function handleMessage(msg,_0x1c1fx22){var _0x1c1fx23;var _0x1c1fx24;var _0x1c1fx25;var _0x1c1fx26;var _0x1c1fx27;var _0x1c1fx28,_0x1c1fx29,_0x1c1fx2a,_0x1c1fx2b;if(msg[_0x7f92[48]]){return Message[_0x7f92[92]]({where:{messageId:msg[_0x7f92[48]][0],accountId:msg[_0x7f92[93]]}})[_0x7f92[39]](function(_0x1c1fx35){if(_0x1c1fx35){return _0x1c1fx35[_0x7f92[98]]()[_0x7f92[39]](function(_0x1c1fx34){_0x1c1fx23= _0x1c1fx34;if(_0x1c1fx34[_0x7f92[85]]!== _0x7f92[86]){return _0x1c1fx23[_0x7f92[44]]({status:_0x7f92[95],openReason:_0x7f92[96],waiting:true},{individualHooks:true})[_0x7f92[39]](function(){return Account[_0x7f92[94]](msg[_0x7f92[93]])[_0x7f92[39]](function(_0x1c1fx37){_0x1c1fx25= _0x1c1fx37;if(_0x1c1fx25[_0x7f92[88]]){return Company[_0x7f92[92]]({where:{emailDomain:msg[_0x7f92[75]][0][_0x7f92[76]][_0x7f92[90]](_0x7f92[89])[1]}})[_0x7f92[39]](function(_0x1c1fx38){return Contact[_0x7f92[91]]({where:{email:msg[_0x7f92[75]][0][_0x7f92[76]]},defaults:{email:msg[_0x7f92[75]][0][_0x7f92[76]],firstName:msg[_0x7f92[75]][0][_0x7f92[83]]|| msg[_0x7f92[75]][0][_0x7f92[76]][_0x7f92[90]](_0x7f92[89])[0],ListId:_0x1c1fx25[_0x7f92[88]],CompanyId:_0x1c1fx38?_0x1c1fx38[_0x7f92[67]]:null}})})}else {return []}})[_0x7f92[87]](function(_0x1c1fx36){_0x1c1fx26= _0x1c1fx36})})}else {return Account[_0x7f92[94]](msg[_0x7f92[93]])[_0x7f92[39]](function(_0x1c1fx37){_0x1c1fx25= _0x1c1fx37;if(_0x1c1fx25[_0x7f92[88]]){return Company[_0x7f92[92]]({where:{emailDomain:msg[_0x7f92[75]][0][_0x7f92[76]][_0x7f92[90]](_0x7f92[89])[1]}})[_0x7f92[39]](function(_0x1c1fx38){return Contact[_0x7f92[91]]({where:{email:msg[_0x7f92[75]][0][_0x7f92[76]]},defaults:{email:msg[_0x7f92[75]][0][_0x7f92[76]],firstName:msg[_0x7f92[75]][0][_0x7f92[83]]|| msg[_0x7f92[75]][0][_0x7f92[76]][_0x7f92[90]](_0x7f92[89])[0],ListId:_0x1c1fx25[_0x7f92[88]],CompanyId:_0x1c1fx38?_0x1c1fx38[_0x7f92[67]]:null}})})}else {return []}})[_0x7f92[87]](function(_0x1c1fx36){_0x1c1fx26= _0x1c1fx36;return Room[_0x7f92[68]]({subject:msg[_0x7f92[74]],from:_[_0x7f92[77]](msg[_0x7f92[75]],_0x7f92[76])[_0x7f92[65]](_0x7f92[97]),account:_0x1c1fx25[_0x7f92[83]],attachment:msg[_0x7f92[50]]&& msg[_0x7f92[50]][_0x7f92[51]],lastEvent:_0x7f92[73],lastEventAt:moment()[_0x7f92[42]](_0x7f92[41]),arrivedAt:moment()[_0x7f92[42]](_0x7f92[41]),waiting:true,MailAccountId:_0x1c1fx25[_0x7f92[67]],ParentId:_0x1c1fx34[_0x7f92[67]]})})[_0x7f92[39]](function(_0x1c1fx34){_0x1c1fx23= _0x1c1fx34})}})}else {return Account[_0x7f92[94]](msg[_0x7f92[93]])[_0x7f92[39]](function(_0x1c1fx37){_0x1c1fx25= _0x1c1fx37;if(_0x1c1fx25[_0x7f92[88]]){return Company[_0x7f92[92]]({where:{emailDomain:msg[_0x7f92[75]][0][_0x7f92[76]][_0x7f92[90]](_0x7f92[89])[1]}})[_0x7f92[39]](function(_0x1c1fx38){return Contact[_0x7f92[91]]({where:{email:msg[_0x7f92[75]][0][_0x7f92[76]]},defaults:{email:msg[_0x7f92[75]][0][_0x7f92[76]],firstName:msg[_0x7f92[75]][0][_0x7f92[83]]|| msg[_0x7f92[75]][0][_0x7f92[76]][_0x7f92[90]](_0x7f92[89])[0],ListId:_0x1c1fx25[_0x7f92[88]],CompanyId:_0x1c1fx38?_0x1c1fx38[_0x7f92[67]]:null}})})}else {return []}})[_0x7f92[87]](function(_0x1c1fx36){_0x1c1fx26= _0x1c1fx36;return Room[_0x7f92[68]]({subject:msg[_0x7f92[74]],from:_[_0x7f92[77]](msg[_0x7f92[75]],_0x7f92[76])[_0x7f92[65]](_0x7f92[97]),account:_0x1c1fx25[_0x7f92[83]],attachment:msg[_0x7f92[50]]&& msg[_0x7f92[50]][_0x7f92[51]],lastEvent:_0x7f92[73],waiting:true,lastEventAt:moment()[_0x7f92[42]](_0x7f92[41]),arrivedAt:moment()[_0x7f92[42]](_0x7f92[41]),MailAccountId:_0x1c1fx25[_0x7f92[67]]})})[_0x7f92[39]](function(_0x1c1fx34){_0x1c1fx23= _0x1c1fx34})}})[_0x7f92[39]](function(){return _0x1c1fx23[_0x7f92[44]]({lastEvent:_0x7f92[73],mailIn:++_0x1c1fx23[_0x7f92[84]]})})[_0x7f92[39]](function(_0x1c1fx34){return Message[_0x7f92[68]]({fromId:_0x1c1fx26?_0x1c1fx26[_0x7f92[67]]:null,messageId:msg[_0x7f92[72]],status:_0x7f92[73],subject:msg[_0x7f92[74]],from:_[_0x7f92[77]](msg[_0x7f92[75]],_0x7f92[76]),to:msg[_0x7f92[78]]?_[_0x7f92[77]](msg[_0x7f92[78]],_0x7f92[76]):[],cc:msg[_0x7f92[79]]?_[_0x7f92[77]](msg[_0x7f92[79]],_0x7f92[76]):[],bcc:msg[_0x7f92[80]]?_[_0x7f92[77]](msg[_0x7f92[80]],_0x7f92[76]):[],text:msg[_0x7f92[81]]|| null,html:msg[_0x7f92[82]]|| null,MailRoomId:_0x1c1fx23[_0x7f92[67]],accountName:_0x1c1fx25[_0x7f92[83]],accountId:_0x1c1fx25[_0x7f92[67]],inReplyTo:msg[_0x7f92[48]][0]})})[_0x7f92[39]](function(_0x1c1fx2c){var _0x1c1fx2d=[];var _0x1c1fx2e=_0x1c1fx2c;_0x1c1fx22[_0x7f92[37]]({message:_0x7f92[49],doc:_0x1c1fx2c});createAndStartRouting(_0x1c1fx23,msg,_0x1c1fx2c[_0x7f92[27]]({plain:true}),_0x1c1fx25);if(msg[_0x7f92[50]]&& msg[_0x7f92[50]][_0x7f92[51]]){msg[_0x7f92[50]][_0x7f92[70]](function(_0x1c1fx2f){var _0x1c1fx30=_0x7f92[52]+ Math[_0x7f92[53]](32);var _0x1c1fx31;_0x1c1fx2d[_0x7f92[69]](Attachment[_0x7f92[68]]({name:_0x1c1fx2f[_0x7f92[55]],basename:_0x1c1fx30,path:path[_0x7f92[65]](config[_0x7f92[61]],_0x7f92[62],_0x7f92[63],_0x7f92[50],_0x7f92[64],_0x1c1fx30),type:_0x1c1fx2f[_0x7f92[66]],size:_0x1c1fx2f[_0x7f92[51]],MailMessageId:_0x1c1fx2e[_0x7f92[67]]})[_0x7f92[39]](function(_0x1c1fx33){return open(_0x1c1fx33[_0x7f92[3]],_0x7f92[60])})[_0x7f92[39]](function(_0x1c1fx32){_0x1c1fx31= _0x1c1fx32;return write(_0x1c1fx31, new Buffer(_0x1c1fx2f[_0x7f92[59]][_0x7f92[58]]),0,_0x1c1fx2f[_0x7f92[51]])})[_0x7f92[39]](function(){return close(_0x1c1fx31)})[_0x7f92[39]](function(){console[_0x7f92[57]](_0x7f92[54],_0x1c1fx2f[_0x7f92[55]],_0x7f92[56])})[_0x7f92[31]](function(_0x1c1fx1f){console[_0x7f92[30]](_0x1c1fx1f)}))})};return Promise[_0x7f92[71]](_0x1c1fx2d)})[_0x7f92[31]](function(_0x1c1fx1f){console[_0x7f92[30]](_0x1c1fx1f)})}else {return Account[_0x7f92[94]](msg[_0x7f92[93]])[_0x7f92[39]](function(_0x1c1fx37){_0x1c1fx25= _0x1c1fx37;if(_0x1c1fx25[_0x7f92[88]]){return Company[_0x7f92[92]]({where:{emailDomain:msg[_0x7f92[75]][0][_0x7f92[76]][_0x7f92[90]](_0x7f92[89])[1]}})[_0x7f92[39]](function(_0x1c1fx38){return Contact[_0x7f92[91]]({where:{email:msg[_0x7f92[75]][0][_0x7f92[76]]},defaults:{email:msg[_0x7f92[75]][0][_0x7f92[76]],firstName:msg[_0x7f92[75]][0][_0x7f92[83]]|| msg[_0x7f92[75]][0][_0x7f92[76]][_0x7f92[90]](_0x7f92[89])[0],ListId:_0x1c1fx25[_0x7f92[88]],CompanyId:_0x1c1fx38?_0x1c1fx38[_0x7f92[67]]:null}})})}else {return []}})[_0x7f92[87]](function(_0x1c1fx36){_0x1c1fx26= _0x1c1fx36;return Room[_0x7f92[68]]({mailIn:1,account:_0x1c1fx25[_0x7f92[83]],subject:msg[_0x7f92[74]],from:_[_0x7f92[77]](msg[_0x7f92[75]],_0x7f92[76])[_0x7f92[65]](_0x7f92[97]),status:_0x7f92[100],lastEvent:_0x7f92[73],lastEventAt:moment()[_0x7f92[42]](_0x7f92[41]),arrivedAt:moment()[_0x7f92[42]](_0x7f92[41]),attachment:msg[_0x7f92[50]]&& msg[_0x7f92[50]][_0x7f92[51]],waiting:true,MailMessages:[{messageId:msg[_0x7f92[72]],subject:msg[_0x7f92[74]],from:_[_0x7f92[77]](msg[_0x7f92[75]],_0x7f92[76]),fromId:_0x1c1fx26?_0x1c1fx26[_0x7f92[67]]:null,to:msg[_0x7f92[78]]?_[_0x7f92[77]](msg[_0x7f92[78]],_0x7f92[76]):[],cc:msg[_0x7f92[79]]?_[_0x7f92[77]](msg[_0x7f92[79]],_0x7f92[76]):[],bcc:msg[_0x7f92[80]]?_[_0x7f92[77]](msg[_0x7f92[80]],_0x7f92[76]):[],status:_0x7f92[73],text:msg[_0x7f92[81]]|| null,html:msg[_0x7f92[82]]|| null,accountName:_0x1c1fx25[_0x7f92[83]],accountId:_0x1c1fx25[_0x7f92[67]]}],MailAccountId:msg[_0x7f92[93]]},{include:[{model:Message}]})})[_0x7f92[39]](function(_0x1c1fx39){var _0x1c1fx2d=[];var _0x1c1fx3a=_0x1c1fx39;_0x1c1fx22[_0x7f92[37]]({message:_0x7f92[49],doc:_0x1c1fx39[_0x7f92[99]][0]});createAndStartRouting(_0x1c1fx3a,msg,_0x1c1fx3a[_0x7f92[99]][0][_0x7f92[27]]({plain:true}),_0x1c1fx25);if(msg[_0x7f92[50]]&& msg[_0x7f92[50]][_0x7f92[51]]){msg[_0x7f92[50]][_0x7f92[70]](function(_0x1c1fx2f){var _0x1c1fx30=_0x7f92[52]+ Math[_0x7f92[53]](32);var _0x1c1fx31;_0x1c1fx2d[_0x7f92[69]](Attachment[_0x7f92[68]]({name:_0x1c1fx2f[_0x7f92[55]],basename:_0x1c1fx30,path:path[_0x7f92[65]](config[_0x7f92[61]],_0x7f92[62],_0x7f92[63],_0x7f92[50],_0x7f92[64],_0x1c1fx30),type:_0x1c1fx2f[_0x7f92[66]],size:_0x1c1fx2f[_0x7f92[51]],MailMessageId:_0x1c1fx3a[_0x7f92[99]][0][_0x7f92[67]]})[_0x7f92[39]](function(_0x1c1fx33){return open(_0x1c1fx33[_0x7f92[3]],_0x7f92[60])})[_0x7f92[39]](function(_0x1c1fx32){_0x1c1fx31= _0x1c1fx32;return write(_0x1c1fx31, new Buffer(_0x1c1fx2f[_0x7f92[59]][_0x7f92[58]]),0,_0x1c1fx2f[_0x7f92[51]])})[_0x7f92[39]](function(){return close(_0x1c1fx31)})[_0x7f92[39]](function(){console[_0x7f92[57]](_0x7f92[54],_0x1c1fx2f[_0x7f92[55]],_0x7f92[56])})[_0x7f92[31]](function(_0x1c1fx1f){console[_0x7f92[30]](_0x1c1fx1f)}))})};return Promise[_0x7f92[71]](_0x1c1fx2d)})[_0x7f92[31]](function(_0x1c1fx1f){console[_0x7f92[30]](_0x1c1fx1f)})}}function handleState(_0x1c1fx3c,_0x1c1fx1e){return ms[_0x7f92[94]](_0x1c1fx3c)[_0x7f92[39]](function(_0x1c1fx3d){return _0x1c1fx3d[_0x7f92[44]]({state:_0x1c1fx1e[_0x7f92[101]],source:_0x1c1fx1e[_0x7f92[102]]|| null})})[_0x7f92[31]](function(_0x1c1fx1f){console[_0x7f92[30]](_0x1c1fx1f)})}function fork(_0x1c1fx3c,_0x1c1fx3f,_0x1c1fx22){return cp[_0x7f92[109]](__dirname+ _0x7f92[108],[_0x1c1fx3c,_0x1c1fx3f])[_0x7f92[103]](_0x7f92[105],function(_0x1c1fx1e){switch(_0x1c1fx1e[_0x7f92[107]]){case _0x7f92[106]:handleMessage(_0x1c1fx1e,_0x1c1fx22);break;case _0x7f92[101]:handleState(_0x1c1fx3c,_0x1c1fx1e);break;default:}})[_0x7f92[103]](_0x7f92[23],function(_0x1c1fx40){console[_0x7f92[57]](util[_0x7f92[42]](_0x7f92[104],_0x1c1fx3f,_0x1c1fx40))})[_0x7f92[103]](_0x7f92[30],function(_0x1c1fx1f){console[_0x7f92[30]](_0x1c1fx1f)})}function execRequest(_0x1c1fx1c,_0x1c1fx42,_0x1c1fx43){Util[_0x7f92[112]](_0x1c1fx1c,_0x1c1fx42,_0x1c1fx43)[_0x7f92[39]](function(_0x1c1fx44){console[_0x7f92[57]](_0x7f92[111])})[_0x7f92[31]](function(_0x1c1fx1f){console[_0x7f92[57]](_0x7f92[110])})}function webhook(_0x1c1fx1c,_0x1c1fx46,_0x1c1fx47){var _0x1c1fx48=_0x1c1fx46;switch(_0x1c1fx47){case _0x7f92[121]:if(_0x1c1fx48[_0x7f92[113]]&& _0x1c1fx48[_0x7f92[114]]){console[_0x7f92[57]](_0x7f92[115]+ _0x1c1fx48[_0x7f92[83]]+ _0x7f92[116]);execRequest(_0x1c1fx1c[_0x7f92[117]],_0x1c1fx48[_0x7f92[113]],_0x1c1fx48[_0x7f92[114]])};if(_0x1c1fx48[_0x7f92[118]][_0x7f92[51]]){_[_0x7f92[70]](_0x1c1fx48[_0x7f92[118]],function(_0x1c1fx49){if(_0x1c1fx49[_0x7f92[119]]){Util[_0x7f92[120]](_0x1c1fx49,_0x1c1fx1c)}})};break;case _0x7f92[46]:if(_0x1c1fx48[_0x7f92[122]]&& _0x1c1fx48[_0x7f92[123]]){console[_0x7f92[57]](_0x7f92[115]+ _0x1c1fx48[_0x7f92[83]]+ _0x7f92[124]);execRequest(_0x1c1fx1c[_0x7f92[117]],_0x1c1fx48[_0x7f92[122]],_0x1c1fx48[_0x7f92[123]])};break;case _0x7f92[23]:if(_0x1c1fx48[_0x7f92[125]]&& _0x1c1fx48[_0x7f92[126]]){console[_0x7f92[57]](_0x7f92[115]+ _0x1c1fx48[_0x7f92[83]]+ _0x7f92[127]);execRequest(_0x1c1fx1c[_0x7f92[117]],_0x1c1fx48[_0x7f92[125]],_0x1c1fx48[_0x7f92[126]])};break;default:console[_0x7f92[57]](_0x7f92[128])}}function synch(_0x1c1fx4b,_0x1c1fx4c){Account[_0x7f92[133]](function(_0x1c1fx1c){var _0x1c1fx46=_[_0x7f92[34]](_0x1c1fx4b,{id:_0x1c1fx1c[_0x7f92[67]]});if(_0x1c1fx46&& _0x1c1fx46[_0x7f92[5]]){if(_0x1c1fx4c[_0x1c1fx46[_0x7f92[5]][_0x7f92[67]]]){console[_0x7f92[57]](util[_0x7f92[42]](_0x7f92[129],_0x1c1fx46[_0x7f92[5]][_0x7f92[67]],_0x1c1fx4c[_0x1c1fx46[_0x7f92[5]][_0x7f92[67]]][_0x7f92[130]]));_0x1c1fx4c[_0x1c1fx46[_0x7f92[5]][_0x7f92[67]]][_0x7f92[131]]();_0x1c1fx4c[_0x1c1fx46[_0x7f92[5]][_0x7f92[67]]]= null};_[_0x7f92[132]](_0x1c1fx4b,{id:_0x1c1fx1c[_0x7f92[67]]})}});Account[_0x7f92[134]](function(_0x1c1fx1c){_0x1c1fx4b[_0x7f92[69]](_0x1c1fx1c)});Account[_0x7f92[47]](function(_0x1c1fx1c){var _0x1c1fx4d=_[_0x7f92[34]](_0x1c1fx4b,{id:_0x1c1fx1c[_0x7f92[67]]});if(_0x1c1fx4d){console[_0x7f92[57]](_0x7f92[135]+ _0x1c1fx4d[_0x7f92[83]]+ _0x7f92[136]);_[_0x7f92[137]](_0x1c1fx4d,_0x1c1fx1c)}else {_0x1c1fx4b[_0x7f92[138]](_0x1c1fx1c)}})}function createAndStartRouting(_0x1c1fx39,_0x1c1fx4f,_0x1c1fx2c,_0x1c1fx46){var _0x1c1fx50=cp[_0x7f92[109]](path[_0x7f92[65]](config[_0x7f92[61]],_0x7f92[143]))[_0x7f92[103]](_0x7f92[105],function(msg){switch(msg[_0x7f92[107]]){case _0x7f92[141]:return Message[_0x7f92[68]](msg[_0x7f92[106]],{include:[{model:Attachment}]});case _0x7f92[142]:return SmsMessage[_0x7f92[68]](msg[_0x7f92[106]]);default:}})[_0x7f92[103]](_0x7f92[139],function(){var _0x1c1fx51=_[_0x7f92[132]](processes,{pid:this[_0x7f92[130]]});if(_0x1c1fx51&& _0x1c1fx51[_0x7f92[51]]){return Room[_0x7f92[94]](_0x1c1fx51[0][_0x7f92[140]])[_0x7f92[39]](function(_0x1c1fx39){if(_0x1c1fx39){return _0x1c1fx39[_0x7f92[44]]({waiting:false})}})}});_0x1c1fx50[_0x7f92[37]]({type:_0x7f92[144],param1:{channel:_0x7f92[33],uniqueid:util[_0x7f92[42]](_0x7f92[145],moment()[_0x7f92[146]](),_0x1c1fx39[_0x7f92[67]]),subject:_0x1c1fx4f[_0x7f92[74]],messageid:_0x1c1fx2c[_0x7f92[67]],roomid:_0x1c1fx39[_0x7f92[67]],accountid:_0x1c1fx46[_0x7f92[67]],accountname:_0x1c1fx46[_0x7f92[83]],accountaddress:_0x1c1fx46[_0x7f92[76]],from:_0x1c1fx4f[_0x7f92[75]][0][_0x7f92[76]],cc:_0x1c1fx4f[_0x7f92[79]]?_[_0x7f92[77]](_0x1c1fx4f[_0x7f92[79]],_0x7f92[76]):[]},param2:_0x1c1fx2c});processes[_0x7f92[69]]({id:_0x1c1fx2c[_0x7f92[67]],channel:_0x7f92[33],process:_0x1c1fx50,roomid:_0x1c1fx39[_0x7f92[67]],pid:_0x1c1fx50[_0x7f92[130]]})}module[_0x7f92[147]]= function(_0x1c1fx22){var _0x1c1fx4c={};var _0x1c1fx4b;var _0x1c1fx52;process[_0x7f92[103]](_0x7f92[139],function(_0x1c1fx40){for(var _0x1c1fx53 in _0x1c1fx4c){if(_0x1c1fx4c[_0x1c1fx53]){_0x1c1fx4c[_0x1c1fx53][_0x7f92[131]]()}}});Account[_0x7f92[151]]({include:[ms]})[_0x7f92[39]](function(_0x1c1fx54){_0x1c1fx4b= _0x1c1fx54;synch(_0x1c1fx4b,_0x1c1fx4c);_0x1c1fx4b[_0x7f92[70]](function(_0x1c1fx46){if(_0x1c1fx46[_0x7f92[5]]){_0x1c1fx4c[_0x1c1fx46[_0x7f92[5]][_0x7f92[67]]]= fork(_0x1c1fx46[_0x7f92[5]][_0x7f92[67]],_0x1c1fx46[_0x7f92[5]][_0x7f92[148]],_0x1c1fx22)}});ReportMail[_0x7f92[47]](function(_0x1c1fx1c){var _0x1c1fx46=_[_0x7f92[34]](_0x1c1fx4b,{id:parseInt(_0x1c1fx1c[_0x7f92[149]])});if(_0x1c1fx46&& _0x1c1fx1c[_0x7f92[29]](_0x7f92[28])){webhook(_0x1c1fx1c,_0x1c1fx46,_0x7f92[121])};if(_0x1c1fx46&& _0x1c1fx1c[_0x7f92[29]](_0x7f92[45])){webhook(_0x1c1fx1c,_0x1c1fx46,_0x7f92[46])}});Room[_0x7f92[47]](function(_0x1c1fx1c){var _0x1c1fx46=_[_0x7f92[34]](_0x1c1fx4b,{id:_0x1c1fx1c[_0x7f92[150]]});if(_0x1c1fx46&& _0x1c1fx1c[_0x7f92[29]](_0x7f92[85])&& _0x1c1fx1c[_0x7f92[85]]=== _0x7f92[86]){webhook(_0x1c1fx1c,_0x1c1fx46,_0x7f92[23])}})})[_0x7f92[31]](function(_0x1c1fx1f){console[_0x7f92[30]](_0x1c1fx1f)});ms[_0x7f92[134]](function(_0x1c1fx3d){var _0x1c1fx46=_[_0x7f92[34]](_0x1c1fx4b,{id:_0x1c1fx3d[_0x7f92[150]]});if(_0x1c1fx46){_0x1c1fx46[_0x7f92[5]]= _0x1c1fx3d};_0x1c1fx4c[_0x1c1fx3d[_0x7f92[67]]]= fork(_0x1c1fx3d[_0x7f92[67]],_0x1c1fx3d[_0x7f92[148]],_0x1c1fx22)});ms[_0x7f92[47]](function(_0x1c1fx3d){if(_0x1c1fx4c[_0x1c1fx3d[_0x7f92[67]]]){if(_0x1c1fx3d[_0x7f92[29]](_0x7f92[101])|| _0x1c1fx3d[_0x7f92[29]](_0x7f92[102])){console[_0x7f92[57]](util[_0x7f92[42]](_0x7f92[152],_0x1c1fx3d[_0x7f92[67]],_0x1c1fx4c[_0x1c1fx3d[_0x7f92[67]]][_0x7f92[130]]))}else {_0x1c1fx4c[_0x1c1fx3d[_0x7f92[67]]][_0x7f92[131]]();_0x1c1fx4c[_0x1c1fx3d[_0x7f92[67]]]= null;_0x1c1fx4c[_0x1c1fx3d[_0x7f92[67]]]= fork(_0x1c1fx3d[_0x7f92[67]],_0x1c1fx3d[_0x7f92[148]],_0x1c1fx22)}}});ms[_0x7f92[133]](function(_0x1c1fx3d){if(_0x1c1fx4c[_0x1c1fx3d[_0x7f92[67]]]){console[_0x7f92[57]](util[_0x7f92[42]](_0x7f92[129],_0x1c1fx3d[_0x7f92[67]],_0x1c1fx4c[_0x1c1fx3d[_0x7f92[67]]][_0x7f92[130]]));_0x1c1fx4c[_0x1c1fx3d[_0x7f92[67]]][_0x7f92[131]]();_0x1c1fx4c[_0x1c1fx3d[_0x7f92[67]]]= null}})}
\ No newline at end of file
+var _0x5a23=["\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","\x6D\x6F\x6D\x65\x6E\x74","\x6B\x75\x65","\x62\x6C\x75\x65\x62\x69\x72\x64","\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","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x53\x6D\x73\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x53\x65\x74\x74\x69\x6E\x67","\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","\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","\x6D\x61\x69\x6C","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x2E\x2E\x2F\x75\x74\x69\x6C","\x63\x72\x65\x61\x74\x65\x51\x75\x65\x75\x65","\x67\x65\x74","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x64","\x63\x68\x61\x6E\x67\x65\x64","\x45\x72\x72\x6F\x72\x20\x6F\x6E\x20\x6D\x61\x69\x6C\x20\x61\x63\x63\x65\x70\x74","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6D\x65\x73\x73\x61\x67\x65\x69\x64","\x66\x69\x6E\x64","\x73\x74\x6F\x70","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x73\x65\x6E\x64","\x70\x72\x6F\x63\x65\x73\x73","\x74\x68\x65\x6E","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x75\x6E\x69\x71\x75\x65\x69\x64","\x75\x70\x64\x61\x74\x65","\x72\x65\x6A\x65\x63\x74\x65\x64\x41\x74","\x72\x65\x6A\x65\x63\x74","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x69\x6E\x52\x65\x70\x6C\x79\x54\x6F","\x73\x74\x61\x63\x6B","\x6D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65\x41\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\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","\x4D\x61\x69\x6C\x20\x68\x61\x6E\x64\x6C\x69\x6E\x67\x20\x65\x72\x72\x6F\x72","\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","\x64\x65\x62\x75\x67","\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","\x68\x74\x6D\x6C","\x6E\x61\x6D\x65","\x6D\x61\x69\x6C\x49\x6E","\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","\x53\x65\x72\x76\x65\x72\x20\x73\x74\x61\x74\x65\x20\x65\x72\x72\x6F\x72\x3A","\x73\x74\x61\x74\x65","\x73\x6F\x75\x72\x63\x65","\x49\x4D\x41\x50\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x65\x72\x72\x6F\x72","\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","\x69\x6E\x66\x6F","\x72\x65\x71\x75\x65\x73\x74\x20\x73\x75\x63\x63\x65\x65\x64\x65\x64\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","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\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","\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","\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","\x70\x69\x64","\x6B\x69\x6C\x6C","\x72\x65\x6D\x6F\x76\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x4D\x61\x69\x6C\x20\x61\x63\x63\x6F\x75\x6E\x74\x3A\x20","\x20\x55\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x75\x6E\x73\x68\x69\x66\x74","\x73\x61\x76\x65","\x72\x65\x6D\x6F\x76\x65\x4F\x6E\x43\x6F\x6D\x70\x6C\x65\x74\x65","\x65\x6D\x61\x69\x6C","\x4E\x65\x77\x20\x65\x6D\x61\x69\x6C\x20\x66\x72\x6F\x6D\x3A\x20\x25\x73","\x6D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x72\x6F\x6F\x6D","\x61\x63\x63\x6F\x75\x6E\x74","\x64\x69\x73\x63\x6F\x6E\x6E\x65\x63\x74","\x65\x78\x69\x74","\x66\x69\x6E\x61\x6C\x6C\x79","\x72\x6F\x6F\x6D\x69\x64","\x63\x72\x65\x61\x74\x65\x4D\x61\x69\x6C","\x63\x72\x65\x61\x74\x65\x53\x6D\x73","\x63\x72\x65\x61\x74\x65\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x53\x65\x73\x73\x69\x6F\x6E","\x2F\x73\x65\x72\x76\x65\x72\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x66\x6F\x72\x6B\x65\x64\x5F\x72\x6F\x75\x74\x69\x6E\x67\x2F\x6D\x61\x69\x6C\x2F\x69\x6E\x64\x65\x78\x2E\x6A\x73","\x73\x74\x61\x72\x74","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x65\x78\x70\x6F\x72\x74\x73","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x6D\x61\x69\x6C\x52\x6F\x75\x74\x69\x6E\x67\x43\x61\x70\x61\x63\x69\x74\x79","\x66\x69\x6E\x64\x41\x6C\x6C","\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"];_0x5a23[0];var _=require(_0x5a23[1]);var util=require(_0x5a23[2]);var path=require(_0x5a23[3]);var cp=require(_0x5a23[4]);var moment=require(_0x5a23[5]);var kue=require(_0x5a23[6]);var Promise=require(_0x5a23[7]);var ms=require(_0x5a23[9])[_0x5a23[8]];var msg=require(_0x5a23[9])[_0x5a23[10]];var Room=require(_0x5a23[9])[_0x5a23[11]];var Report=require(_0x5a23[9])[_0x5a23[12]];var Status=require(_0x5a23[9])[_0x5a23[13]];var Session=require(_0x5a23[9])[_0x5a23[14]];var Message=require(_0x5a23[9])[_0x5a23[10]];var SmsMessage=require(_0x5a23[9])[_0x5a23[15]];var Account=require(_0x5a23[9])[_0x5a23[16]];var Setting=require(_0x5a23[9])[_0x5a23[17]];var Contact=require(_0x5a23[9])[_0x5a23[18]];var Company=require(_0x5a23[9])[_0x5a23[19]];var Attachment=require(_0x5a23[9])[_0x5a23[20]];var open=Promise[_0x5a23[23]](require(_0x5a23[22])[_0x5a23[21]]);var close=Promise[_0x5a23[23]](require(_0x5a23[22])[_0x5a23[24]]);var write=Promise[_0x5a23[23]](require(_0x5a23[22])[_0x5a23[25]]);var logger=require(_0x5a23[27])(_0x5a23[26]);var config=require(_0x5a23[28]);var Util=require(_0x5a23[29]);var queue=kue[_0x5a23[30]]();var processes=[];var ami;Report[_0x5a23[51]](function(_0x1bc9x1e,_0x1bc9x1f){var _0x1bc9x20=_0x1bc9x1e[_0x5a23[31]]({plain:true});if(_0x1bc9x1e[_0x5a23[33]](_0x5a23[32])){return Session[_0x5a23[48]]({memberid:_0x1bc9x20[_0x5a23[44]],membername:_0x1bc9x20[_0x5a23[40]],leaveAt:moment()[_0x5a23[46]](_0x5a23[45])},{where:{uniqueid:_0x1bc9x20[_0x5a23[47]],leaveAt:null},individualHooks:true})[_0x5a23[43]](function(){var _0x1bc9x22=_[_0x5a23[38]](processes,{id:_0x1bc9x20[_0x5a23[37]],channel:_0x5a23[26]});if(_0x1bc9x22){_0x1bc9x22[_0x5a23[42]][_0x5a23[41]]({type:_0x5a23[39],membername:_0x1bc9x20[_0x5a23[40]]})}})[_0x5a23[36]](function(_0x1bc9x21){logger[_0x5a23[35]](_0x5a23[34],_0x1bc9x21)})}else {if(_0x1bc9x1e[_0x5a23[33]](_0x5a23[49])){var _0x1bc9x22=_[_0x5a23[38]](processes,{id:_0x1bc9x20[_0x5a23[37]],channel:_0x5a23[26]});if(_0x1bc9x22){_0x1bc9x22[_0x5a23[42]][_0x5a23[41]]({type:_0x5a23[50],id:_0x1bc9x20[_0x5a23[44]],membername:_0x1bc9x20[_0x5a23[40]]})}}}});function handleMessage(msg){var _0x1bc9x24;var _0x1bc9x25;var _0x1bc9x26;var _0x1bc9x27;var _0x1bc9x28;var _0x1bc9x29,_0x1bc9x2a,_0x1bc9x2b,_0x1bc9x2c;if(msg[_0x5a23[52]]){return Message[_0x5a23[98]]({where:{messageId:msg[_0x5a23[52]][0],accountId:msg[_0x5a23[99]]}})[_0x5a23[43]](function(_0x1bc9x36){if(_0x1bc9x36){return _0x1bc9x36[_0x5a23[104]]()[_0x5a23[43]](function(_0x1bc9x35){_0x1bc9x24= _0x1bc9x35;if(_0x1bc9x35[_0x5a23[91]]!== _0x5a23[92]){return _0x1bc9x24[_0x5a23[48]]({status:_0x5a23[101],openReason:_0x5a23[102],waiting:true},{individualHooks:true})[_0x5a23[43]](function(){return Account[_0x5a23[100]](msg[_0x5a23[99]])[_0x5a23[43]](function(_0x1bc9x38){_0x1bc9x26= _0x1bc9x38;if(_0x1bc9x26[_0x5a23[94]]){return Company[_0x5a23[98]]({where:{emailDomain:msg[_0x5a23[81]][0][_0x5a23[82]][_0x5a23[96]](_0x5a23[95])[1]}})[_0x5a23[43]](function(_0x1bc9x39){return Contact[_0x5a23[97]]({where:{email:msg[_0x5a23[81]][0][_0x5a23[82]]},defaults:{email:msg[_0x5a23[81]][0][_0x5a23[82]],firstName:msg[_0x5a23[81]][0][_0x5a23[89]]|| msg[_0x5a23[81]][0][_0x5a23[82]][_0x5a23[96]](_0x5a23[95])[0],ListId:_0x1bc9x26[_0x5a23[94]],CompanyId:_0x1bc9x39?_0x1bc9x39[_0x5a23[73]]:null}})})}else {return []}})[_0x5a23[93]](function(_0x1bc9x37){_0x1bc9x27= _0x1bc9x37})})}else {return Account[_0x5a23[100]](msg[_0x5a23[99]])[_0x5a23[43]](function(_0x1bc9x38){_0x1bc9x26= _0x1bc9x38;if(_0x1bc9x26[_0x5a23[94]]){return Company[_0x5a23[98]]({where:{emailDomain:msg[_0x5a23[81]][0][_0x5a23[82]][_0x5a23[96]](_0x5a23[95])[1]}})[_0x5a23[43]](function(_0x1bc9x39){return Contact[_0x5a23[97]]({where:{email:msg[_0x5a23[81]][0][_0x5a23[82]]},defaults:{email:msg[_0x5a23[81]][0][_0x5a23[82]],firstName:msg[_0x5a23[81]][0][_0x5a23[89]]|| msg[_0x5a23[81]][0][_0x5a23[82]][_0x5a23[96]](_0x5a23[95])[0],ListId:_0x1bc9x26[_0x5a23[94]],CompanyId:_0x1bc9x39?_0x1bc9x39[_0x5a23[73]]:null}})})}else {return []}})[_0x5a23[93]](function(_0x1bc9x37){_0x1bc9x27= _0x1bc9x37;return Room[_0x5a23[74]]({subject:msg[_0x5a23[80]],from:_[_0x5a23[83]](msg[_0x5a23[81]],_0x5a23[82])[_0x5a23[71]](_0x5a23[103]),account:_0x1bc9x26[_0x5a23[89]],attachment:msg[_0x5a23[55]]&& msg[_0x5a23[55]][_0x5a23[56]],lastEvent:_0x5a23[79],lastEventAt:moment()[_0x5a23[46]](_0x5a23[45]),arrivedAt:moment()[_0x5a23[46]](_0x5a23[45]),waiting:true,MailAccountId:_0x1bc9x26[_0x5a23[73]],ParentId:_0x1bc9x35[_0x5a23[73]]})})[_0x5a23[43]](function(_0x1bc9x35){_0x1bc9x24= _0x1bc9x35})}})}else {return Account[_0x5a23[100]](msg[_0x5a23[99]])[_0x5a23[43]](function(_0x1bc9x38){_0x1bc9x26= _0x1bc9x38;if(_0x1bc9x26[_0x5a23[94]]){return Company[_0x5a23[98]]({where:{emailDomain:msg[_0x5a23[81]][0][_0x5a23[82]][_0x5a23[96]](_0x5a23[95])[1]}})[_0x5a23[43]](function(_0x1bc9x39){return Contact[_0x5a23[97]]({where:{email:msg[_0x5a23[81]][0][_0x5a23[82]]},defaults:{email:msg[_0x5a23[81]][0][_0x5a23[82]],firstName:msg[_0x5a23[81]][0][_0x5a23[89]]|| msg[_0x5a23[81]][0][_0x5a23[82]][_0x5a23[96]](_0x5a23[95])[0],ListId:_0x1bc9x26[_0x5a23[94]],CompanyId:_0x1bc9x39?_0x1bc9x39[_0x5a23[73]]:null}})})}else {return []}})[_0x5a23[93]](function(_0x1bc9x37){_0x1bc9x27= _0x1bc9x37;return Room[_0x5a23[74]]({subject:msg[_0x5a23[80]],from:_[_0x5a23[83]](msg[_0x5a23[81]],_0x5a23[82])[_0x5a23[71]](_0x5a23[103]),account:_0x1bc9x26[_0x5a23[89]],attachment:msg[_0x5a23[55]]&& msg[_0x5a23[55]][_0x5a23[56]],lastEvent:_0x5a23[79],waiting:true,lastEventAt:moment()[_0x5a23[46]](_0x5a23[45]),arrivedAt:moment()[_0x5a23[46]](_0x5a23[45]),MailAccountId:_0x1bc9x26[_0x5a23[73]]})})[_0x5a23[43]](function(_0x1bc9x35){_0x1bc9x24= _0x1bc9x35})}})[_0x5a23[43]](function(){return _0x1bc9x24[_0x5a23[48]]({lastEvent:_0x5a23[79],mailIn:++_0x1bc9x24[_0x5a23[90]]})})[_0x5a23[43]](function(_0x1bc9x35){return Message[_0x5a23[74]]({fromId:_0x1bc9x27?_0x1bc9x27[_0x5a23[73]]:null,messageId:msg[_0x5a23[78]],status:_0x5a23[79],subject:msg[_0x5a23[80]],from:_[_0x5a23[83]](msg[_0x5a23[81]],_0x5a23[82]),to:msg[_0x5a23[84]]?_[_0x5a23[83]](msg[_0x5a23[84]],_0x5a23[82]):[],cc:msg[_0x5a23[85]]?_[_0x5a23[83]](msg[_0x5a23[85]],_0x5a23[82]):[],bcc:msg[_0x5a23[86]]?_[_0x5a23[83]](msg[_0x5a23[86]],_0x5a23[82]):[],text:msg[_0x5a23[87]]|| null,html:msg[_0x5a23[88]]|| null,MailRoomId:_0x1bc9x24[_0x5a23[73]],accountName:_0x1bc9x26[_0x5a23[89]],accountId:_0x1bc9x26[_0x5a23[73]],inReplyTo:msg[_0x5a23[52]][0]})})[_0x5a23[43]](function(_0x1bc9x2d){var _0x1bc9x2e=[];var _0x1bc9x2f=_0x1bc9x2d;if(ami){ami[_0x5a23[41]]({message:_0x5a23[54],doc:_0x1bc9x2d})};createAndStartRouting(_0x1bc9x24,msg,_0x1bc9x2d[_0x5a23[31]]({plain:true}),_0x1bc9x26);if(msg[_0x5a23[55]]&& msg[_0x5a23[55]][_0x5a23[56]]){msg[_0x5a23[55]][_0x5a23[76]](function(_0x1bc9x30){var _0x1bc9x31=_0x5a23[57]+ Math[_0x5a23[58]](32);var _0x1bc9x32;_0x1bc9x2e[_0x5a23[75]](Attachment[_0x5a23[74]]({name:_0x1bc9x30[_0x5a23[61]],basename:_0x1bc9x31,path:path[_0x5a23[71]](config[_0x5a23[67]],_0x5a23[68],_0x5a23[69],_0x5a23[55],_0x5a23[70],_0x1bc9x31),type:_0x1bc9x30[_0x5a23[72]],size:_0x1bc9x30[_0x5a23[56]],MailMessageId:_0x1bc9x2f[_0x5a23[73]]})[_0x5a23[43]](function(_0x1bc9x34){return open(_0x1bc9x34[_0x5a23[3]],_0x5a23[66])})[_0x5a23[43]](function(_0x1bc9x33){_0x1bc9x32= _0x1bc9x33;return write(_0x1bc9x32, new Buffer(_0x1bc9x30[_0x5a23[65]][_0x5a23[64]]),0,_0x1bc9x30[_0x5a23[56]])})[_0x5a23[43]](function(){return close(_0x1bc9x32)})[_0x5a23[43]](function(){logger[_0x5a23[63]](_0x5a23[60],_0x1bc9x30[_0x5a23[61]],_0x5a23[62])})[_0x5a23[36]](function(_0x1bc9x21){logger[_0x5a23[35]](_0x5a23[59],_0x1bc9x21[_0x5a23[53]])}))})};return Promise[_0x5a23[77]](_0x1bc9x2e)})[_0x5a23[36]](function(_0x1bc9x21){logger[_0x5a23[35]](_0x1bc9x21[_0x5a23[53]])})}else {return Account[_0x5a23[100]](msg[_0x5a23[99]])[_0x5a23[43]](function(_0x1bc9x38){_0x1bc9x26= _0x1bc9x38;if(_0x1bc9x26[_0x5a23[94]]){return Company[_0x5a23[98]]({where:{emailDomain:msg[_0x5a23[81]][0][_0x5a23[82]][_0x5a23[96]](_0x5a23[95])[1]}})[_0x5a23[43]](function(_0x1bc9x39){return Contact[_0x5a23[97]]({where:{email:msg[_0x5a23[81]][0][_0x5a23[82]]},defaults:{email:msg[_0x5a23[81]][0][_0x5a23[82]],firstName:msg[_0x5a23[81]][0][_0x5a23[89]]|| msg[_0x5a23[81]][0][_0x5a23[82]][_0x5a23[96]](_0x5a23[95])[0],ListId:_0x1bc9x26[_0x5a23[94]],CompanyId:_0x1bc9x39?_0x1bc9x39[_0x5a23[73]]:null}})})}else {return []}})[_0x5a23[93]](function(_0x1bc9x37){_0x1bc9x27= _0x1bc9x37;return Room[_0x5a23[74]]({mailIn:1,account:_0x1bc9x26[_0x5a23[89]],subject:msg[_0x5a23[80]],from:_[_0x5a23[83]](msg[_0x5a23[81]],_0x5a23[82])[_0x5a23[71]](_0x5a23[103]),status:_0x5a23[106],lastEvent:_0x5a23[79],lastEventAt:moment()[_0x5a23[46]](_0x5a23[45]),arrivedAt:moment()[_0x5a23[46]](_0x5a23[45]),attachment:msg[_0x5a23[55]]&& msg[_0x5a23[55]][_0x5a23[56]],waiting:true,MailMessages:[{messageId:msg[_0x5a23[78]],subject:msg[_0x5a23[80]],from:_[_0x5a23[83]](msg[_0x5a23[81]],_0x5a23[82]),fromId:_0x1bc9x27?_0x1bc9x27[_0x5a23[73]]:null,to:msg[_0x5a23[84]]?_[_0x5a23[83]](msg[_0x5a23[84]],_0x5a23[82]):[],cc:msg[_0x5a23[85]]?_[_0x5a23[83]](msg[_0x5a23[85]],_0x5a23[82]):[],bcc:msg[_0x5a23[86]]?_[_0x5a23[83]](msg[_0x5a23[86]],_0x5a23[82]):[],status:_0x5a23[79],text:msg[_0x5a23[87]]|| null,html:msg[_0x5a23[88]]|| null,accountName:_0x1bc9x26[_0x5a23[89]],accountId:_0x1bc9x26[_0x5a23[73]]}],MailAccountId:msg[_0x5a23[99]]},{include:[{model:Message}]})})[_0x5a23[43]](function(_0x1bc9x3a){var _0x1bc9x2e=[];var _0x1bc9x3b=_0x1bc9x3a;ami[_0x5a23[41]]({message:_0x5a23[54],doc:_0x1bc9x3a[_0x5a23[105]][0]});createAndStartRouting(_0x1bc9x3b,msg,_0x1bc9x3b[_0x5a23[105]][0][_0x5a23[31]]({plain:true}),_0x1bc9x26);if(msg[_0x5a23[55]]&& msg[_0x5a23[55]][_0x5a23[56]]){msg[_0x5a23[55]][_0x5a23[76]](function(_0x1bc9x30){var _0x1bc9x31=_0x5a23[57]+ Math[_0x5a23[58]](32);var _0x1bc9x32;_0x1bc9x2e[_0x5a23[75]](Attachment[_0x5a23[74]]({name:_0x1bc9x30[_0x5a23[61]],basename:_0x1bc9x31,path:path[_0x5a23[71]](config[_0x5a23[67]],_0x5a23[68],_0x5a23[69],_0x5a23[55],_0x5a23[70],_0x1bc9x31),type:_0x1bc9x30[_0x5a23[72]],size:_0x1bc9x30[_0x5a23[56]],MailMessageId:_0x1bc9x3b[_0x5a23[105]][0][_0x5a23[73]]})[_0x5a23[43]](function(_0x1bc9x34){return open(_0x1bc9x34[_0x5a23[3]],_0x5a23[66])})[_0x5a23[43]](function(_0x1bc9x33){_0x1bc9x32= _0x1bc9x33;return write(_0x1bc9x32, new Buffer(_0x1bc9x30[_0x5a23[65]][_0x5a23[64]]),0,_0x1bc9x30[_0x5a23[56]])})[_0x5a23[43]](function(){return close(_0x1bc9x32)})[_0x5a23[43]](function(){logger[_0x5a23[63]](_0x5a23[60],_0x1bc9x30[_0x5a23[61]],_0x5a23[62])})[_0x5a23[36]](function(_0x1bc9x21){logger[_0x5a23[35]](_0x5a23[59],_0x1bc9x21[_0x5a23[53]])}))})};return Promise[_0x5a23[77]](_0x1bc9x2e)})[_0x5a23[36]](function(_0x1bc9x21){logger[_0x5a23[35]](_0x1bc9x21[_0x5a23[53]])})}}function handleState(_0x1bc9x3d,_0x1bc9x20){return ms[_0x5a23[100]](_0x1bc9x3d)[_0x5a23[43]](function(_0x1bc9x3e){return _0x1bc9x3e[_0x5a23[48]]({state:_0x1bc9x20[_0x5a23[108]],source:_0x1bc9x20[_0x5a23[109]]|| null})})[_0x5a23[36]](function(_0x1bc9x21){logger[_0x5a23[35]](_0x5a23[107],_0x1bc9x21[_0x5a23[53]])})}function fork(_0x1bc9x3d,_0x1bc9x40){return cp[_0x5a23[117]](__dirname+ _0x5a23[116],[_0x1bc9x3d,_0x1bc9x40])[_0x5a23[111]](_0x5a23[113],function(_0x1bc9x20){switch(_0x1bc9x20[_0x5a23[115]]){case _0x5a23[114]:handleMessage(_0x1bc9x20);break;case _0x5a23[108]:handleState(_0x1bc9x3d,_0x1bc9x20);break;default:}})[_0x5a23[111]](_0x5a23[24],function(_0x1bc9x41){logger[_0x5a23[63]](util[_0x5a23[46]](_0x5a23[112],_0x1bc9x40,_0x1bc9x41))})[_0x5a23[111]](_0x5a23[35],function(_0x1bc9x21){logger[_0x5a23[35]](_0x5a23[110],_0x1bc9x21[_0x5a23[53]])})}function execRequest(_0x1bc9x1e,_0x1bc9x43,_0x1bc9x44){Util[_0x5a23[121]](_0x1bc9x1e,_0x1bc9x43,_0x1bc9x44)[_0x5a23[43]](function(_0x1bc9x45){logger[_0x5a23[63]](_0x5a23[120])})[_0x5a23[36]](function(_0x1bc9x21){logger[_0x5a23[119]](_0x5a23[118])})}function webhook(_0x1bc9x1e,_0x1bc9x47,_0x1bc9x48){var _0x1bc9x49=_0x1bc9x47;switch(_0x1bc9x48){case _0x5a23[130]:if(_0x1bc9x49[_0x5a23[122]]&& _0x1bc9x49[_0x5a23[123]]){logger[_0x5a23[63]](_0x5a23[124]+ _0x1bc9x49[_0x5a23[89]]+ _0x5a23[125]);execRequest(_0x1bc9x1e[_0x5a23[126]],_0x1bc9x49[_0x5a23[122]],_0x1bc9x49[_0x5a23[123]])};if(_0x1bc9x49[_0x5a23[127]][_0x5a23[56]]){_[_0x5a23[76]](_0x1bc9x49[_0x5a23[127]],function(_0x1bc9x4a){if(_0x1bc9x4a[_0x5a23[128]]){Util[_0x5a23[129]](_0x1bc9x4a,_0x1bc9x1e)}})};break;case _0x5a23[50]:if(_0x1bc9x49[_0x5a23[131]]&& _0x1bc9x49[_0x5a23[132]]){logger[_0x5a23[63]](_0x5a23[124]+ _0x1bc9x49[_0x5a23[89]]+ _0x5a23[133]);execRequest(_0x1bc9x1e[_0x5a23[126]],_0x1bc9x49[_0x5a23[131]],_0x1bc9x49[_0x5a23[132]])};break;case _0x5a23[24]:if(_0x1bc9x49[_0x5a23[134]]&& _0x1bc9x49[_0x5a23[135]]){logger[_0x5a23[63]](_0x5a23[124]+ _0x1bc9x49[_0x5a23[89]]+ _0x5a23[136]);execRequest(_0x1bc9x1e[_0x5a23[126]],_0x1bc9x49[_0x5a23[134]],_0x1bc9x49[_0x5a23[135]])};break;default:logger[_0x5a23[35]](_0x5a23[137])}}function synch(_0x1bc9x4c,_0x1bc9x4d){Account[_0x5a23[142]](function(_0x1bc9x1e){var _0x1bc9x47=_[_0x5a23[38]](_0x1bc9x4c,{id:_0x1bc9x1e[_0x5a23[73]]});if(_0x1bc9x47&& _0x1bc9x47[_0x5a23[8]]){if(_0x1bc9x4d[_0x1bc9x47[_0x5a23[8]][_0x5a23[73]]]){logger[_0x5a23[63]](util[_0x5a23[46]](_0x5a23[138],_0x1bc9x47[_0x5a23[8]][_0x5a23[73]],_0x1bc9x4d[_0x1bc9x47[_0x5a23[8]][_0x5a23[73]]][_0x5a23[139]]));_0x1bc9x4d[_0x1bc9x47[_0x5a23[8]][_0x5a23[73]]][_0x5a23[140]]();_0x1bc9x4d[_0x1bc9x47[_0x5a23[8]][_0x5a23[73]]]= null};_[_0x5a23[141]](_0x1bc9x4c,{id:_0x1bc9x1e[_0x5a23[73]]})}});Account[_0x5a23[143]](function(_0x1bc9x1e){_0x1bc9x4c[_0x5a23[75]](_0x1bc9x1e)});Account[_0x5a23[51]](function(_0x1bc9x1e){var _0x1bc9x4e=_[_0x5a23[38]](_0x1bc9x4c,{id:_0x1bc9x1e[_0x5a23[73]]});if(_0x1bc9x4e){logger[_0x5a23[63]](_0x5a23[144]+ _0x1bc9x4e[_0x5a23[89]]+ _0x5a23[145]);_[_0x5a23[146]](_0x1bc9x4e,_0x1bc9x1e)}else {_0x1bc9x4c[_0x5a23[147]](_0x1bc9x1e)}})}function createAndStartRouting(_0x1bc9x3a,_0x1bc9x50,_0x1bc9x2d,_0x1bc9x47){return queue[_0x5a23[74]](_0x5a23[150],{title:util[_0x5a23[46]](_0x5a23[151],_0x1bc9x2d[_0x5a23[81]]),room:_0x1bc9x3a,message:_0x1bc9x50,mailMessage:_0x1bc9x2d,account:_0x1bc9x47})[_0x5a23[149]](true)[_0x5a23[148]]()}function handleMail(_0x1bc9x52,_0x1bc9x53){var _0x1bc9x50=_0x1bc9x52[_0x5a23[64]][_0x5a23[113]];var _0x1bc9x2d=_0x1bc9x52[_0x5a23[64]][_0x5a23[152]];var _0x1bc9x3a=_0x1bc9x52[_0x5a23[64]][_0x5a23[153]];var _0x1bc9x47=_0x1bc9x52[_0x5a23[64]][_0x5a23[154]];var _0x1bc9x54=_0x1bc9x53;var _0x1bc9x55=cp[_0x5a23[117]](path[_0x5a23[71]](config[_0x5a23[67]],_0x5a23[162]))[_0x5a23[111]](_0x5a23[113],function(msg){switch(msg[_0x5a23[115]]){case _0x5a23[159]:return Message[_0x5a23[74]](msg[_0x5a23[114]],{include:[{model:Attachment}]});case _0x5a23[160]:return SmsMessage[_0x5a23[74]](msg[_0x5a23[114]]);case _0x5a23[161]:ami[_0x5a23[41]]({message:msg[_0x5a23[115]],doc:msg[_0x5a23[114]]});break;default:}})[_0x5a23[111]](_0x5a23[156],function(){var _0x1bc9x56=_[_0x5a23[141]](processes,{pid:this[_0x5a23[139]]});if(_0x1bc9x56&& _0x1bc9x56[_0x5a23[56]]){return Room[_0x5a23[100]](_0x1bc9x56[0][_0x5a23[158]])[_0x5a23[43]](function(_0x1bc9x3a){if(_0x1bc9x3a){return _0x1bc9x3a[_0x5a23[48]]({waiting:false})}})[_0x5a23[157]](function(){_0x1bc9x54()})}})[_0x5a23[111]](_0x5a23[24],function(){_0x1bc9x54()})[_0x5a23[111]](_0x5a23[155],function(){_0x1bc9x54()})[_0x5a23[111]](_0x5a23[35],function(_0x1bc9x21){_0x1bc9x54(_0x1bc9x21)});_0x1bc9x55[_0x5a23[41]]({type:_0x5a23[163],param1:{channel:_0x5a23[26],uniqueid:util[_0x5a23[46]](_0x5a23[164],moment()[_0x5a23[165]](),_0x1bc9x3a[_0x5a23[73]]),subject:_0x1bc9x50[_0x5a23[80]],messageid:_0x1bc9x2d[_0x5a23[73]],roomid:_0x1bc9x3a[_0x5a23[73]],accountid:_0x1bc9x47[_0x5a23[73]],accountname:_0x1bc9x47[_0x5a23[89]],accountaddress:_0x1bc9x47[_0x5a23[82]],from:_0x1bc9x50[_0x5a23[81]][0][_0x5a23[82]],cc:_0x1bc9x50[_0x5a23[85]]?_[_0x5a23[83]](_0x1bc9x50[_0x5a23[85]],_0x5a23[82]):[]},param2:_0x1bc9x2d});processes[_0x5a23[75]]({id:_0x1bc9x2d[_0x5a23[73]],channel:_0x5a23[26],process:_0x1bc9x55,roomid:_0x1bc9x3a[_0x5a23[73]],pid:_0x1bc9x55[_0x5a23[139]]})}module[_0x5a23[166]]= function(_0x1bc9x57){var _0x1bc9x4d={};var _0x1bc9x4c;var _0x1bc9x58;ami= _0x1bc9x57;process[_0x5a23[111]](_0x5a23[156],function(_0x1bc9x41){for(var _0x1bc9x59 in _0x1bc9x4d){if(_0x1bc9x4d[_0x1bc9x59]){_0x1bc9x4d[_0x1bc9x59][_0x5a23[140]]()}}});Setting[_0x5a23[38]]({where:{id:1},attributes:[_0x5a23[73],_0x5a23[170]],raw:true})[_0x5a23[43]](function(_0x1bc9x5b){if(_0x1bc9x5b){queue[_0x5a23[42]](_0x5a23[150],_0x1bc9x5b[_0x5a23[170]],handleMail)};return Account[_0x5a23[171]]({include:[ms]})})[_0x5a23[43]](function(_0x1bc9x5a){_0x1bc9x4c= _0x1bc9x5a;synch(_0x1bc9x4c,_0x1bc9x4d);_0x1bc9x4c[_0x5a23[76]](function(_0x1bc9x47){if(_0x1bc9x47[_0x5a23[8]]){_0x1bc9x4d[_0x1bc9x47[_0x5a23[8]][_0x5a23[73]]]= fork(_0x1bc9x47[_0x5a23[8]][_0x5a23[73]],_0x1bc9x47[_0x5a23[8]][_0x5a23[167]])}});Report[_0x5a23[51]](function(_0x1bc9x1e){var _0x1bc9x47=_[_0x5a23[38]](_0x1bc9x4c,{id:parseInt(_0x1bc9x1e[_0x5a23[168]])});if(_0x1bc9x47&& _0x1bc9x1e[_0x5a23[33]](_0x5a23[32])){webhook(_0x1bc9x1e,_0x1bc9x47,_0x5a23[130])};if(_0x1bc9x47&& _0x1bc9x1e[_0x5a23[33]](_0x5a23[49])){webhook(_0x1bc9x1e,_0x1bc9x47,_0x5a23[50])}});Room[_0x5a23[51]](function(_0x1bc9x1e){var _0x1bc9x47=_[_0x5a23[38]](_0x1bc9x4c,{id:_0x1bc9x1e[_0x5a23[169]]});if(_0x1bc9x47&& _0x1bc9x1e[_0x5a23[33]](_0x5a23[91])&& _0x1bc9x1e[_0x5a23[91]]=== _0x5a23[92]){webhook(_0x1bc9x1e,_0x1bc9x47,_0x5a23[24])}})})[_0x5a23[36]](function(_0x1bc9x21){logger[_0x5a23[35]](_0x1bc9x21[_0x5a23[53]])});ms[_0x5a23[143]](function(_0x1bc9x3e){var _0x1bc9x47=_[_0x5a23[38]](_0x1bc9x4c,{id:_0x1bc9x3e[_0x5a23[169]]});if(_0x1bc9x47){_0x1bc9x47[_0x5a23[8]]= _0x1bc9x3e};_0x1bc9x4d[_0x1bc9x3e[_0x5a23[73]]]= fork(_0x1bc9x3e[_0x5a23[73]],_0x1bc9x3e[_0x5a23[167]])});ms[_0x5a23[51]](function(_0x1bc9x3e){if(_0x1bc9x4d[_0x1bc9x3e[_0x5a23[73]]]){if(_0x1bc9x3e[_0x5a23[33]](_0x5a23[108])|| _0x1bc9x3e[_0x5a23[33]](_0x5a23[109])){logger[_0x5a23[63]](util[_0x5a23[46]](_0x5a23[172],_0x1bc9x3e[_0x5a23[73]],_0x1bc9x4d[_0x1bc9x3e[_0x5a23[73]]][_0x5a23[139]]))}else {_0x1bc9x4d[_0x1bc9x3e[_0x5a23[73]]][_0x5a23[140]]();_0x1bc9x4d[_0x1bc9x3e[_0x5a23[73]]]= null;_0x1bc9x4d[_0x1bc9x3e[_0x5a23[73]]]= fork(_0x1bc9x3e[_0x5a23[73]],_0x1bc9x3e[_0x5a23[167]])}}});ms[_0x5a23[142]](function(_0x1bc9x3e){if(_0x1bc9x4d[_0x1bc9x3e[_0x5a23[73]]]){logger[_0x5a23[63]](util[_0x5a23[46]](_0x5a23[138],_0x1bc9x3e[_0x5a23[73]],_0x1bc9x4d[_0x1bc9x3e[_0x5a23[73]]][_0x5a23[139]]));_0x1bc9x4d[_0x1bc9x3e[_0x5a23[73]]][_0x5a23[140]]();_0x1bc9x4d[_0x1bc9x3e[_0x5a23[73]]]= null}})}
\ No newline at end of file