Built motion from commit (unavailable).|2.4.4
[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 _0x9d5b=['pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','bluebird','lodash','../../../config/logger','email','listen','sendMail','account','then','catch','verifySmtp','Verified','error','values','length','Imap','password','Smtp'];(function(_0xacdc6f,_0x52afdf){var _0x23c945=function(_0x481991){while(--_0x481991){_0xacdc6f['push'](_0xacdc6f['shift']());}};_0x23c945(++_0x52afdf);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x425a0b,_0xaf6b6d){_0x425a0b=_0x425a0b-0x0;var _0x2b9f54=_0x9d5b[_0x425a0b];return _0x2b9f54;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb9d5('0x0'));var _=require(_0xb9d5('0x1'));var logger=require(_0xb9d5('0x2'))(_0xb9d5('0x3'));exports[_0xb9d5('0x4')]=function(_0x53b719,_0x6871c3){return new BPromise(function(_0x54423a,_0x36b546){var _0xbf85ca={'SendMail':function(_0x71dbea){var _0x39d8fe=this;return new Promise(function(_0x422a92,_0x5144c7){_0x6871c3[_0xb9d5('0x5')](_0x71dbea[_0xb9d5('0x6')],_0x71dbea['message'])[_0xb9d5('0x7')](function(_0xb1f318){_0x422a92({'code':0xc8,'message':_0xb1f318});})[_0xb9d5('0x8')](function(_0x94e766){_0x5144c7(_0x39d8fe['error'](0x1f4,_0x94e766));});});},'VerifySmtp':function(_0x1aec1b){var _0x1ae073=this;return new Promise(function(_0x4c1ce3,_0x35d69f){_0x6871c3[_0xb9d5('0x9')](_0x1aec1b[_0xb9d5('0x6')])[_0xb9d5('0x7')](function(_0x5f79c8){_0x4c1ce3({'code':0xc8,'message':_0xb9d5('0xa')});})[_0xb9d5('0x8')](function(_0x447cb7){_0x35d69f(_0x1ae073[_0xb9d5('0xb')](0x1f4,_0x447cb7));});});},'MailAccounts':function(_0x3d7910){return new Promise(function(_0x467b78,_0x5047d6){var _0x3bb168=_[_0xb9d5('0xc')](_0x53b719['mailAccounts']);for(var _0xf7e03c=0x0;_0xf7e03c<_0x3bb168[_0xb9d5('0xd')];_0xf7e03c+=0x1){if(_0x3bb168[_0xf7e03c][_0xb9d5('0xe')]&&_0x3bb168[_0xf7e03c]['Imap'][_0xb9d5('0xf')]){delete _0x3bb168[_0xf7e03c][_0xb9d5('0xe')][_0xb9d5('0xf')];}if(_0x3bb168[_0xf7e03c][_0xb9d5('0x10')]&&_0x3bb168[_0xf7e03c][_0xb9d5('0x10')][_0xb9d5('0x11')]){delete _0x3bb168[_0xf7e03c][_0xb9d5('0x10')][_0xb9d5('0x11')];}}_0x467b78({'count':_0x3bb168[_0xb9d5('0xd')],'rows':_0x3bb168});});}};var _0x436002=jayson[_0xb9d5('0x12')](_0xbf85ca)[_0xb9d5('0x13')]();_0x436002['on'](_0xb9d5('0xb'),function(_0x171487){logger['error'](JSON[_0xb9d5('0x14')](_0x171487));return _0x36b546(_0x171487);});_0x436002[_0xb9d5('0x4')](0x232b,_0xb9d5('0x15'),function(){console[_0xb9d5('0x16')](_0xb9d5('0x17'),0x232b);return _0x54423a(_0xb9d5('0x18')+0x232b);});});};