Built motion from commit e0fa946e.|2.6.5
[motion2.git] / server / services / email / lib / utils.js
index 03dae0e..d14784d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf14c=['textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','attachments','type','attachment-','%s-%s','now','server/files/attachments/','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','substring','indexOf','split','length','join','Anonymous','pop','isEmpty','generate','html','test','replace','includes','<img','push','filename','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body'];(function(_0x644ecd,_0x397f36){var _0x1c66ce=function(_0x4cf42b){while(--_0x4cf42b){_0x644ecd['push'](_0x644ecd['shift']());}};_0x1c66ce(++_0x397f36);}(_0xf14c,0x105));var _0xcf14=function(_0x4e85dc,_0x403b4e){_0x4e85dc=_0x4e85dc-0x0;var _0x298723=_0xf14c[_0x4e85dc];return _0x298723;};'use strict';var _=require(_0xcf14('0x0'));var moment=require(_0xcf14('0x1'));var random=require(_0xcf14('0x2'));var fs=require('fs');var path=require(_0xcf14('0x3'));var util=require(_0xcf14('0x4'));var tnef=require(_0xcf14('0x5'));var logger=require(_0xcf14('0x6'))(_0xcf14('0x7'));var config=require(_0xcf14('0x8'));function getAddress(_0x459c90){var _0x23321f=_[_0xcf14('0x9')](_0x459c90[_0xcf14('0xa')]);return _0x23321f&&_0x23321f[_0xcf14('0xb')]?_0x23321f['address']:_0xcf14('0xc')+random['generate'](0x6)+_0xcf14('0xd');}function getFirstName(_0x4a5cbe){var _0x5e86fb=_[_0xcf14('0x9')](_0x4a5cbe[_0xcf14('0xa')]);if(_0x5e86fb&&_0x5e86fb[_0xcf14('0xe')]){if(_0x5e86fb[_0xcf14('0xe')]==_0x5e86fb[_0xcf14('0xb')]){return _0x5e86fb[_0xcf14('0xe')][_0xcf14('0xf')](0x0,_0x5e86fb[_0xcf14('0xe')][_0xcf14('0x10')]('@'));}var _0x368e99=_0x5e86fb[_0xcf14('0xe')][_0xcf14('0x11')](/\s+/);return _0x368e99[_0xcf14('0x12')]>0x1?_0x368e99['slice'](0x0,-0x1)[_0xcf14('0x13')]('\x20'):_0x5e86fb[_0xcf14('0xe')];}return _0xcf14('0x14');}function getLastName(_0x13df4d){var _0xbcc544=_[_0xcf14('0x9')](_0x13df4d[_0xcf14('0xa')]);if(_0xbcc544&&_0xbcc544[_0xcf14('0xe')]){var _0x43b5ec=_0xbcc544[_0xcf14('0xe')]['split'](/\s+/);return _0x43b5ec['length']>0x1?_0x43b5ec[_0xcf14('0x15')]():'';}return'';}function getMails(_0x5a759a,_0x2e547d){var _0x53d252='';for(var _0x42f670=0x0;_0x42f670<_0x2e547d['value'][_0xcf14('0x12')];_0x42f670+=0x1){if(_0x2e547d[_0xcf14('0xa')][_0x42f670][_0xcf14('0xb')]!==_0x5a759a){if(!_[_0xcf14('0x16')](_0x53d252)){_0x53d252+=',';}_0x53d252+=_0x2e547d[_0xcf14('0xa')][_0x42f670][_0xcf14('0xe')]||_0x2e547d[_0xcf14('0xa')][_0x42f670][_0xcf14('0xb')]||'';_0x53d252+='\x20<';_0x53d252+=_0x2e547d[_0xcf14('0xa')][_0x42f670][_0xcf14('0xb')]?_0x2e547d[_0xcf14('0xa')][_0x42f670][_0xcf14('0xb')]:_0xcf14('0xc')+random[_0xcf14('0x17')](0x6)+'@xcally.com';_0x53d252+='>';}}return _0x53d252;}function parseEmail(_0x5890e0,_0x4c42a5,_0x21fc0c){if(_0x4c42a5[_0xcf14('0x18')]){var _0x38d6ae=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x38d6ae[_0xcf14('0x19')](_0x4c42a5[_0xcf14('0x18')])){_0x4c42a5[_0xcf14('0x18')]=_0x4c42a5[_0xcf14('0x18')][_0xcf14('0x1a')](_0x38d6ae,'');}if(_0x4c42a5[_0xcf14('0x18')][_0xcf14('0x1b')](_0xcf14('0x1c'))){var _0x4f000c=[];_0x4c42a5['attachments']['forEach'](_0x491d25=>{_0x4f000c[_0xcf14('0x1d')](_0x491d25[_0xcf14('0x1e')]);});var _0x542a25=/<img.*? _SRC(.*?)[^>]+>/g;var _0x244ea5=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5b6050=_0x4c42a5['html'][_0xcf14('0x1a')](_0x244ea5,'_SRC');var _0x172d33=_0x5b6050['replace'](_0x542a25,_0xcf14('0x1f'));for(let _0x3e5f0e=0x0;_0x3e5f0e<_0x4f000c[_0xcf14('0x12')];_0x3e5f0e++){var _0x48f003=_0x172d33['replace'](_0xcf14('0x1f'),_0xcf14('0x20')+_0x4f000c[_0x3e5f0e]+_0xcf14('0x21'));_0x172d33=_0x48f003;}_0x4c42a5[_0xcf14('0x18')]=_0x172d33;}_0x21fc0c[_0xcf14('0x22')]=_0x4c42a5[_0xcf14('0x18')];}else{_0x21fc0c[_0xcf14('0x22')]=_0x4c42a5[_0xcf14('0x23')];}if(_0x21fc0c['body']){_0x21fc0c[_0xcf14('0x22')]=_0x21fc0c[_0xcf14('0x22')][_0xcf14('0x1a')](/<a\s+/gi,_0xcf14('0x24'));}if(_0x4c42a5['to']){_0x21fc0c[_0xcf14('0x25')][_0xcf14('0x26')]=getMails(null,_0x4c42a5['to']);var _0x30f50a=getMails(_0x5890e0['email'],_0x4c42a5['to']);if(!_[_0xcf14('0x16')](_0x30f50a)){_0x21fc0c[_0xcf14('0x25')]['cc']+=_0x30f50a;}}if(_0x4c42a5['cc']){_0x21fc0c['message'][_0xcf14('0x27')]=getMails(null,_0x4c42a5['cc']);var _0x467577=getMails(_0x5890e0[_0xcf14('0x7')],_0x4c42a5['cc']);if(!_['isEmpty'](_0x467577)){if(!_[_0xcf14('0x16')](_0x21fc0c[_0xcf14('0x25')]['cc'])){_0x21fc0c[_0xcf14('0x25')]['cc']+=',';}_0x21fc0c[_0xcf14('0x25')]['cc']+=_0x467577;}}if(!_[_0xcf14('0x1b')](_0x21fc0c['message'][_0xcf14('0x26')],_0x5890e0[_0xcf14('0x7')])&&!_['includes'](_0x21fc0c[_0xcf14('0x25')]['originCc'],_0x5890e0['email'])){_0x21fc0c['message']['bcc']=_0x5890e0[_0xcf14('0x7')];}if(_0x4c42a5['attachments']&&_0x4c42a5[_0xcf14('0x28')][_0xcf14('0x12')]){_0x21fc0c['message']['attach']=_0x4c42a5[_0xcf14('0x28')][_0xcf14('0x12')];for(var _0x3ca7dc=0x0,_0x3d6d8e,_0x249b18,_0x3d1a21;_0x3ca7dc<_0x4c42a5[_0xcf14('0x28')][_0xcf14('0x12')];_0x3ca7dc+=0x1){if(_0x4c42a5[_0xcf14('0x28')][_0x3ca7dc][_0xcf14('0x29')]==='attachment'){_0x3d1a21=_0x4c42a5[_0xcf14('0x28')][_0x3ca7dc][_0xcf14('0x1e')]||_0xcf14('0x2a')+_0x3ca7dc;_0x3d6d8e=util['format'](_0xcf14('0x2b'),Date[_0xcf14('0x2c')](),_0x3d1a21);_0x249b18=path[_0xcf14('0x13')](config['root'],_0xcf14('0x2d'),_0x3d6d8e);fs['writeFileSync'](_0x249b18,_0x4c42a5[_0xcf14('0x28')][_0x3ca7dc][_0xcf14('0x2e')]);_0x21fc0c['message'][_0xcf14('0x28')][_0xcf14('0x1d')]({'name':_0x3d1a21,'basename':_0x3d6d8e,'type':_0x4c42a5['attachments'][_0x3ca7dc][_0xcf14('0x2f')],'filepath':_0x249b18});}}}if(_0x4c42a5['headerLines']&&_0x4c42a5[_0xcf14('0x30')][_0xcf14('0x12')]>0x0){var _0x1101ac=[_0xcf14('0x31'),_0xcf14('0x32'),'Precedence:\x20auto_reply'];for(var _0x540833=0x0;_0x540833<_0x4c42a5[_0xcf14('0x30')]['length'];_0x540833++){var _0x20b8f6=_[_0xcf14('0x10')](_0x1101ac,_0x4c42a5[_0xcf14('0x30')][_0x540833][_0xcf14('0x33')]);if(_0x20b8f6>=0x0){_0x21fc0c[_0xcf14('0x34')]=!![];}}}return _0x21fc0c;}exports[_0xcf14('0x35')]=function(_0x326ebc,_0x41db61,_0x4ad067){var _0xcec8cb={'from':getAddress(_0x41db61[_0xcf14('0x36')]),'firstName':getFirstName(_0x41db61[_0xcf14('0x36')]),'lastName':getLastName(_0x41db61['from']),'mapKey':'email','message':{'from':getMails(_0x326ebc[_0xcf14('0x7')],_0x41db61[_0xcf14('0x36')]),'to':_0x326ebc['email'],'cc':'','subject':_0x41db61[_0xcf14('0x37')]||'','messageId':_0x41db61[_0xcf14('0x38')],'inReplyTo':_0x41db61[_0xcf14('0x39')],'sentAt':moment(_0x41db61[_0xcf14('0x3a')])[_0xcf14('0x3b')](_0xcf14('0x3c')),'attach':![],'attachments':[]}};if(!_0x41db61['html']&&!_0x41db61[_0xcf14('0x23')]){var _0x21acc9=_[_0xcf14('0x3d')](_0x41db61[_0xcf14('0x28')],{'contentType':'application/ms-tnef'});if(_0x21acc9[_0xcf14('0x12')]){logger['info'](util[_0xcf14('0x3b')](_0xcf14('0x3e'),_0x41db61[_0xcf14('0x38')]));tnef['parseBuffer'](_[_0xcf14('0x3f')](_0x21acc9)[_0xcf14('0x2e')],function(_0x13ea75,_0x5d075a){if(_0x5d075a){_0x41db61['html']=_0x5d075a[_0xcf14('0x40')]||_0xcf14('0x41');if(_0x5d075a[_0xcf14('0x42')]){for(var _0x5c544b=0x0;_0x5c544b<_0x5d075a[_0xcf14('0x42')][_0xcf14('0x12')];_0x5c544b++){var _0x1b1fed=_0x5d075a[_0xcf14('0x42')][_0x5c544b];_0xcec8cb[_0xcf14('0x25')][_0xcf14('0x28')]['push']({'filename':_0x1b1fed[_0xcf14('0x43')],'content':Buffer[_0xcf14('0x36')](_0x1b1fed[_0xcf14('0x44')])});}}}_0x4ad067(parseEmail(_0x326ebc,_0x41db61,_0xcec8cb));});}else{_0x41db61[_0xcf14('0x18')]=_0xcf14('0x41');_0x4ad067(parseEmail(_0x326ebc,_0x41db61,_0xcec8cb));}}else{_0x4ad067(parseEmail(_0x326ebc,_0x41db61,_0xcec8cb));}};exports[_0xcf14('0x45')]=function(_0x487174,_0x5e5194){var _0x2504ad=[_0xcf14('0x46')+(_0x5e5194||''),'auth=Bearer\x20'+_0x487174,'',''];return Buffer[_0xcf14('0x36')](_0x2504ad[_0xcf14('0x13')]('\ 1'),_0xcf14('0x47'))[_0xcf14('0x48')](_0xcf14('0x49'));};
\ No newline at end of file
+var _0x469d=['BodyHTML','Attachments','<p>Empty\x20message</p>','user=','auth=Bearer\x20','utf-8','toString','moment','randomstring','util','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','substring','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','test','replace','<img','attachments','filename','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','originTo','message','originCc','includes','attach','type','attachment','attachment-','format','%s-%s','root','server/files/attachments/','writeFileSync','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content'];(function(_0x469a00,_0x573952){var _0x4813c0=function(_0x1c9f15){while(--_0x1c9f15){_0x469a00['push'](_0x469a00['shift']());}};_0x4813c0(++_0x573952);}(_0x469d,0x97));var _0xd469=function(_0x297246,_0x46b402){_0x297246=_0x297246-0x0;var _0x3038a9=_0x469d[_0x297246];return _0x3038a9;};'use strict';var _=require('lodash');var moment=require(_0xd469('0x0'));var random=require(_0xd469('0x1'));var fs=require('fs');var path=require('path');var util=require(_0xd469('0x2'));var tnef=require(_0xd469('0x3'));var logger=require('../../../config/logger')(_0xd469('0x4'));var config=require(_0xd469('0x5'));function getAddress(_0x50e1b6){var _0x2ef488=_[_0xd469('0x6')](_0x50e1b6[_0xd469('0x7')]);return _0x2ef488&&_0x2ef488[_0xd469('0x8')]?_0x2ef488[_0xd469('0x8')]:_0xd469('0x9')+random[_0xd469('0xa')](0x6)+_0xd469('0xb');}function getFirstName(_0x5c6f99){var _0x4e6b84=_[_0xd469('0x6')](_0x5c6f99[_0xd469('0x7')]);if(_0x4e6b84&&_0x4e6b84['name']){if(_0x4e6b84['name']==_0x4e6b84[_0xd469('0x8')]){return _0x4e6b84['name'][_0xd469('0xc')](0x0,_0x4e6b84[_0xd469('0xd')][_0xd469('0xe')]('@'));}var _0x15ce2d=_0x4e6b84[_0xd469('0xd')][_0xd469('0xf')](/\s+/);return _0x15ce2d[_0xd469('0x10')]>0x1?_0x15ce2d[_0xd469('0x11')](0x0,-0x1)[_0xd469('0x12')]('\x20'):_0x4e6b84[_0xd469('0xd')];}return _0xd469('0x13');}function getLastName(_0x15d42e){var _0x5216fd=_[_0xd469('0x6')](_0x15d42e['value']);if(_0x5216fd&&_0x5216fd[_0xd469('0xd')]){var _0x24120b=_0x5216fd[_0xd469('0xd')]['split'](/\s+/);return _0x24120b[_0xd469('0x10')]>0x1?_0x24120b[_0xd469('0x14')]():'';}return'';}function getMails(_0xa3c0f6,_0x36fe55){var _0x195a2b='';for(var _0x251fc6=0x0;_0x251fc6<_0x36fe55[_0xd469('0x7')][_0xd469('0x10')];_0x251fc6+=0x1){if(_0x36fe55[_0xd469('0x7')][_0x251fc6][_0xd469('0x8')]!==_0xa3c0f6){if(!_[_0xd469('0x15')](_0x195a2b)){_0x195a2b+=',';}_0x195a2b+=_0x36fe55[_0xd469('0x7')][_0x251fc6][_0xd469('0xd')]||_0x36fe55[_0xd469('0x7')][_0x251fc6][_0xd469('0x8')]||'';_0x195a2b+='\x20<';_0x195a2b+=_0x36fe55[_0xd469('0x7')][_0x251fc6][_0xd469('0x8')]?_0x36fe55[_0xd469('0x7')][_0x251fc6]['address']:'anonymous'+random[_0xd469('0xa')](0x6)+_0xd469('0xb');_0x195a2b+='>';}}return _0x195a2b;}function parseEmail(_0x50f918,_0x39bb10,_0x32476d){if(_0x39bb10[_0xd469('0x16')]){var _0x5e92ea=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x5e92ea[_0xd469('0x17')](_0x39bb10[_0xd469('0x16')])){_0x39bb10[_0xd469('0x16')]=_0x39bb10['html'][_0xd469('0x18')](_0x5e92ea,'');}if(_0x39bb10[_0xd469('0x16')]['includes'](_0xd469('0x19'))){var _0x404b03=[];_0x39bb10[_0xd469('0x1a')]['forEach'](_0x2f3e47=>{_0x404b03['push'](_0x2f3e47[_0xd469('0x1b')]);});var _0x1b2ea7=/<img.*? _SRC(.*?)[^>]+>/g;var _0x489857=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x443fe3=_0x39bb10[_0xd469('0x16')][_0xd469('0x18')](_0x489857,'_SRC');var _0x52911a=_0x443fe3[_0xd469('0x18')](_0x1b2ea7,_0xd469('0x1c'));for(let _0x4d2b5e=0x0;_0x4d2b5e<_0x404b03[_0xd469('0x10')];_0x4d2b5e++){var _0x2375ee=_0x52911a[_0xd469('0x18')](_0xd469('0x1c'),_0xd469('0x1d')+_0x404b03[_0x4d2b5e]+_0xd469('0x1e'));_0x52911a=_0x2375ee;}_0x39bb10[_0xd469('0x16')]=_0x52911a;}_0x32476d[_0xd469('0x1f')]=_0x39bb10['html'];}else{_0x32476d[_0xd469('0x1f')]=_0x39bb10['textAsHtml'];}if(_0x32476d[_0xd469('0x1f')]){_0x32476d[_0xd469('0x1f')]=_0x32476d[_0xd469('0x1f')]['replace'](/<a\s+/gi,'<a\x20target=\x22_blank\x22\x20');}if(_0x39bb10['to']){_0x32476d['message'][_0xd469('0x20')]=getMails(null,_0x39bb10['to']);var _0x496c5c=getMails(_0x50f918[_0xd469('0x4')],_0x39bb10['to']);if(!_['isEmpty'](_0x496c5c)){_0x32476d[_0xd469('0x21')]['cc']+=_0x496c5c;}}if(_0x39bb10['cc']){_0x32476d[_0xd469('0x21')][_0xd469('0x22')]=getMails(null,_0x39bb10['cc']);var _0x2cb366=getMails(_0x50f918[_0xd469('0x4')],_0x39bb10['cc']);if(!_['isEmpty'](_0x2cb366)){if(!_[_0xd469('0x15')](_0x32476d[_0xd469('0x21')]['cc'])){_0x32476d['message']['cc']+=',';}_0x32476d['message']['cc']+=_0x2cb366;}}if(!_['includes'](_0x32476d[_0xd469('0x21')]['originTo'],_0x50f918[_0xd469('0x4')])&&!_[_0xd469('0x23')](_0x32476d[_0xd469('0x21')][_0xd469('0x22')],_0x50f918[_0xd469('0x4')])){_0x32476d['message']['bcc']=_0x50f918[_0xd469('0x4')];}if(_0x39bb10[_0xd469('0x1a')]&&_0x39bb10[_0xd469('0x1a')][_0xd469('0x10')]){_0x32476d[_0xd469('0x21')][_0xd469('0x24')]=_0x39bb10[_0xd469('0x1a')][_0xd469('0x10')];for(var _0x2bb203=0x0,_0x3cc0b7,_0x2b5cdd,_0x384967;_0x2bb203<_0x39bb10[_0xd469('0x1a')][_0xd469('0x10')];_0x2bb203+=0x1){if(_0x39bb10['attachments'][_0x2bb203][_0xd469('0x25')]===_0xd469('0x26')){_0x384967=_0x39bb10['attachments'][_0x2bb203][_0xd469('0x1b')]||_0xd469('0x27')+_0x2bb203;_0x3cc0b7=util[_0xd469('0x28')](_0xd469('0x29'),Date['now'](),_0x384967);_0x2b5cdd=path['join'](config[_0xd469('0x2a')],_0xd469('0x2b'),_0x3cc0b7);fs[_0xd469('0x2c')](_0x2b5cdd,_0x39bb10['attachments'][_0x2bb203]['content']);_0x32476d[_0xd469('0x21')][_0xd469('0x1a')][_0xd469('0x2d')]({'name':_0x384967,'basename':_0x3cc0b7,'type':_0x39bb10[_0xd469('0x1a')][_0x2bb203][_0xd469('0x2e')],'filepath':_0x2b5cdd});}}}if(_0x39bb10[_0xd469('0x2f')]&&_0x39bb10['headerLines'][_0xd469('0x10')]>0x0){var _0x55b25c=[_0xd469('0x30'),_0xd469('0x31'),'Precedence:\x20auto_reply'];for(var _0x1597ab=0x0;_0x1597ab<_0x39bb10['headerLines']['length'];_0x1597ab++){var _0x3f9bb8=_[_0xd469('0xe')](_0x55b25c,_0x39bb10[_0xd469('0x2f')][_0x1597ab][_0xd469('0x32')]);if(_0x3f9bb8>=0x0){_0x32476d[_0xd469('0x33')]=!![];}}}return _0x32476d;}exports['parser']=function(_0x1fb963,_0x4c3311,_0x43b4ef){var _0x1d9008={'from':getAddress(_0x4c3311[_0xd469('0x34')]),'firstName':getFirstName(_0x4c3311['from']),'lastName':getLastName(_0x4c3311[_0xd469('0x34')]),'mapKey':_0xd469('0x4'),'message':{'from':getMails(_0x1fb963[_0xd469('0x4')],_0x4c3311['from']),'to':_0x1fb963[_0xd469('0x4')],'cc':'','subject':_0x4c3311[_0xd469('0x35')]||'','messageId':_0x4c3311[_0xd469('0x36')],'inReplyTo':_0x4c3311[_0xd469('0x37')],'sentAt':moment(_0x4c3311[_0xd469('0x38')])[_0xd469('0x28')](_0xd469('0x39')),'attach':![],'attachments':[]}};if(!_0x4c3311[_0xd469('0x16')]&&!_0x4c3311[_0xd469('0x3a')]){var _0x2ad44f=_['filter'](_0x4c3311[_0xd469('0x1a')],{'contentType':_0xd469('0x3b')});if(_0x2ad44f[_0xd469('0x10')]){logger[_0xd469('0x3c')](util['format'](_0xd469('0x3d'),_0x4c3311[_0xd469('0x36')]));tnef[_0xd469('0x3e')](_[_0xd469('0x3f')](_0x2ad44f)[_0xd469('0x40')],function(_0x5cc524,_0x4e1964){if(_0x4e1964){_0x4c3311[_0xd469('0x16')]=_0x4e1964[_0xd469('0x41')]||'<p>Empty\x20message</p>';if(_0x4e1964[_0xd469('0x42')]){for(var _0x379302=0x0;_0x379302<_0x4e1964['Attachments'][_0xd469('0x10')];_0x379302++){var _0x4dfc4b=_0x4e1964[_0xd469('0x42')][_0x379302];_0x1d9008['message']['attachments'][_0xd469('0x2d')]({'filename':_0x4dfc4b['Title'],'content':Buffer['from'](_0x4dfc4b['Data'])});}}}_0x43b4ef(parseEmail(_0x1fb963,_0x4c3311,_0x1d9008));});}else{_0x4c3311[_0xd469('0x16')]=_0xd469('0x43');_0x43b4ef(parseEmail(_0x1fb963,_0x4c3311,_0x1d9008));}}else{_0x43b4ef(parseEmail(_0x1fb963,_0x4c3311,_0x1d9008));}};exports['generateXOAuth2Token']=function(_0x17ddb0,_0xc7bb9e){var _0x2a0a4b=[_0xd469('0x44')+(_0xc7bb9e||''),_0xd469('0x45')+_0x17ddb0,'',''];return Buffer['from'](_0x2a0a4b[_0xd469('0x12')]('\ 1'),_0xd469('0x46'))[_0xd469('0x47')]('base64');};
\ No newline at end of file