Built motion from commit 87550112c.|1.0.22
[motion.git] / server / config / triggers / mail.js
1 var _0xa25c=["\x6C\x6F\x64\x61\x73\x68","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x6D\x75\x73\x74\x61\x63\x68\x65","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x54\x65\x6D\x70\x6C\x61\x74\x65","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x54\x72\x69\x67\x67\x65\x72\x20\x4D\x61\x69\x6C\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x69\x6E\x66\x6F","\x74\x61\x67","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x4D\x61\x69\x6C\x20\x74\x72\x69\x67\x67\x65\x72\x20\x74\x61\x67\x20\x65\x72\x72\x6F\x72","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x3B","\x73\x70\x6C\x69\x74","\x64\x61\x74\x61\x31","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x75\x70\x64\x61\x74\x65","\x65\x6D\x61\x69\x6C","\x4D\x61\x69\x6C\x20\x74\x72\x69\x67\x67\x65\x72\x20\x73\x65\x6E\x64\x20\x6D\x61\x69\x6C\x20\x65\x72\x72\x6F\x72","\x64\x61\x74\x61\x33","\x73\x75\x62\x6A\x65\x63\x74","\x62\x6F\x64\x79","\x64\x61\x74\x61\x34","\x68\x74\x6D\x6C","\x74\x65\x78\x74","\x72\x65\x6E\x64\x65\x72","\x3C\x62\x72\x3E","\x72\x65\x70\x6C\x61\x63\x65","\x26\x23\x30\x33\x39\x3B","\x26\x71\x75\x6F\x74\x3B","\x26\x67\x74\x3B","\x26\x6C\x74\x3B","\x26\x61\x6D\x70\x3B","\x61\x64\x64\x72\x65\x73\x73","\x64\x61\x74\x61\x32","\x53\x45\x4E\x44\x49\x4E\x47","\x69\x64","\x6E\x61\x6D\x65","\x63\x72\x65\x61\x74\x65\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x73\x65\x6E\x64","\x74\x68\x65\x6E","\x64\x61\x74\x61\x35","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x63\x63\x6F\x75\x6E\x74\x49\x64","\x61\x63\x63\x6F\x75\x6E\x74\x45\x6D\x61\x69\x6C","\x4D\x61\x69\x6C\x20\x74\x72\x69\x67\x67\x65\x72\x20\x73\x65\x6E\x64\x20\x6D\x61\x69\x6C\x20\x62\x79\x20\x61\x63\x63\x6F\x75\x6E\x74\x20\x65\x72\x72\x6F\x72","\x64\x61\x74\x61\x36","\x66\x6F\x72\x77\x61\x72\x64","\x4D\x61\x69\x6C\x20\x74\x72\x69\x67\x67\x65\x72\x20\x66\x6F\x72\x77\x61\x72\x64\x20\x65\x72\x72\x6F\x72","\x66\x72\x6F\x6D\x49\x64","\x74\x65\x6D\x70\x6C\x61\x74\x65","\x4D\x61\x69\x6C\x20\x74\x72\x69\x67\x67\x65\x72\x20\x73\x65\x6E\x64\x20\x65\x6D\x61\x69\x6C\x20\x77\x69\x74\x68\x20\x74\x65\x6D\x70\x6C\x61\x74\x65\x20\x65\x72\x72\x6F\x72","\x61\x63\x63\x6F\x75\x6E\x74\x54\x65\x6D\x70\x6C\x61\x74\x65","\x4D\x61\x69\x6C\x20\x74\x72\x69\x67\x67\x65\x72\x20\x73\x65\x6E\x64\x20\x65\x6D\x61\x69\x6C\x20\x77\x69\x74\x68\x20\x74\x65\x6D\x70\x6C\x61\x74\x65\x20\x62\x79\x20\x61\x63\x63\x6F\x75\x6E\x74\x20\x65\x72\x72\x6F\x72","\x63\x6C\x6F\x73\x65","\x4D\x61\x69\x6C\x20\x74\x72\x69\x67\x67\x65\x72\x20\x63\x6C\x6F\x73\x65\x20\x65\x72\x72\x6F\x72","\x43\x4C\x4F\x53\x45\x44","\x65\x78\x70\x6F\x72\x74\x73"];const _=require(_0xa25c[0]);const rp=require(_0xa25c[1]);const Mustache=require(_0xa25c[2]);var logger=require(_0xa25c[4])(_0xa25c[3]);const MailRoom=require(_0xa25c[6])[_0xa25c[5]];const Template=require(_0xa25c[6])[_0xa25c[7]];const MailMessage=require(_0xa25c[6])[_0xa25c[8]];const MailAccount=require(_0xa25c[6])[_0xa25c[9]];const MailServerOut=require(_0xa25c[6])[_0xa25c[10]];function Mail(){logger[_0xa25c[12]](_0xa25c[11])}Mail[_0xa25c[14]][_0xa25c[13]]= function(_0xc300xb,_0xc300xc,_0xc300xd,_0xc300xe){return MailRoom[_0xa25c[23]]({tags:_0xc300xb[_0xa25c[21]][_0xa25c[20]](_0xa25c[19])},{where:{id:_0xc300xc[_0xa25c[22]]}})[_0xa25c[18]](function(_0xc300xf){logger[_0xa25c[17]](_0xa25c[15],_0xc300xf[_0xa25c[16]])})};Mail[_0xa25c[14]][_0xa25c[24]]= function(_0xc300xb,_0xc300xc){var _0xc300x10;return MailAccount[_0xa25c[49]](_0xc300xc[_0xa25c[50]])[_0xa25c[47]](function(_0xc300x14){_0xc300x10= _0xc300x14;if(_0xc300xb[_0xa25c[48]]){return Template[_0xa25c[49]](_0xc300xb[_0xa25c[48]])}})[_0xa25c[47]](function(_0xc300x11){var _0xc300x12;if(_0xc300x11){_0xc300xb[_0xa25c[26]]= _0xc300x11[_0xa25c[27]];_0xc300xc[_0xa25c[28]]= _0xc300xb[_0xa25c[29]]|| _0xc300xc[_0xa25c[30]]|| _0xc300xc[_0xa25c[31]]|| _0xc300xc[_0xa25c[28]];_0xc300x12= _0xc300x11[_0xa25c[30]]?Mustache[_0xa25c[32]](_0xc300x11[_0xa25c[30]],_0xc300xc):null}else {_0xc300x12= _0xc300xb[_0xa25c[29]]?Mustache[_0xa25c[32]](_0xc300xb[_0xa25c[29]],_0xc300xc)[_0xa25c[34]](/&/g,_0xa25c[39])[_0xa25c[34]](/</g,_0xa25c[38])[_0xa25c[34]](/>/g,_0xa25c[37])[_0xa25c[34]](/"/g,_0xa25c[36])[_0xa25c[34]](/'/g,_0xa25c[35])[_0xa25c[34]](/\n/g,_0xa25c[33]):null};var _0xc300x13={subject:_0xc300xb[_0xa25c[26]]|| null,from:[_0xc300x10[_0xa25c[40]]],to:_0xc300xb[_0xa25c[21]][_0xa25c[20]](_0xa25c[19]),cc:_0xc300xb[_0xa25c[41]]?_0xc300xb[_0xa25c[41]][_0xa25c[20]](_0xa25c[19]):[],html:_0xc300x12,status:_0xa25c[42],auto:true,accountId:_0xc300x10[_0xa25c[43]],accountName:_0xc300x10[_0xa25c[44]]};process[_0xa25c[46]]({message:_0xa25c[45],doc:_0xc300x13})})[_0xa25c[18]](function(_0xc300xf){logger[_0xa25c[17]](_0xa25c[25],_0xc300xf[_0xa25c[16]])})};Mail[_0xa25c[14]][_0xa25c[51]]= function(_0xc300xb,_0xc300xc){var _0xc300x10;return MailAccount[_0xa25c[49]](_0xc300xb[_0xa25c[21]])[_0xa25c[47]](function(_0xc300x14){_0xc300x10= _0xc300x14;if(_0xc300xb[_0xa25c[53]]){return Template[_0xa25c[49]](_0xc300xb[_0xa25c[53]])}})[_0xa25c[47]](function(_0xc300x11){var _0xc300x12;if(_0xc300x11){_0xc300xb[_0xa25c[29]]= _0xc300x11[_0xa25c[27]];_0xc300xc[_0xa25c[28]]= _0xc300xb[_0xa25c[48]]|| _0xc300xc[_0xa25c[30]]|| _0xc300xc[_0xa25c[31]]|| _0xc300xc[_0xa25c[28]];_0xc300x12= _0xc300x11[_0xa25c[30]]?Mustache[_0xa25c[32]](_0xc300x11[_0xa25c[30]],_0xc300xc):null}else {_0xc300x12= _0xc300xb[_0xa25c[48]]?Mustache[_0xa25c[32]](_0xc300xb[_0xa25c[48]],_0xc300xc)[_0xa25c[34]](/&/g,_0xa25c[39])[_0xa25c[34]](/</g,_0xa25c[38])[_0xa25c[34]](/>/g,_0xa25c[37])[_0xa25c[34]](/"/g,_0xa25c[36])[_0xa25c[34]](/'/g,_0xa25c[35])[_0xa25c[34]](/\n/g,_0xa25c[33]):null};var _0xc300x13={subject:_0xc300xb[_0xa25c[29]]|| null,from:[_0xc300x10[_0xa25c[40]]],to:_0xc300xb[_0xa25c[41]][_0xa25c[20]](_0xa25c[19]),cc:_0xc300xb[_0xa25c[26]]?_0xc300xb[_0xa25c[26]][_0xa25c[20]](_0xa25c[19]):[],html:_0xc300x12,status:_0xa25c[42],auto:true,accountId:_0xc300x10[_0xa25c[43]],accountName:_0xc300x10[_0xa25c[44]]};process[_0xa25c[46]]({message:_0xa25c[45],doc:_0xc300x13})})[_0xa25c[18]](function(_0xc300xf){logger[_0xa25c[17]](_0xa25c[52],_0xc300xf[_0xa25c[16]])})};Mail[_0xa25c[14]][_0xa25c[54]]= function(_0xc300xb,_0xc300xc){return MailAccount[_0xa25c[49]](_0xc300xc[_0xa25c[50]])[_0xa25c[47]](function(_0xc300x14){var _0xc300x13={subject:_0xc300xc[_0xa25c[27]]|| null,from:[_0xc300x14[_0xa25c[40]]],fromId:_0xc300xc[_0xa25c[56]],to:_0xc300xb[_0xa25c[21]][_0xa25c[20]](_0xa25c[19]),text:_0xc300xc[_0xa25c[31]][_0xa25c[34]](/&/g,_0xa25c[39])[_0xa25c[34]](/</g,_0xa25c[38])[_0xa25c[34]](/>/g,_0xa25c[37])[_0xa25c[34]](/"/g,_0xa25c[36])[_0xa25c[34]](/'/g,_0xa25c[35])[_0xa25c[34]](/\n/g,_0xa25c[33]),html:_0xc300xc[_0xa25c[30]]|| _0xc300xc[_0xa25c[31]],status:_0xa25c[42],auto:true,accountId:_0xc300x14[_0xa25c[43]],accountName:_0xc300x14[_0xa25c[44]]};process[_0xa25c[46]]({message:_0xa25c[45],doc:_0xc300x13})})[_0xa25c[18]](function(_0xc300xf){logger[_0xa25c[17]](_0xa25c[55],_0xc300xf[_0xa25c[16]])})};Mail[_0xa25c[14]][_0xa25c[57]]= function(_0xc300xb,_0xc300xc){var _0xc300x10;return MailAccount[_0xa25c[49]](_0xc300xc[_0xa25c[50]])[_0xa25c[47]](function(_0xc300x14){_0xc300x10= _0xc300x14;return Template[_0xa25c[49]](_0xc300xb[_0xa25c[21]])})[_0xa25c[47]](function(_0xc300x11){_0xc300xc[_0xa25c[28]]= _0xc300xc[_0xa25c[30]]|| _0xc300xc[_0xa25c[31]]|| _0xc300xc[_0xa25c[28]];var _0xc300x13={status:_0xa25c[42],subject:_0xc300x11[_0xa25c[27]],from:[_0xc300x10[_0xa25c[40]]],to:_0xc300xb[_0xa25c[41]][_0xa25c[20]](_0xa25c[19]),html:_0xc300x11[_0xa25c[30]]?Mustache[_0xa25c[32]](_0xc300x11[_0xa25c[30]],_0xc300xc):null,auto:true,accountId:_0xc300x10[_0xa25c[43]],accountName:_0xc300x10[_0xa25c[44]]};process[_0xa25c[46]]({message:_0xa25c[45],doc:_0xc300x13})})[_0xa25c[18]](function(_0xc300xf){logger[_0xa25c[17]](_0xa25c[58],_0xc300xf[_0xa25c[16]])})};Mail[_0xa25c[14]][_0xa25c[59]]= function(_0xc300xb,_0xc300xc){var _0xc300x10;return MailAccount[_0xa25c[49]](_0xc300xb[_0xa25c[21]])[_0xa25c[47]](function(_0xc300x14){_0xc300x10= _0xc300x14;return Template[_0xa25c[49]](_0xc300xb[_0xa25c[41]])})[_0xa25c[47]](function(_0xc300x11){_0xc300xc[_0xa25c[28]]= _0xc300xc[_0xa25c[30]]|| _0xc300xc[_0xa25c[31]]|| _0xc300xc[_0xa25c[28]];var _0xc300x13={status:_0xa25c[42],subject:_0xc300x11[_0xa25c[27]],from:[_0xc300x10[_0xa25c[40]]],to:_0xc300xb[_0xa25c[26]][_0xa25c[20]](_0xa25c[19]),html:_0xc300x11[_0xa25c[30]]?Mustache[_0xa25c[32]](_0xc300x11[_0xa25c[30]],_0xc300xc):null,auto:true,accountId:_0xc300x10[_0xa25c[43]],accountName:_0xc300x10[_0xa25c[44]]};process[_0xa25c[46]]({message:_0xa25c[45],doc:_0xc300x13})})[_0xa25c[18]](function(_0xc300xf){logger[_0xa25c[17]](_0xa25c[60],_0xc300xf[_0xa25c[16]])})};Mail[_0xa25c[14]][_0xa25c[61]]= function(_0xc300xb,_0xc300xc){return MailRoom[_0xa25c[23]]({status:_0xa25c[63],disposition:_0xc300xb[_0xa25c[21]]|| null},{individualHooks:true,where:{id:_0xc300xc[_0xa25c[22]]}})[_0xa25c[18]](function(_0xc300xf){logger[_0xa25c[17]](_0xa25c[62],_0xc300xf[_0xa25c[16]])})};module[_0xa25c[64]]= Mail