Built motion from commit b322525.|0.0.112
[motion.git] / server / config / smtp / smtp.js
index 46355a0..f714370 100644 (file)
@@ -1 +1 @@
-var _0x825d=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x75\x74\x69\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6C\x6F\x64\x61\x73\x68","\x6E\x6F\x64\x65\x6D\x61\x69\x6C\x65\x72","\x6E\x6F\x64\x65\x6D\x61\x69\x6C\x65\x72\x2D\x73\x6D\x74\x70\x2D\x74\x72\x61\x6E\x73\x70\x6F\x72\x74","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x53\x4D\x54\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","\x61\x72\x67\x76","\x66\x6F\x72\x6D\x61\x74","\x6C\x6F\x67","\x6D\x65\x73\x73\x61\x67\x65","\x74\x79\x70\x65","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x69\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x73\x74\x61\x74\x65","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x43\x4F\x4E\x4E\x45\x43\x54\x49\x4E\x47","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x53\x54\x41\x52\x54\x49\x4E\x47\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x70\x69\x64","\x45\x52\x52\x4F\x52","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x45\x52\x52\x4F\x52\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x73\x65\x6E\x64","\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x76\x65\x72\x69\x66\x79","\x68\x6F\x73\x74","\x70\x6F\x72\x74","\x73\x73\x6C","\x70\x61\x73\x73\x77\x6F\x72\x64","\x63\x72\x65\x61\x74\x65\x54\x72\x61\x6E\x73\x70\x6F\x72\x74","\x6D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x6D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74\x49\x64","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x53\x45\x4E\x44\x49\x4E\x47\x20\x4D\x53\x47\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x73\x74\x61\x74\x75\x73","\x53\x45\x4E\x44\x49\x4E\x47","\x69\x6E\x52\x65\x70\x6C\x79\x54\x6F","\x75\x70\x64\x61\x74\x65","\x46\x41\x49\x4C\x45\x44","\x6D\x65\x73\x73\x61\x67\x65\x49\x64","\x53\x45\x4E\x54","\x66\x72\x6F\x6D","\x74\x6F","\x63\x63","\x73\x75\x62\x6A\x65\x63\x74","\x68\x74\x6D\x6C","\x66\x72\x6F\x6D\x53\x74\x72\x69\x6E\x67","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x70\x61\x74\x68","\x6E\x61\x6D\x65","\x6D\x61\x70","\x73\x65\x6E\x64\x4D\x61\x69\x6C","\x61\x64\x64\x55\x73\x65\x72","\x6D\x61\x69\x6C\x4F\x75\x74","\x61\x64\x64\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x66\x69\x6E\x64\x4F\x6E\x65","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x3B","\x6A\x6F\x69\x6E","\x4F\x50\x45\x4E","\x55\x73\x65\x72\x49\x64","\x63\x72\x65\x61\x74\x65"];_0x825d[0];var util=require(_0x825d[1]);var promise=require(_0x825d[2]);var _=require(_0x825d[3]);var nodemailer=require(_0x825d[4]);var smtpTransport=require(_0x825d[5]);var htmlToText=require(_0x825d[6]);var Room=require(_0x825d[8])[_0x825d[7]];var Account=require(_0x825d[8])[_0x825d[9]];var Message=require(_0x825d[8])[_0x825d[10]];var Server=require(_0x825d[8])[_0x825d[11]];var Attachment=require(_0x825d[8])[_0x825d[12]];var smtp;var timeout;process[_0x825d[14]](_0x825d[20],function(_0x2bb6x10){if(_0x2bb6x10[_0x825d[21]]===_0x825d[20]){return Message[_0x825d[25]](_0x2bb6x10[_0x825d[24]],{include:[{model:Attachment}]})[_0x825d[23]](function(_0x2bb6x11){onSend(_0x2bb6x11)})[_0x825d[22]](function(_0x2bb6xe){console[_0x825d[13]](_0x2bb6xe)})};if(_0x2bb6x10[_0x825d[21]]===_0x825d[26]){switch(_0x2bb6x10[_0x825d[26]]){case _0x825d[28]:onVerify(_0x2bb6x10[_0x825d[27]]);break;default:}}})[_0x825d[14]](_0x825d[15],function(_0x2bb6xf){console[_0x825d[19]](util[_0x825d[18]](_0x825d[16],process[_0x825d[17]][3],_0x2bb6xf))})[_0x825d[14]](_0x825d[13],function(_0x2bb6xe){console[_0x825d[13]](_0x2bb6xe)});console[_0x825d[19]](util[_0x825d[18]](_0x825d[29],process[_0x825d[17]][3],process[_0x825d[30]]));function onVerify(_0x2bb6x13){smtp[_0x825d[37]]()[_0x825d[23]](function(){process[_0x825d[34]]({type:_0x825d[26],state:_0x825d[35],source:null,log:util[_0x825d[18]](_0x825d[36],_0x2bb6x13,process[_0x825d[30]])})})[_0x825d[22]](function(_0x2bb6xe){process[_0x825d[34]]({type:_0x825d[26],state:_0x825d[31],source:JSON[_0x825d[32]](_0x2bb6xe),log:util[_0x825d[18]](_0x825d[33],_0x2bb6x13,process[_0x825d[30]])})})}function onSave(_0x2bb6x15){smtp=nodemailer[_0x825d[42]](smtpTransport({host:_0x2bb6x15[_0x825d[38]],port:_0x2bb6x15[_0x825d[39]],secure:_0x2bb6x15[_0x825d[40]],pool:true,auth:{user:_0x2bb6x15[_0x825d[27]],pass:_0x2bb6x15[_0x825d[41]]}}));smtp[_0x825d[43]]=_0x2bb6x15[_0x825d[44]];smtp[_0x825d[45]]=_0x2bb6x15[_0x825d[24]];smtp[_0x825d[27]]=_0x2bb6x15[_0x825d[27]];onVerify(_0x2bb6x15[_0x825d[27]])}function onSend(_0x2bb6x11){console[_0x825d[19]](util[_0x825d[18]](_0x825d[46],process[_0x825d[17]][3],process[_0x825d[30]]));if(_0x2bb6x11[_0x825d[47]]===_0x825d[48]){var _0x2bb6x17;var _0x2bb6x18=_0x2bb6x11;var _0x2bb6x19,_0x2bb6x1a,_0x2bb6x1b,_0x2bb6x1c;if(_0x2bb6x18[_0x825d[49]]){return Message[_0x825d[70]]({where:{messageId:_0x2bb6x18[_0x825d[49]]}})[_0x825d[23]](function(_0x2bb6x21){return _0x2bb6x21[_0x825d[69]]({include:{model:Account}})})[_0x825d[23]](function(_0x2bb6x20){_0x2bb6x17=_0x2bb6x20;return _0x2bb6x17[_0x825d[68]](_0x2bb6x18)})[_0x825d[23]](function(){return _0x2bb6x17[_0x825d[50]]({lastEvent:_0x825d[48],mailOut:++_0x2bb6x17[_0x825d[67]]})})[_0x825d[23]](function(){return _0x2bb6x17[_0x825d[66]](_0x2bb6x18.UserId)})[_0x825d[23]](function(){var _0x2bb6x1e={status:_0x2bb6x18[_0x825d[47]],from:_0x2bb6x18[_0x825d[54]],to:_0x2bb6x18[_0x825d[55]],cc:_0x2bb6x18[_0x825d[56]],subject:_0x2bb6x18[_0x825d[57]],html:_0x2bb6x18[_0x825d[58]],text:_0x2bb6x18[_0x825d[58]]?htmlToText[_0x825d[59]](_0x2bb6x18[_0x825d[58]],{wordwrap:false}):null};if(_0x2bb6x18[_0x825d[60]]){_0x2bb6x1e[_0x825d[61]]=_[_0x825d[64]](_0x2bb6x18.MailAttachments,function(_0x2bb6x1f){return {path:_0x2bb6x1f[_0x825d[62]],filename:_0x2bb6x1f[_0x825d[63]]}})};return smtp[_0x825d[65]](_0x2bb6x1e)})[_0x825d[23]](function(_0x2bb6x1d){process[_0x825d[34]]({msgId:_0x2bb6x18[_0x825d[24]],roomId:_0x2bb6x17[_0x825d[24]],type:_0x825d[50],messageId:_0x2bb6x1d[_0x825d[52]],status:_0x825d[53]})})[_0x825d[22]](function(_0x2bb6xe){process[_0x825d[34]]({msgId:_0x2bb6x18[_0x825d[24]],roomId:_0x2bb6x17[_0x825d[24]],type:_0x825d[50],status:_0x825d[51]})})}else {return Account[_0x825d[25]](smtp[_0x825d[43]])[_0x825d[23]](function(_0x2bb6x22){if(_0x2bb6x11[_0x825d[71]]){return Room[_0x825d[25]](_0x2bb6x11.MailRoomId)}else {return Room[_0x825d[76]]({subject:_0x2bb6x18[_0x825d[57]],from:_0x2bb6x18[_0x825d[54]][_0x825d[73]](_0x825d[72]),account:_0x2bb6x22?_0x2bb6x22[_0x825d[63]]:null,status:_0x825d[74],lastEvent:_0x825d[48],MailAccountId:_0x2bb6x22?_0x2bb6x22[_0x825d[24]]:null,mailOut:1},{userId:_0x2bb6x18[_0x825d[75]]})}})[_0x825d[23]](function(_0x2bb6x20){_0x2bb6x17=_0x2bb6x20;return _0x2bb6x17[_0x825d[68]](_0x2bb6x18[_0x825d[24]])})[_0x825d[23]](function(){return _0x2bb6x17[_0x825d[66]](_0x2bb6x18.UserId)})[_0x825d[23]](function(){var _0x2bb6x1e={status:_0x2bb6x18[_0x825d[47]],from:_0x2bb6x18[_0x825d[54]],to:_0x2bb6x18[_0x825d[55]],cc:_0x2bb6x18[_0x825d[56]],subject:_0x2bb6x18[_0x825d[57]],html:_0x2bb6x18[_0x825d[58]],text:_0x2bb6x18[_0x825d[58]]?htmlToText[_0x825d[59]](_0x2bb6x18[_0x825d[58]],{wordwrap:false}):null};if(_0x2bb6x18[_0x825d[60]]){_0x2bb6x1e[_0x825d[61]]=_[_0x825d[64]](_0x2bb6x18.MailAttachments,function(_0x2bb6x1f){return {path:_0x2bb6x1f[_0x825d[62]],filename:_0x2bb6x1f[_0x825d[63]]}})};return smtp[_0x825d[65]](_0x2bb6x1e)})[_0x825d[23]](function(_0x2bb6x1d){process[_0x825d[34]]({msgId:_0x2bb6x18[_0x825d[24]],roomId:_0x2bb6x17[_0x825d[24]],type:_0x825d[50],messageId:_0x2bb6x1d[_0x825d[52]],status:_0x825d[53]})})[_0x825d[22]](function(_0x2bb6xe){process[_0x825d[34]]({msgId:_0x2bb6x18[_0x825d[24]],roomId:_0x2bb6x17[_0x825d[24]],type:_0x825d[50],status:_0x825d[51]})})}}}Server[_0x825d[25]](process[_0x825d[17]][2])[_0x825d[23]](function(_0x2bb6x15){onSave(_0x2bb6x15)})[_0x825d[22]](function(_0x2bb6xe){console[_0x825d[13]](_0x2bb6xe)})
\ No newline at end of file
+var _0x6fd2=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x75\x74\x69\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6C\x6F\x64\x61\x73\x68","\x6D\x75\x73\x74\x61\x63\x68\x65","\x6E\x6F\x64\x65\x6D\x61\x69\x6C\x65\x72","\x6E\x6F\x64\x65\x6D\x61\x69\x6C\x65\x72\x2D\x73\x6D\x74\x70\x2D\x74\x72\x61\x6E\x73\x70\x6F\x72\x74","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x54\x65\x6D\x70\x6C\x61\x74\x65","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x53\x4D\x54\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","\x61\x72\x67\x76","\x66\x6F\x72\x6D\x61\x74","\x6C\x6F\x67","\x6D\x65\x73\x73\x61\x67\x65","\x74\x79\x70\x65","\x73\x74\x61\x74\x65","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x43\x4F\x4E\x4E\x45\x43\x54\x49\x4E\x47","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x53\x54\x41\x52\x54\x49\x4E\x47\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x70\x69\x64","\x45\x52\x52\x4F\x52","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x45\x52\x52\x4F\x52\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x73\x65\x6E\x64","\x63\x61\x74\x63\x68","\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x74\x68\x65\x6E","\x76\x65\x72\x69\x66\x79","\x68\x6F\x73\x74","\x70\x6F\x72\x74","\x73\x73\x6C","\x70\x61\x73\x73\x77\x6F\x72\x64","\x63\x72\x65\x61\x74\x65\x54\x72\x61\x6E\x73\x70\x6F\x72\x74","\x6D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x6D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74\x49\x64","\x69\x64","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x53\x45\x4E\x44\x49\x4E\x47\x20\x4D\x53\x47\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x73\x74\x61\x74\x75\x73","\x53\x45\x4E\x44\x49\x4E\x47","\x69\x6E\x52\x65\x70\x6C\x79\x54\x6F","\x75\x70\x64\x61\x74\x65","\x46\x41\x49\x4C\x45\x44","\x72\x65\x74\x72\x79\x53\x65\x6E\x64","\x6D\x65\x73\x73\x61\x67\x65\x49\x64","\x53\x45\x4E\x54","\x68\x74\x6D\x6C","\x75\x74\x66\x38","\x74\x65\x78\x74","\x73\x75\x62\x6A\x65\x63\x74","\x66\x72\x6F\x6D\x53\x74\x72\x69\x6E\x67","\x6E\x61\x6D\x65","\x66\x72\x6F\x6D","\x74\x6F","\x63\x63","\x62\x63\x63","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x72\x65\x6E\x64\x65\x72","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x70\x61\x74\x68","\x6D\x61\x70","\x73\x65\x6E\x64\x4D\x61\x69\x6C","\x61\x64\x64\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x6C\x65\x6E\x67\x74\x68","\x6D\x61\x69\x6C\x4F\x75\x74","\x61\x64\x64\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x66\x69\x6E\x64\x4F\x6E\x65","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x4F\x50\x45\x4E","\x55\x73\x65\x72\x49\x64","\x63\x72\x65\x61\x74\x65"];_0x6fd2[0];var util=require(_0x6fd2[1]);var promise=require(_0x6fd2[2]);var _=require(_0x6fd2[3]);var Mustache=require(_0x6fd2[4]);var nodemailer=require(_0x6fd2[5]);var smtpTransport=require(_0x6fd2[6]);var htmlToText=require(_0x6fd2[7]);var Agent=require(_0x6fd2[9])[_0x6fd2[8]];var Room=require(_0x6fd2[9])[_0x6fd2[10]];var Template=require(_0x6fd2[9])[_0x6fd2[11]];var Account=require(_0x6fd2[9])[_0x6fd2[12]];var Message=require(_0x6fd2[9])[_0x6fd2[13]];var Server=require(_0x6fd2[9])[_0x6fd2[14]];var Attachment=require(_0x6fd2[9])[_0x6fd2[15]];var smtp;var timeout;process[_0x6fd2[17]](_0x6fd2[23],function(_0x6273x13){if(_0x6273x13[_0x6fd2[24]]===_0x6fd2[23]){onSend(_0x6273x13)};if(_0x6273x13[_0x6fd2[24]]===_0x6fd2[25]){switch(_0x6273x13[_0x6fd2[25]]){case _0x6fd2[27]:onVerify(_0x6273x13[_0x6fd2[26]]);break;default:}}})[_0x6fd2[17]](_0x6fd2[18],function(_0x6273x12){console[_0x6fd2[22]](util[_0x6fd2[21]](_0x6fd2[19],process[_0x6fd2[20]][3],_0x6273x12))})[_0x6fd2[17]](_0x6fd2[16],function(_0x6273x11){console[_0x6fd2[16]](_0x6273x11)});console[_0x6fd2[22]](util[_0x6fd2[21]](_0x6fd2[28],process[_0x6fd2[20]][3],process[_0x6fd2[29]]));function onVerify(_0x6273x15){smtp[_0x6fd2[38]]()[_0x6fd2[37]](function(){process[_0x6fd2[33]]({type:_0x6fd2[25],state:_0x6fd2[35],source:null,log:util[_0x6fd2[21]](_0x6fd2[36],_0x6273x15,process[_0x6fd2[29]])})})[_0x6fd2[34]](function(_0x6273x11){process[_0x6fd2[33]]({type:_0x6fd2[25],state:_0x6fd2[30],source:JSON[_0x6fd2[31]](_0x6273x11),log:util[_0x6fd2[21]](_0x6fd2[32],_0x6273x15,process[_0x6fd2[29]])})})}function onSave(_0x6273x17){smtp=nodemailer[_0x6fd2[43]](smtpTransport({host:_0x6273x17[_0x6fd2[39]],port:_0x6273x17[_0x6fd2[40]],secure:_0x6273x17[_0x6fd2[41]],pool:true,auth:{user:_0x6273x17[_0x6fd2[26]],pass:_0x6273x17[_0x6fd2[42]]}}));smtp[_0x6fd2[44]]=_0x6273x17[_0x6fd2[45]];smtp[_0x6fd2[46]]=_0x6273x17[_0x6fd2[47]];smtp[_0x6fd2[26]]=_0x6273x17[_0x6fd2[26]];onVerify(_0x6273x17[_0x6fd2[26]])}function onSend(_0x6273x19){console[_0x6fd2[22]](util[_0x6fd2[21]](_0x6fd2[48],process[_0x6fd2[20]][3],process[_0x6fd2[29]]));if(_0x6273x19[_0x6fd2[49]]===_0x6fd2[50]){var _0x6273x1a;var _0x6273x1b;var _0x6273x1c;var _0x6273x1d=_0x6273x19;var _0x6273x1e,_0x6273x1f,_0x6273x20,_0x6273x21;if(_0x6273x1d[_0x6fd2[51]]){return Message[_0x6fd2[82]]({where:{messageId:_0x6273x1d[_0x6fd2[51]]}})[_0x6fd2[37]](function(_0x6273x28){return _0x6273x28[_0x6fd2[81]]({include:{model:Account,include:[{model:Template}]}})})[_0x6fd2[37]](function(_0x6273x27){_0x6273x1a=_0x6273x27;_0x6273x1b=_0x6273x27[_0x6fd2[12]];return _0x6273x1a[_0x6fd2[80]](_0x6273x1d[_0x6fd2[47]])})[_0x6fd2[37]](function(){return _0x6273x1a[_0x6fd2[52]]({lastEvent:_0x6fd2[50],attachment:_0x6273x1d[_0x6fd2[71]]&&_0x6273x1d[_0x6fd2[71]][_0x6fd2[78]],mailOut:++_0x6273x1a[_0x6fd2[79]]})})[_0x6fd2[37]](function(){return Agent[_0x6fd2[77]](_0x6273x1d.UserId)})[_0x6fd2[37]](function(_0x6273x26){_0x6273x1c=_0x6273x26;return _0x6273x1a[_0x6fd2[76]](_0x6273x1c)})[_0x6fd2[37]](function(){_0x6273x1d[_0x6fd2[57]]=_0x6273x1d[_0x6fd2[57]].toString(_0x6fd2[58]);_0x6273x1d[_0x6fd2[59]]=_0x6273x1d[_0x6fd2[59]].toString(_0x6fd2[58]);var _0x6273x23=_0x6273x1b[_0x6fd2[11]]?Mustache[_0x6fd2[70]](_0x6273x1b[_0x6fd2[11]][_0x6fd2[57]],{interactionId:_0x6273x1a[_0x6fd2[47]],subject:_0x6273x1d[_0x6fd2[60]],body:_0x6273x1d[_0x6fd2[57]]?htmlToText[_0x6fd2[61]](_0x6273x1d[_0x6fd2[57]],{wordwrap:false}):null,accountName:_0x6273x1b[_0x6fd2[62]],from:_0x6273x1d[_0x6fd2[63]],to:_0x6273x1d[_0x6fd2[64]],cc:_0x6273x1d[_0x6fd2[65]],bcc:_0x6273x1d[_0x6fd2[66]],agentName:_0x6273x1c[_0x6fd2[67]],agentEmail:_0x6273x1c[_0x6fd2[68]],createdAt:_0x6273x1d[_0x6fd2[69]]}):_0x6273x1d[_0x6fd2[57]];var _0x6273x24={status:_0x6273x1d[_0x6fd2[49]],from:_0x6273x1d[_0x6fd2[63]],to:_0x6273x1d[_0x6fd2[64]],cc:_0x6273x1d[_0x6fd2[65]],bcc:_0x6273x1d[_0x6fd2[66]],subject:_0x6273x1d[_0x6fd2[60]],html:_0x6273x23,text:_0x6273x1d[_0x6fd2[57]]?htmlToText[_0x6fd2[61]](_0x6273x1d[_0x6fd2[57]],{wordwrap:false}):null};if(_0x6273x1d[_0x6fd2[71]]){_0x6273x24[_0x6fd2[72]]=_[_0x6fd2[74]](_0x6273x1d.MailAttachments,function(_0x6273x25){return {path:_0x6273x25[_0x6fd2[73]],filename:_0x6273x25[_0x6fd2[62]]}})};return smtp[_0x6fd2[75]](_0x6273x24)})[_0x6fd2[37]](function(_0x6273x22){process[_0x6fd2[33]]({msgId:_0x6273x1d[_0x6fd2[47]],roomId:_0x6273x1a[_0x6fd2[47]],type:_0x6fd2[52],messageId:_0x6273x22[_0x6fd2[55]],status:_0x6fd2[56],retry:_0x6273x1d[_0x6fd2[54]]})})[_0x6fd2[34]](function(_0x6273x11){console[_0x6fd2[16]](_0x6273x11);process[_0x6fd2[33]]({msgId:_0x6273x1d[_0x6fd2[47]],roomId:_0x6273x1a[_0x6fd2[47]],type:_0x6fd2[52],status:_0x6fd2[53],retry:_0x6273x1d[_0x6fd2[54]]})})}else {return Account[_0x6fd2[77]](smtp[_0x6fd2[44]],{include:[{model:Template}]})[_0x6fd2[37]](function(_0x6273x29){_0x6273x1b=_0x6273x29;if(_0x6273x19[_0x6fd2[83]]){return Room[_0x6fd2[77]](_0x6273x19.MailRoomId)}else {return Room[_0x6fd2[86]]({subject:_0x6273x1d[_0x6fd2[60]],from:_0x6273x1d[_0x6fd2[63]],account:_0x6273x29?_0x6273x29[_0x6fd2[62]]:null,status:_0x6fd2[84],lastEvent:_0x6fd2[50],attachment:_0x6273x1d[_0x6fd2[71]]&&_0x6273x1d[_0x6fd2[71]][_0x6fd2[78]],MailAccountId:_0x6273x29?_0x6273x29[_0x6fd2[47]]:null,mailOut:1},{userId:_0x6273x1d[_0x6fd2[85]]})}})[_0x6fd2[37]](function(_0x6273x27){_0x6273x1a=_0x6273x27;return _0x6273x1a[_0x6fd2[80]](_0x6273x1d[_0x6fd2[47]])})[_0x6fd2[37]](function(){return Agent[_0x6fd2[77]](_0x6273x1d.UserId)})[_0x6fd2[37]](function(_0x6273x26){_0x6273x1c=_0x6273x26;return _0x6273x1a[_0x6fd2[76]](_0x6273x1c)})[_0x6fd2[37]](function(){_0x6273x1d[_0x6fd2[57]]=_0x6273x1d[_0x6fd2[57]].toString(_0x6fd2[58]);_0x6273x1d[_0x6fd2[59]]=_0x6273x1d[_0x6fd2[59]].toString(_0x6fd2[58]);var _0x6273x23=_0x6273x1b[_0x6fd2[11]]?Mustache[_0x6fd2[70]](_0x6273x1b[_0x6fd2[11]][_0x6fd2[57]],{interactionId:_0x6273x1a[_0x6fd2[47]],subject:_0x6273x1d[_0x6fd2[60]],body:_0x6273x1d[_0x6fd2[57]]?htmlToText[_0x6fd2[61]](_0x6273x1d[_0x6fd2[57]],{wordwrap:false}):null,accountName:_0x6273x1b[_0x6fd2[62]],from:_0x6273x1d[_0x6fd2[63]],to:_0x6273x1d[_0x6fd2[64]],cc:_0x6273x1d[_0x6fd2[65]],bcc:_0x6273x1d[_0x6fd2[66]],agentName:_0x6273x1c[_0x6fd2[67]],agentEmail:_0x6273x1c[_0x6fd2[68]],createdAt:_0x6273x1d[_0x6fd2[69]]}):_0x6273x1d[_0x6fd2[57]];var _0x6273x24={status:_0x6273x1d[_0x6fd2[49]],from:_0x6273x1d[_0x6fd2[63]],to:_0x6273x1d[_0x6fd2[64]],cc:_0x6273x1d[_0x6fd2[65]],bcc:_0x6273x1d[_0x6fd2[66]],subject:_0x6273x1d[_0x6fd2[60]],html:_0x6273x23,text:_0x6273x1d[_0x6fd2[57]]?htmlToText[_0x6fd2[61]](_0x6273x1d[_0x6fd2[57]],{wordwrap:false}):null};if(_0x6273x1d[_0x6fd2[71]]){_0x6273x24[_0x6fd2[72]]=_[_0x6fd2[74]](_0x6273x1d.MailAttachments,function(_0x6273x25){return {path:_0x6273x25[_0x6fd2[73]],filename:_0x6273x25[_0x6fd2[62]]}})};return smtp[_0x6fd2[75]](_0x6273x24)})[_0x6fd2[37]](function(_0x6273x22){process[_0x6fd2[33]]({msgId:_0x6273x1d[_0x6fd2[47]],roomId:_0x6273x1a[_0x6fd2[47]],type:_0x6fd2[52],messageId:_0x6273x22[_0x6fd2[55]],status:_0x6fd2[56],retry:_0x6273x1d[_0x6fd2[54]]})})[_0x6fd2[34]](function(_0x6273x11){console[_0x6fd2[16]](_0x6273x11);process[_0x6fd2[33]]({msgId:_0x6273x1d[_0x6fd2[47]],roomId:_0x6273x1a[_0x6fd2[47]],type:_0x6fd2[52],status:_0x6fd2[53],retry:_0x6273x1d[_0x6fd2[54]]})})}}}Server[_0x6fd2[77]](process[_0x6fd2[20]][2])[_0x6fd2[37]](function(_0x6273x17){onSave(_0x6273x17)})[_0x6fd2[34]](function(_0x6273x11){console[_0x6fd2[16]](_0x6273x11)})
\ No newline at end of file