Built motion from commit (unavailable).|2.3.8
[motion2.git] / server / services / email / server / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x3fce=['127.0.0.1','log','RPC\x20listening\x20on\x20port:','bluebird','lodash','../../../config/logger','email','listen','sendMail','message','catch','error','verifySmtp','account','Verified','values','length','Imap','password','Smtp','pass','http'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0x3fce,0x121));var _0xe3fc=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0x3fce[_0x119d25];return _0x39cf30;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe3fc('0x0'));var _=require(_0xe3fc('0x1'));var logger=require(_0xe3fc('0x2'))(_0xe3fc('0x3'));exports[_0xe3fc('0x4')]=function(_0xa57101,_0x2ee15c){return new BPromise(function(_0x534cbf,_0x5d01f5){var _0x582794={'SendMail':function(_0x53556d){var _0x36eff8=this;return new Promise(function(_0x2dc84d,_0x523982){_0x2ee15c[_0xe3fc('0x5')](_0x53556d['account'],_0x53556d[_0xe3fc('0x6')])['then'](function(_0xeada2b){_0x2dc84d({'code':0xc8,'message':_0xeada2b});})[_0xe3fc('0x7')](function(_0x1bb7be){_0x523982(_0x36eff8[_0xe3fc('0x8')](0x1f4,_0x1bb7be));});});},'VerifySmtp':function(_0x182656){var _0x523257=this;return new Promise(function(_0x52b9ee,_0x339045){_0x2ee15c[_0xe3fc('0x9')](_0x182656[_0xe3fc('0xa')])['then'](function(_0x2cef5d){_0x52b9ee({'code':0xc8,'message':_0xe3fc('0xb')});})[_0xe3fc('0x7')](function(_0x317490){_0x339045(_0x523257[_0xe3fc('0x8')](0x1f4,_0x317490));});});},'MailAccounts':function(_0x1e3443){return new Promise(function(_0x2eb16e,_0x4ae1df){var _0x413344=_[_0xe3fc('0xc')](_0xa57101['mailAccounts']);for(var _0x3f7ae2=0x0;_0x3f7ae2<_0x413344[_0xe3fc('0xd')];_0x3f7ae2+=0x1){if(_0x413344[_0x3f7ae2]['Imap']&&_0x413344[_0x3f7ae2][_0xe3fc('0xe')][_0xe3fc('0xf')]){delete _0x413344[_0x3f7ae2]['Imap']['password'];}if(_0x413344[_0x3f7ae2]['Smtp']&&_0x413344[_0x3f7ae2][_0xe3fc('0x10')][_0xe3fc('0x11')]){delete _0x413344[_0x3f7ae2][_0xe3fc('0x10')]['pass'];}}_0x2eb16e({'count':_0x413344['length'],'rows':_0x413344});});}};var _0x354695=jayson['server'](_0x582794)[_0xe3fc('0x12')]();_0x354695['on'](_0xe3fc('0x8'),function(_0xfefb77){logger['error'](JSON['stringify'](_0xfefb77));return _0x5d01f5(_0xfefb77);});_0x354695[_0xe3fc('0x4')](0x232b,_0xe3fc('0x13'),function(){console[_0xe3fc('0x14')]('Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232b);return _0x534cbf(_0xe3fc('0x15')+0x232b);});});};