Built motion from commit 82438f7.|0.0.115
[motion.git] / server / config / smtp / smtp.js
index 987b814..1d32ff3 100644 (file)
@@ -1 +1 @@
-var _0x4b7a=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6E\x6F\x64\x65\x6D\x61\x69\x6C\x65\x72","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\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","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x6F\x6E\x74\x61\x63\x74","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x43\x6F\x6E\x74\x61\x63\x74\x45\x6D\x61\x69\x6C","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x4D\x41\x49\x4C\x20\x2D\x20\x41\x63\x63\x6F\x75\x6E\x74\x20","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x20\x53\x4D\x54\x50\x20\x43\x52\x45\x41\x54\x45","\x6C\x6F\x67","\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","\x73\x74\x61\x74\x65","\x63\x68\x61\x6E\x67\x65\x64","\x75\x73\x65\x72","\x61\x75\x74\x68","\x6F\x70\x74\x69\x6F\x6E\x73","\x74\x72\x61\x6E\x73\x70\x6F\x72\x74\x65\x72","\x20\x53\x4D\x54\x50\x20\x55\x50\x44\x41\x54\x45","\x5B\x4D\x41\x49\x4C\x20\x2D\x20\x41\x63\x63\x6F\x75\x6E\x74\x20","\x20\x53\x4D\x54\x50\x20\x44\x45\x53\x54\x52\x4F\x59","\x73\x74\x61\x74\x75\x73","\x53\x45\x4E\x44\x49\x4E\x47","\x66\x72\x6F\x6D","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x69\x6E\x52\x65\x70\x6C\x79\x54\x6F","\x65\x72\x72","\x65\x72\x72\x6F\x72","\x6D\x65\x73\x73\x61\x67\x65","\x72\x65\x73\x70\x6F\x6E\x73\x65","\x49\x6E\x74\x65\x72\x6E\x61\x6C\x20\x53\x65\x72\x76\x65\x72\x20\x45\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6D\x65\x73\x73\x61\x67\x65\x49\x64","\x53\x45\x4E\x54","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x75\x70\x64\x61\x74\x65","\x74\x68\x65\x6E","\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","\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","\x69\x6E\x66\x6F","\x73\x70\x72\x65\x61\x64","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x3B","\x6A\x6F\x69\x6E","\x4F\x50\x45\x4E","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x65\x78\x70\x6F\x72\x74\x73"];_0x4b7a[0];var _=require(_0x4b7a[1]);var Promise=require(_0x4b7a[2]);var nodemailer=require(_0x4b7a[3]);var htmlToText=require(_0x4b7a[4]);var smtpTransport=require(_0x4b7a[5]);var Agent=require(_0x4b7a[7])[_0x4b7a[6]];var Contact=require(_0x4b7a[7])[_0x4b7a[8]];var MailRoom=require(_0x4b7a[7])[_0x4b7a[9]];var MailMessage=require(_0x4b7a[7])[_0x4b7a[10]];var ContactEmail=require(_0x4b7a[7])[_0x4b7a[11]];var MailServerOut=require(_0x4b7a[7])[_0x4b7a[12]];function Smtp(_0x38d1xd){var _0x38d1xe;var _0x38d1xf;function _0x38d1x10(_0x38d1xd){console[_0x4b7a[16]](_0x4b7a[13]+_0x38d1xd[_0x4b7a[14]]+_0x4b7a[15]);_0x38d1xf=_0x38d1xd;_0x38d1xe=nodemailer[_0x4b7a[21]](smtpTransport({host:_0x38d1xd[_0x4b7a[17]],port:_0x38d1xd[_0x4b7a[18]],secure:_0x38d1xd[_0x4b7a[19]],debug:true,auth:{user:_0x38d1xd[_0x4b7a[14]],pass:_0x38d1xd[_0x4b7a[20]]}}))}function _0x38d1x11(_0x38d1xd){if(!_0x38d1xd[_0x4b7a[23]](_0x4b7a[22])&&_0x38d1xe[_0x4b7a[27]][_0x4b7a[26]][_0x4b7a[25]][_0x4b7a[24]]===_0x38d1xd[_0x4b7a[14]]){console[_0x4b7a[16]](_0x4b7a[13]+_0x38d1xd[_0x4b7a[14]]+_0x4b7a[28]);_0x38d1xe=null;_0x38d1xe=nodemailer[_0x4b7a[21]](smtpTransport({host:_0x38d1xd[_0x4b7a[17]],port:_0x38d1xd[_0x4b7a[18]],secure:_0x38d1xd[_0x4b7a[19]],debug:true,auth:{user:_0x38d1xd[_0x4b7a[14]],pass:_0x38d1xd[_0x4b7a[20]]}}))}}function _0x38d1x12(_0x38d1xd){if(_0x38d1xe[_0x4b7a[27]][_0x4b7a[26]][_0x4b7a[25]][_0x4b7a[24]]===_0x38d1xd[_0x4b7a[14]]){console[_0x4b7a[16]](_0x4b7a[29]+_0x38d1xd[_0x4b7a[14]]+_0x4b7a[30]);_0x38d1xe=null}}function _0x38d1x13(_0x38d1x14,_0x38d1x15){if(_0x38d1x14[_0x4b7a[31]]===_0x4b7a[32]&&_0x38d1xe[_0x4b7a[27]][_0x4b7a[26]][_0x4b7a[25]][_0x4b7a[24]]===_0x38d1x14[_0x4b7a[34]][_0x4b7a[33]]){var _0x38d1x16;var _0x38d1x17=_0x38d1x14;var _0x38d1x18,_0x38d1x19,_0x38d1x1a,_0x38d1x1b;if(_0x38d1x17[_0x4b7a[35]]){return MailMessage[_0x4b7a[61]]({where:{messageId:_0x38d1x17[_0x4b7a[35]]}})[_0x4b7a[46]](function(_0x38d1x22){return _0x38d1x22[_0x4b7a[60]]()})[_0x4b7a[46]](function(_0x38d1x21){_0x38d1x16=_0x38d1x21;return _0x38d1x16[_0x4b7a[59]](_0x38d1x17,{transaction:_0x38d1x15?_0x38d1x15[_0x4b7a[44]]:null})})[_0x4b7a[46]](function(){return _0x38d1x16[_0x4b7a[58]](_0x38d1x17.UserId,{transaction:_0x38d1x15?_0x38d1x15[_0x4b7a[44]]:null})})[_0x4b7a[46]](function(_0x38d1x20){_0x38d1x1b=_[_0x4b7a[56]](_0x38d1x20,function(_0x38d1x1f){return _0x38d1x1f[0]});return})[_0x4b7a[46]](function(){var _0x38d1x1e={status:_0x38d1x17[_0x4b7a[31]],from:_0x38d1x17[_0x4b7a[33]],to:_0x38d1x17[_0x4b7a[47]],cc:_0x38d1x17[_0x4b7a[48]],subject:_0x38d1x17[_0x4b7a[49]],html:_0x38d1x17[_0x4b7a[50]],text:_0x38d1x17[_0x4b7a[50]]?htmlToText[_0x4b7a[51]](_0x38d1x17[_0x4b7a[50]],{wordwrap:false}):null,headers:{"\x58\x2D\x4C\x61\x7A\x69\x6E\x65\x73\x73\x2D\x6C\x65\x76\x65\x6C":1000}};if(_0x38d1x17[_0x4b7a[52]]){_0x38d1x1e[_0x4b7a[53]]=_[_0x4b7a[56]](_0x38d1x17.MailAttachments,function(_0x38d1x1f){return {path:_0x38d1x1f[_0x4b7a[54]],filename:_0x38d1x1f[_0x4b7a[55]]}})};return _0x38d1xe[_0x4b7a[57]](_0x38d1x1e)})[_0x4b7a[46]](function(_0x38d1x1d){return _0x38d1x17[_0x4b7a[45]]({messageId:_0x38d1x1d[_0x4b7a[42]],status:_0x4b7a[43]},{transaction:_0x38d1x15?_0x38d1x15[_0x4b7a[44]]:null})})[_0x4b7a[41]](function(_0x38d1x1c){console[_0x4b7a[37]](_0x4b7a[36],_0x38d1x1c);throw {message:_0x38d1x1c[_0x4b7a[38]]||_0x38d1x1c[_0x4b7a[39]]||_0x4b7a[40]}})}else {return MailRoom[_0x4b7a[69]]({where:{id:_0x38d1x17[_0x4b7a[64]]},defaults:{subject:_0x38d1x17[_0x4b7a[49]],from:_0x38d1x17[_0x4b7a[33]][_0x4b7a[66]](_0x4b7a[65]),status:_0x4b7a[67],MailAccountId:_0x38d1xf[_0x4b7a[68]]},transaction:_0x38d1x15?_0x38d1x15[_0x4b7a[44]]:null})[_0x4b7a[63]](function(_0x38d1x21){_0x38d1x16=_0x38d1x21;return _0x38d1x16[_0x4b7a[59]](_0x38d1x17,{transaction:_0x38d1x15?_0x38d1x15[_0x4b7a[44]]:null})})[_0x4b7a[46]](function(){return _0x38d1x16[_0x4b7a[58]](_0x38d1x17.UserId,{transaction:_0x38d1x15?_0x38d1x15[_0x4b7a[44]]:null})})[_0x4b7a[46]](function(){var _0x38d1x1e={status:_0x38d1x17[_0x4b7a[31]],from:_0x38d1x17[_0x4b7a[33]],to:_0x38d1x17[_0x4b7a[47]],cc:_0x38d1x17[_0x4b7a[48]],subject:_0x38d1x17[_0x4b7a[49]],html:_0x38d1x17[_0x4b7a[50]],text:_0x38d1x17[_0x4b7a[50]]?htmlToText[_0x4b7a[51]](_0x38d1x17[_0x4b7a[50]],{wordwrap:false}):null,headers:{"\x58\x2D\x4C\x61\x7A\x69\x6E\x65\x73\x73\x2D\x6C\x65\x76\x65\x6C":1000}};if(_0x38d1x17[_0x4b7a[52]]){_0x38d1x1e[_0x4b7a[53]]=_[_0x4b7a[56]](_0x38d1x17.MailAttachments,function(_0x38d1x1f){return {path:_0x38d1x1f[_0x4b7a[54]],filename:_0x38d1x1f[_0x4b7a[55]]}})};return _0x38d1xe[_0x4b7a[57]](_0x38d1x1e)})[_0x4b7a[46]](function(_0x38d1x1d){console[_0x4b7a[16]](_0x4b7a[62],_0x38d1x1d);return _0x38d1x17[_0x4b7a[45]]({messageId:_0x38d1x1d[_0x4b7a[42]],status:_0x4b7a[43]},{transaction:_0x38d1x15?_0x38d1x15[_0x4b7a[44]]:null})})[_0x4b7a[41]](function(_0x38d1x1c){console[_0x4b7a[37]](_0x4b7a[36],_0x38d1x1c);throw {message:_0x38d1x1c[_0x4b7a[38]]||_0x38d1x1c[_0x4b7a[39]]||_0x4b7a[40]}})}}}_0x38d1x10(_0x38d1xd);MailServerOut[_0x4b7a[70]](function(_0x38d1xd){return _0x38d1x11(_0x38d1xd)});MailServerOut[_0x4b7a[71]](function(_0x38d1xd){return _0x38d1x12(_0x38d1xd)});MailMessage[_0x4b7a[72]](function(_0x38d1xd,_0x38d1x15){return _0x38d1x13(_0x38d1xd,_0x38d1x15)});return {}}module[_0x4b7a[73]]=Smtp
\ No newline at end of file
+var _0x7ecc=["\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\x6F\x6D\x65\x6E\x74","\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\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\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","\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","\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","\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","\x50\x45\x4E\x44\x49\x4E\x47","\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","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x63\x72\x65\x61\x74\x65"];_0x7ecc[0];var util=require(_0x7ecc[1]);var promise=require(_0x7ecc[2]);var _=require(_0x7ecc[3]);var moment=require(_0x7ecc[4]);var Mustache=require(_0x7ecc[5]);var nodemailer=require(_0x7ecc[6]);var smtpTransport=require(_0x7ecc[7]);var htmlToText=require(_0x7ecc[8]);var Agent=require(_0x7ecc[10])[_0x7ecc[9]];var Room=require(_0x7ecc[10])[_0x7ecc[11]];var Template=require(_0x7ecc[10])[_0x7ecc[12]];var Account=require(_0x7ecc[10])[_0x7ecc[13]];var Message=require(_0x7ecc[10])[_0x7ecc[14]];var Server=require(_0x7ecc[10])[_0x7ecc[15]];var Status=require(_0x7ecc[10])[_0x7ecc[16]];var Attachment=require(_0x7ecc[10])[_0x7ecc[17]];var smtp;var timeout;process[_0x7ecc[19]](_0x7ecc[25],function(_0x1b74x15){if(_0x1b74x15[_0x7ecc[26]]=== _0x7ecc[25]){onSend(_0x1b74x15)};if(_0x1b74x15[_0x7ecc[26]]=== _0x7ecc[27]){switch(_0x1b74x15[_0x7ecc[27]]){case _0x7ecc[29]:onVerify(_0x1b74x15[_0x7ecc[28]]);break;default:}}})[_0x7ecc[19]](_0x7ecc[20],function(_0x1b74x14){console[_0x7ecc[24]](util[_0x7ecc[23]](_0x7ecc[21],process[_0x7ecc[22]][3],_0x1b74x14))})[_0x7ecc[19]](_0x7ecc[18],function(_0x1b74x13){console[_0x7ecc[18]](_0x1b74x13)});console[_0x7ecc[24]](util[_0x7ecc[23]](_0x7ecc[30],process[_0x7ecc[22]][3],process[_0x7ecc[31]]));function onVerify(_0x1b74x17){smtp[_0x7ecc[40]]()[_0x7ecc[39]](function(){process[_0x7ecc[35]]({type:_0x7ecc[27],state:_0x7ecc[37],source:null,log:util[_0x7ecc[23]](_0x7ecc[38],_0x1b74x17,process[_0x7ecc[31]])})})[_0x7ecc[36]](function(_0x1b74x13){process[_0x7ecc[35]]({type:_0x7ecc[27],state:_0x7ecc[32],source:JSON[_0x7ecc[33]](_0x1b74x13),log:util[_0x7ecc[23]](_0x7ecc[34],_0x1b74x17,process[_0x7ecc[31]])})})}function onSave(_0x1b74x19){smtp= nodemailer[_0x7ecc[45]](smtpTransport({host:_0x1b74x19[_0x7ecc[41]],port:_0x1b74x19[_0x7ecc[42]],secure:_0x1b74x19[_0x7ecc[43]],pool:true,auth:{user:_0x1b74x19[_0x7ecc[28]],pass:_0x1b74x19[_0x7ecc[44]]}}));smtp[_0x7ecc[46]]= _0x1b74x19[_0x7ecc[47]];smtp[_0x7ecc[48]]= _0x1b74x19[_0x7ecc[49]];smtp[_0x7ecc[28]]= _0x1b74x19[_0x7ecc[28]];onVerify(_0x1b74x19[_0x7ecc[28]])}function onSend(_0x1b74x1b){console[_0x7ecc[24]](util[_0x7ecc[23]](_0x7ecc[50],process[_0x7ecc[22]][3],process[_0x7ecc[31]]));if(_0x1b74x1b[_0x7ecc[51]]=== _0x7ecc[52]){var _0x1b74x1c;var _0x1b74x1d;var _0x1b74x1e;var _0x1b74x1f=_0x1b74x1b;var _0x1b74x20,_0x1b74x21,_0x1b74x22,_0x1b74x23;if(_0x1b74x1f[_0x7ecc[53]]){return Message[_0x7ecc[85]]({where:{messageId:_0x1b74x1f[_0x7ecc[53]]}})[_0x7ecc[39]](function(_0x1b74x2b){return _0x1b74x2b[_0x7ecc[84]]({include:{model:Account,include:[{model:Template}]}})})[_0x7ecc[39]](function(_0x1b74x2a){_0x1b74x1c= _0x1b74x2a;_0x1b74x1d= _0x1b74x2a[_0x7ecc[13]];return _0x1b74x1c[_0x7ecc[83]](_0x1b74x1f[_0x7ecc[49]])})[_0x7ecc[39]](function(){return _0x1b74x1c[_0x7ecc[54]]({lastEvent:_0x7ecc[52],status:_0x7ecc[80],attachment:_0x1b74x1f[_0x7ecc[73]]&& _0x1b74x1f[_0x7ecc[73]][_0x7ecc[81]],mailOut:++_0x1b74x1c[_0x7ecc[82]]})})[_0x7ecc[39]](function(){return Agent[_0x7ecc[79]](_0x1b74x1f.UserId)})[_0x7ecc[39]](function(_0x1b74x29){_0x1b74x1e= _0x1b74x29;return _0x1b74x1c[_0x7ecc[78]](_0x1b74x1e)})[_0x7ecc[39]](function(){_0x1b74x1f[_0x7ecc[59]]= _0x1b74x1f[_0x7ecc[59]]?_0x1b74x1f[_0x7ecc[59]].toString(_0x7ecc[60]):null;_0x1b74x1f[_0x7ecc[61]]= _0x1b74x1f[_0x7ecc[61]]?_0x1b74x1f[_0x7ecc[61]].toString(_0x7ecc[60]):null;var _0x1b74x25=_0x1b74x1d[_0x7ecc[12]]?Mustache[_0x7ecc[71]](_0x1b74x1d[_0x7ecc[12]][_0x7ecc[59]],{interactionId:_0x1b74x1c[_0x7ecc[49]],subject:_0x1b74x1f[_0x7ecc[62]],body:_0x1b74x1f[_0x7ecc[59]]?_0x1b74x1f[_0x7ecc[59]]:_0x1b74x1f[_0x7ecc[61]],accountName:_0x1b74x1d[_0x7ecc[63]],from:_0x1b74x1f[_0x7ecc[64]],to:_0x1b74x1f[_0x7ecc[65]],cc:_0x1b74x1f[_0x7ecc[66]],bcc:_0x1b74x1f[_0x7ecc[67]],agentName:_0x1b74x1e[_0x7ecc[68]],agentEmail:_0x1b74x1e[_0x7ecc[69]],createdAt:_0x1b74x1f[_0x7ecc[70]]}):_0x1b74x1f[_0x7ecc[59]];var _0x1b74x26;if(_0x1b74x1f[_0x7ecc[61]]){_0x1b74x26= _0x1b74x1f[_0x7ecc[61]]}else {_0x1b74x26= _0x1b74x1f[_0x7ecc[59]]?htmlToText[_0x7ecc[72]](_0x1b74x1f[_0x7ecc[59]],{wordwrap:false}):null};var _0x1b74x27={status:_0x1b74x1f[_0x7ecc[51]],from:_0x1b74x1f[_0x7ecc[64]],to:_0x1b74x1f[_0x7ecc[65]],cc:_0x1b74x1f[_0x7ecc[66]],bcc:_0x1b74x1f[_0x7ecc[67]],subject:_0x1b74x1f[_0x7ecc[62]],html:_0x1b74x25,text:_0x1b74x26};if(_0x1b74x1f[_0x7ecc[73]]){_0x1b74x27[_0x7ecc[74]]= _[_0x7ecc[76]](_0x1b74x1f.MailAttachments,function(_0x1b74x28){return {path:_0x1b74x28[_0x7ecc[75]],filename:_0x1b74x28[_0x7ecc[63]]}})};return smtp[_0x7ecc[77]](_0x1b74x27)})[_0x7ecc[39]](function(_0x1b74x24){process[_0x7ecc[35]]({msgId:_0x1b74x1f[_0x7ecc[49]],roomId:_0x1b74x1c[_0x7ecc[49]],type:_0x7ecc[54],messageId:_0x1b74x24[_0x7ecc[57]],status:_0x7ecc[58],retry:_0x1b74x1f[_0x7ecc[56]]})})[_0x7ecc[36]](function(_0x1b74x13){console[_0x7ecc[18]](_0x1b74x13);process[_0x7ecc[35]]({msgId:_0x1b74x1f[_0x7ecc[49]],roomId:_0x1b74x1c[_0x7ecc[49]],type:_0x7ecc[54],status:_0x7ecc[55],retry:_0x1b74x1f[_0x7ecc[56]]})})}else {return Account[_0x7ecc[79]](smtp[_0x7ecc[46]],{include:[{model:Template}]})[_0x7ecc[39]](function(_0x1b74x2c){_0x1b74x1d= _0x1b74x2c;if(_0x1b74x1b[_0x7ecc[87]]){return Room[_0x7ecc[79]](_0x1b74x1b.MailRoomId)}else {return Agent[_0x7ecc[79]](_0x1b74x1b.UserId)[_0x7ecc[39]](function(_0x1b74x2d){return Room[_0x7ecc[89]]({subject:_0x1b74x1f[_0x7ecc[62]],from:_0x1b74x1f[_0x7ecc[64]],account:_0x1b74x2c?_0x1b74x2c[_0x7ecc[63]]:null,status:_0x7ecc[80],lastEvent:_0x7ecc[52],attachment:_0x1b74x1f[_0x7ecc[73]]&& _0x1b74x1f[_0x7ecc[73]][_0x7ecc[81]],MailAccountId:_0x1b74x2c?_0x1b74x2c[_0x7ecc[49]]:null,mailOut:1,arrivedAt:moment()[_0x7ecc[23]](_0x7ecc[88]),MailRoomStatuses:[{status:_0x7ecc[80],data1:_0x1b74x2d[_0x7ecc[63]],data2:_0x1b74x2d[_0x7ecc[68]],UserId:_0x1b74x2d[_0x7ecc[49]]}]},{include:[{model:Message},{model:Status}]})})}})[_0x7ecc[39]](function(_0x1b74x2a){_0x1b74x1c= _0x1b74x2a;return _0x1b74x1c[_0x7ecc[83]](_0x1b74x1f[_0x7ecc[49]])})[_0x7ecc[39]](function(){return Agent[_0x7ecc[79]](_0x1b74x1f.UserId)})[_0x7ecc[39]](function(_0x1b74x29){_0x1b74x1e= _0x1b74x29;return _0x1b74x1c[_0x7ecc[78]](_0x1b74x1e)})[_0x7ecc[39]](function(){_0x1b74x1f[_0x7ecc[59]]= _0x1b74x1f[_0x7ecc[59]]?_0x1b74x1f[_0x7ecc[59]].toString(_0x7ecc[60]):null;_0x1b74x1f[_0x7ecc[61]]= _0x1b74x1f[_0x7ecc[61]]?_0x1b74x1f[_0x7ecc[61]].toString(_0x7ecc[60]):null;var _0x1b74x25=_0x1b74x1d[_0x7ecc[12]]?Mustache[_0x7ecc[71]](_0x1b74x1d[_0x7ecc[12]][_0x7ecc[59]],{interactionId:_0x1b74x1c[_0x7ecc[49]],subject:_0x1b74x1f[_0x7ecc[62]],body:_0x1b74x1f[_0x7ecc[59]]?_0x1b74x1f[_0x7ecc[59]]:_0x1b74x1f[_0x7ecc[61]],accountName:_0x1b74x1d[_0x7ecc[63]],from:_0x1b74x1f[_0x7ecc[64]],to:_0x1b74x1f[_0x7ecc[65]],cc:_0x1b74x1f[_0x7ecc[66]],bcc:_0x1b74x1f[_0x7ecc[67]],agentName:_0x1b74x1e?_0x1b74x1e[_0x7ecc[68]]:_0x7ecc[86],agentEmail:_0x1b74x1e?_0x1b74x1e[_0x7ecc[69]]:_0x7ecc[86],createdAt:_0x1b74x1f[_0x7ecc[70]]}):_0x1b74x1f[_0x7ecc[59]];var _0x1b74x26;if(_0x1b74x1f[_0x7ecc[61]]){_0x1b74x26= _0x1b74x1f[_0x7ecc[61]]}else {_0x1b74x26= _0x1b74x1f[_0x7ecc[59]]?htmlToText[_0x7ecc[72]](_0x1b74x1f[_0x7ecc[59]],{wordwrap:false}):null};var _0x1b74x27={status:_0x1b74x1f[_0x7ecc[51]],from:_0x1b74x1f[_0x7ecc[64]],to:_0x1b74x1f[_0x7ecc[65]],cc:_0x1b74x1f[_0x7ecc[66]],bcc:_0x1b74x1f[_0x7ecc[67]],subject:_0x1b74x1f[_0x7ecc[62]],html:_0x1b74x25,text:_0x1b74x26};if(_0x1b74x1f[_0x7ecc[73]]){_0x1b74x27[_0x7ecc[74]]= _[_0x7ecc[76]](_0x1b74x1f.MailAttachments,function(_0x1b74x28){return {path:_0x1b74x28[_0x7ecc[75]],filename:_0x1b74x28[_0x7ecc[63]]}})};return smtp[_0x7ecc[77]](_0x1b74x27)})[_0x7ecc[39]](function(_0x1b74x24){process[_0x7ecc[35]]({msgId:_0x1b74x1f[_0x7ecc[49]],roomId:_0x1b74x1c[_0x7ecc[49]],type:_0x7ecc[54],messageId:_0x1b74x24[_0x7ecc[57]],status:_0x7ecc[58],retry:_0x1b74x1f[_0x7ecc[56]]})})[_0x7ecc[36]](function(_0x1b74x13){console[_0x7ecc[18]](_0x1b74x13);process[_0x7ecc[35]]({msgId:_0x1b74x1f[_0x7ecc[49]],roomId:_0x1b74x1c[_0x7ecc[49]],type:_0x7ecc[54],status:_0x7ecc[55],retry:_0x1b74x1f[_0x7ecc[56]]})})}}}Server[_0x7ecc[79]](process[_0x7ecc[22]][2])[_0x7ecc[39]](function(_0x1b74x19){onSave(_0x1b74x19)})[_0x7ecc[36]](function(_0x1b74x13){console[_0x7ecc[18]](_0x1b74x13)})
\ No newline at end of file