Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / services / email / lib / utils.js
index f1e7854..0e8f7b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbdf=['push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','parser','from','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','<p>Empty\x20message</p>','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','head','name','substring','indexOf','split','slice','join','Anonymous','pop','isEmpty','test','html','replace','includes','<img','forEach','filename','_SRC','_IMG','length','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','message','originTo','originCc','bcc','attachments','type','%s-%s','now','root','server/files/attachments/'];(function(_0x5cfa15,_0x5ba527){var _0x512840=function(_0x108529){while(--_0x108529){_0x5cfa15['push'](_0x5cfa15['shift']());}};_0x512840(++_0x5ba527);}(_0xdbdf,0x1b8));var _0xfdbd=function(_0x70027,_0x41bdcd){_0x70027=_0x70027-0x0;var _0x4efdcf=_0xdbdf[_0x70027];return _0x4efdcf;};'use strict';var _=require(_0xfdbd('0x0'));var moment=require(_0xfdbd('0x1'));var random=require(_0xfdbd('0x2'));var fs=require('fs');var path=require(_0xfdbd('0x3'));var util=require(_0xfdbd('0x4'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xfdbd('0x5'));var config=require(_0xfdbd('0x6'));function getAddress(_0x50e582){var _0x2d6953=_['head'](_0x50e582[_0xfdbd('0x7')]);return _0x2d6953&&_0x2d6953[_0xfdbd('0x8')]?_0x2d6953[_0xfdbd('0x8')]:_0xfdbd('0x9')+random[_0xfdbd('0xa')](0x6)+_0xfdbd('0xb');}function getFirstName(_0x483b83){var _0x46edd1=_[_0xfdbd('0xc')](_0x483b83[_0xfdbd('0x7')]);if(_0x46edd1&&_0x46edd1[_0xfdbd('0xd')]){if(_0x46edd1[_0xfdbd('0xd')]==_0x46edd1[_0xfdbd('0x8')]){return _0x46edd1['name'][_0xfdbd('0xe')](0x0,_0x46edd1[_0xfdbd('0xd')][_0xfdbd('0xf')]('@'));}var _0x4271ee=_0x46edd1[_0xfdbd('0xd')][_0xfdbd('0x10')](/\s+/);return _0x4271ee['length']>0x1?_0x4271ee[_0xfdbd('0x11')](0x0,-0x1)[_0xfdbd('0x12')]('\x20'):_0x46edd1['name'];}return _0xfdbd('0x13');}function getLastName(_0x6f7f57){var _0x4b3d0d=_[_0xfdbd('0xc')](_0x6f7f57[_0xfdbd('0x7')]);if(_0x4b3d0d&&_0x4b3d0d[_0xfdbd('0xd')]){var _0x15e0e9=_0x4b3d0d[_0xfdbd('0xd')][_0xfdbd('0x10')](/\s+/);return _0x15e0e9['length']>0x1?_0x15e0e9[_0xfdbd('0x14')]():'';}return'';}function getMails(_0x4bfcc9,_0xca9ab4){var _0x32ff7c='';for(var _0x1e3a4c=0x0;_0x1e3a4c<_0xca9ab4[_0xfdbd('0x7')]['length'];_0x1e3a4c+=0x1){if(_0xca9ab4['value'][_0x1e3a4c][_0xfdbd('0x8')]!==_0x4bfcc9){if(!_[_0xfdbd('0x15')](_0x32ff7c)){_0x32ff7c+=',';}_0x32ff7c+=_0xca9ab4[_0xfdbd('0x7')][_0x1e3a4c][_0xfdbd('0xd')]||_0xca9ab4[_0xfdbd('0x7')][_0x1e3a4c][_0xfdbd('0x8')]||'';_0x32ff7c+='\x20<';_0x32ff7c+=_0xca9ab4[_0xfdbd('0x7')][_0x1e3a4c][_0xfdbd('0x8')]?_0xca9ab4[_0xfdbd('0x7')][_0x1e3a4c][_0xfdbd('0x8')]:_0xfdbd('0x9')+random[_0xfdbd('0xa')](0x6)+_0xfdbd('0xb');_0x32ff7c+='>';}}return _0x32ff7c;}function parseEmail(_0x3d41ff,_0xb5282d,_0x361856){if(_0xb5282d['html']){var _0x341804=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x341804[_0xfdbd('0x16')](_0xb5282d[_0xfdbd('0x17')])){_0xb5282d[_0xfdbd('0x17')]=_0xb5282d[_0xfdbd('0x17')][_0xfdbd('0x18')](_0x341804,'');}if(_0xb5282d['html'][_0xfdbd('0x19')](_0xfdbd('0x1a'))){var _0x29ccb5=[];_0xb5282d['attachments'][_0xfdbd('0x1b')](_0x4ac2a1=>{_0x29ccb5['push'](_0x4ac2a1[_0xfdbd('0x1c')]);});var _0x3607aa=/<img.*? _SRC(.*?)[^>]+>/g;var _0x3ccfb3=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x16ed06=_0xb5282d[_0xfdbd('0x17')][_0xfdbd('0x18')](_0x3ccfb3,_0xfdbd('0x1d'));var _0x4dfe24=_0x16ed06[_0xfdbd('0x18')](_0x3607aa,_0xfdbd('0x1e'));for(let _0xff096b=0x0;_0xff096b<_0x29ccb5[_0xfdbd('0x1f')];_0xff096b++){var _0x1bb8fb=_0x4dfe24[_0xfdbd('0x18')](_0xfdbd('0x1e'),_0xfdbd('0x20')+_0x29ccb5[_0xff096b]+_0xfdbd('0x21'));_0x4dfe24=_0x1bb8fb;}_0xb5282d[_0xfdbd('0x17')]=_0x4dfe24;}_0x361856['body']=_0xb5282d[_0xfdbd('0x17')];}else{_0x361856[_0xfdbd('0x22')]=_0xb5282d[_0xfdbd('0x23')];}if(_0x361856[_0xfdbd('0x22')]){_0x361856[_0xfdbd('0x22')]=_0x361856['body'][_0xfdbd('0x18')](/<a\s+/gi,'<a\x20target=\x22_blank\x22\x20');}if(_0xb5282d['to']){_0x361856[_0xfdbd('0x24')][_0xfdbd('0x25')]=getMails(null,_0xb5282d['to']);var _0x350b44=getMails(_0x3d41ff[_0xfdbd('0x5')],_0xb5282d['to']);if(!_[_0xfdbd('0x15')](_0x350b44)){_0x361856[_0xfdbd('0x24')]['cc']+=_0x350b44;}}if(_0xb5282d['cc']){_0x361856['message'][_0xfdbd('0x26')]=getMails(null,_0xb5282d['cc']);var _0x286619=getMails(_0x3d41ff[_0xfdbd('0x5')],_0xb5282d['cc']);if(!_[_0xfdbd('0x15')](_0x286619)){if(!_[_0xfdbd('0x15')](_0x361856[_0xfdbd('0x24')]['cc'])){_0x361856[_0xfdbd('0x24')]['cc']+=',';}_0x361856[_0xfdbd('0x24')]['cc']+=_0x286619;}}if(!_[_0xfdbd('0x19')](_0x361856[_0xfdbd('0x24')]['originTo'],_0x3d41ff[_0xfdbd('0x5')])&&!_['includes'](_0x361856[_0xfdbd('0x24')][_0xfdbd('0x26')],_0x3d41ff[_0xfdbd('0x5')])){_0x361856[_0xfdbd('0x24')][_0xfdbd('0x27')]=_0x3d41ff['email'];}if(_0xb5282d['attachments']&&_0xb5282d[_0xfdbd('0x28')]['length']){_0x361856[_0xfdbd('0x24')]['attach']=_0xb5282d[_0xfdbd('0x28')][_0xfdbd('0x1f')];for(var _0x5e15d0=0x0,_0x3f8d10,_0x389473,_0x552b3c;_0x5e15d0<_0xb5282d[_0xfdbd('0x28')][_0xfdbd('0x1f')];_0x5e15d0+=0x1){if(_0xb5282d['attachments'][_0x5e15d0][_0xfdbd('0x29')]==='attachment'){_0x552b3c=_0xb5282d[_0xfdbd('0x28')][_0x5e15d0][_0xfdbd('0x1c')]||'attachment-'+_0x5e15d0;_0x3f8d10=util['format'](_0xfdbd('0x2a'),Date[_0xfdbd('0x2b')](),_0x552b3c);_0x389473=path[_0xfdbd('0x12')](config[_0xfdbd('0x2c')],_0xfdbd('0x2d'),_0x3f8d10);fs['writeFileSync'](_0x389473,_0xb5282d[_0xfdbd('0x28')][_0x5e15d0]['content']);_0x361856[_0xfdbd('0x24')][_0xfdbd('0x28')][_0xfdbd('0x2e')]({'name':_0x552b3c,'basename':_0x3f8d10,'type':_0xb5282d[_0xfdbd('0x28')][_0x5e15d0][_0xfdbd('0x2f')],'filepath':_0x389473});}}}if(_0xb5282d[_0xfdbd('0x30')]&&_0xb5282d[_0xfdbd('0x30')][_0xfdbd('0x1f')]>0x0){var _0x5ee10c=[_0xfdbd('0x31'),_0xfdbd('0x32'),_0xfdbd('0x33')];for(var _0x216d6c=0x0;_0x216d6c<_0xb5282d['headerLines']['length'];_0x216d6c++){var _0x2f60ca=_[_0xfdbd('0xf')](_0x5ee10c,_0xb5282d[_0xfdbd('0x30')][_0x216d6c][_0xfdbd('0x34')]);if(_0x2f60ca>=0x0){_0x361856['isAutoreply']=!![];}}}return _0x361856;}exports[_0xfdbd('0x35')]=function(_0x21fe9a,_0x34ed86,_0x5e0a52){var _0x1bbcfe={'from':getAddress(_0x34ed86[_0xfdbd('0x36')]),'firstName':getFirstName(_0x34ed86[_0xfdbd('0x36')]),'lastName':getLastName(_0x34ed86[_0xfdbd('0x36')]),'mapKey':_0xfdbd('0x5'),'message':{'from':getMails(_0x21fe9a[_0xfdbd('0x5')],_0x34ed86[_0xfdbd('0x36')]),'to':_0x21fe9a[_0xfdbd('0x5')],'cc':'','subject':_0x34ed86['subject']||'','messageId':_0x34ed86['messageId'],'inReplyTo':_0x34ed86[_0xfdbd('0x37')],'sentAt':moment(_0x34ed86[_0xfdbd('0x38')])[_0xfdbd('0x39')](_0xfdbd('0x3a')),'attach':![],'attachments':[]}};if(!_0x34ed86['html']&&!_0x34ed86[_0xfdbd('0x23')]){var _0x2f447f=_[_0xfdbd('0x3b')](_0x34ed86[_0xfdbd('0x28')],{'contentType':'application/ms-tnef'});if(_0x2f447f['length']){logger[_0xfdbd('0x3c')](util[_0xfdbd('0x39')](_0xfdbd('0x3d'),_0x34ed86['messageId']));tnef[_0xfdbd('0x3e')](_[_0xfdbd('0x3f')](_0x2f447f)[_0xfdbd('0x40')],function(_0x257de9,_0x34b869){if(_0x34b869){_0x34ed86[_0xfdbd('0x17')]=_0x34b869['BodyHTML']||_0xfdbd('0x41');if(_0x34b869['Attachments']){for(var _0x10d862=0x0;_0x10d862<_0x34b869[_0xfdbd('0x42')][_0xfdbd('0x1f')];_0x10d862++){var _0x1ce839=_0x34b869['Attachments'][_0x10d862];_0x1bbcfe[_0xfdbd('0x24')][_0xfdbd('0x28')]['push']({'filename':_0x1ce839[_0xfdbd('0x43')],'content':Buffer['from'](_0x1ce839[_0xfdbd('0x44')])});}}}_0x5e0a52(parseEmail(_0x21fe9a,_0x34ed86,_0x1bbcfe));});}else{_0x34ed86[_0xfdbd('0x17')]=_0xfdbd('0x41');_0x5e0a52(parseEmail(_0x21fe9a,_0x34ed86,_0x1bbcfe));}}else{_0x5e0a52(parseEmail(_0x21fe9a,_0x34ed86,_0x1bbcfe));}};exports[_0xfdbd('0x45')]=function(_0x21c1c0){switch(_0x21c1c0){case'gmail':return _0xfdbd('0x46');case _0xfdbd('0x47'):return _0xfdbd('0x48');case _0xfdbd('0x49'):return _0xfdbd('0x4a');case _0xfdbd('0x4b'):return'outlook.office365.com';}return'127.0.0.1';};exports[_0xfdbd('0x4c')]=function(_0x237bec,_0x55aa2d){var _0x592d76=[_0xfdbd('0x4d')+(_0x55aa2d||''),'auth=Bearer\x20'+_0x237bec,'',''];return Buffer[_0xfdbd('0x36')](_0x592d76[_0xfdbd('0x12')]('\ 1'),_0xfdbd('0x4e'))[_0xfdbd('0x4f')](_0xfdbd('0x50'));};
\ No newline at end of file
+var _0x921d=['attach','type','attachment','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','messageId','inReplyTo','date','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','<p>Empty\x20message</p>','generateXOAuth2Token','auth=Bearer\x20','utf-8','base64','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','head','name','substring','indexOf','split','length','slice','join','Anonymous','isEmpty','html','test','includes','<img','attachments','forEach','push','filename','replace','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','message','originTo','originCc','bcc'];(function(_0x3e3663,_0x4712be){var _0xc20576=function(_0x53ec5c){while(--_0x53ec5c){_0x3e3663['push'](_0x3e3663['shift']());}};_0xc20576(++_0x4712be);}(_0x921d,0x1de));var _0xd921=function(_0x2c46ba,_0x51febd){_0x2c46ba=_0x2c46ba-0x0;var _0x1aa617=_0x921d[_0x2c46ba];return _0x1aa617;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0xd921('0x0'));var fs=require('fs');var path=require('path');var util=require(_0xd921('0x1'));var tnef=require(_0xd921('0x2'));var logger=require(_0xd921('0x3'))(_0xd921('0x4'));var config=require(_0xd921('0x5'));function getAddress(_0xb2ad0f){var _0x302f47=_['head'](_0xb2ad0f[_0xd921('0x6')]);return _0x302f47&&_0x302f47[_0xd921('0x7')]?_0x302f47[_0xd921('0x7')]:_0xd921('0x8')+random[_0xd921('0x9')](0x6)+_0xd921('0xa');}function getFirstName(_0x34c1b9){var _0x4aca1f=_[_0xd921('0xb')](_0x34c1b9[_0xd921('0x6')]);if(_0x4aca1f&&_0x4aca1f[_0xd921('0xc')]){if(_0x4aca1f[_0xd921('0xc')]==_0x4aca1f[_0xd921('0x7')]){return _0x4aca1f[_0xd921('0xc')][_0xd921('0xd')](0x0,_0x4aca1f['name'][_0xd921('0xe')]('@'));}var _0x2d921f=_0x4aca1f[_0xd921('0xc')][_0xd921('0xf')](/\s+/);return _0x2d921f[_0xd921('0x10')]>0x1?_0x2d921f[_0xd921('0x11')](0x0,-0x1)[_0xd921('0x12')]('\x20'):_0x4aca1f[_0xd921('0xc')];}return _0xd921('0x13');}function getLastName(_0x44d4df){var _0x261fea=_[_0xd921('0xb')](_0x44d4df['value']);if(_0x261fea&&_0x261fea[_0xd921('0xc')]){var _0x1f79f0=_0x261fea[_0xd921('0xc')][_0xd921('0xf')](/\s+/);return _0x1f79f0['length']>0x1?_0x1f79f0['pop']():'';}return'';}function getMails(_0x16438c,_0x2af8b2){var _0x43abd9='';for(var _0x66ee00=0x0;_0x66ee00<_0x2af8b2[_0xd921('0x6')][_0xd921('0x10')];_0x66ee00+=0x1){if(_0x2af8b2['value'][_0x66ee00][_0xd921('0x7')]!==_0x16438c){if(!_[_0xd921('0x14')](_0x43abd9)){_0x43abd9+=',';}_0x43abd9+=_0x2af8b2[_0xd921('0x6')][_0x66ee00][_0xd921('0xc')]||_0x2af8b2[_0xd921('0x6')][_0x66ee00]['address']||'';_0x43abd9+='\x20<';_0x43abd9+=_0x2af8b2[_0xd921('0x6')][_0x66ee00][_0xd921('0x7')]?_0x2af8b2[_0xd921('0x6')][_0x66ee00][_0xd921('0x7')]:_0xd921('0x8')+random[_0xd921('0x9')](0x6)+_0xd921('0xa');_0x43abd9+='>';}}return _0x43abd9;}function parseEmail(_0x480a60,_0x146b9d,_0x1d1922){if(_0x146b9d[_0xd921('0x15')]){var _0x31f1de=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x31f1de[_0xd921('0x16')](_0x146b9d[_0xd921('0x15')])){_0x146b9d[_0xd921('0x15')]=_0x146b9d['html']['replace'](_0x31f1de,'');}if(_0x146b9d[_0xd921('0x15')][_0xd921('0x17')](_0xd921('0x18'))){var _0x30e8ea=[];_0x146b9d[_0xd921('0x19')][_0xd921('0x1a')](_0x57ebc6=>{_0x30e8ea[_0xd921('0x1b')](_0x57ebc6[_0xd921('0x1c')]);});var _0x1ba9fa=/<img.*? _SRC(.*?)[^>]+>/g;var _0x56b4f4=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x54f5c=_0x146b9d[_0xd921('0x15')][_0xd921('0x1d')](_0x56b4f4,_0xd921('0x1e'));var _0x4a93ea=_0x54f5c[_0xd921('0x1d')](_0x1ba9fa,_0xd921('0x1f'));for(let _0x1ae8d5=0x0;_0x1ae8d5<_0x30e8ea[_0xd921('0x10')];_0x1ae8d5++){var _0x3b85fc=_0x4a93ea[_0xd921('0x1d')]('_IMG',_0xd921('0x20')+_0x30e8ea[_0x1ae8d5]+_0xd921('0x21'));_0x4a93ea=_0x3b85fc;}_0x146b9d[_0xd921('0x15')]=_0x4a93ea;}_0x1d1922[_0xd921('0x22')]=_0x146b9d['html'];}else{_0x1d1922['body']=_0x146b9d[_0xd921('0x23')];}if(_0x1d1922[_0xd921('0x22')]){_0x1d1922[_0xd921('0x22')]=_0x1d1922[_0xd921('0x22')]['replace'](/<a\s+/gi,'<a\x20target=\x22_blank\x22\x20');}if(_0x146b9d['to']){_0x1d1922[_0xd921('0x24')][_0xd921('0x25')]=getMails(null,_0x146b9d['to']);var _0x8ba1bc=getMails(_0x480a60[_0xd921('0x4')],_0x146b9d['to']);if(!_['isEmpty'](_0x8ba1bc)){_0x1d1922['message']['cc']+=_0x8ba1bc;}}if(_0x146b9d['cc']){_0x1d1922[_0xd921('0x24')][_0xd921('0x26')]=getMails(null,_0x146b9d['cc']);var _0x3d29c6=getMails(_0x480a60[_0xd921('0x4')],_0x146b9d['cc']);if(!_[_0xd921('0x14')](_0x3d29c6)){if(!_[_0xd921('0x14')](_0x1d1922[_0xd921('0x24')]['cc'])){_0x1d1922[_0xd921('0x24')]['cc']+=',';}_0x1d1922[_0xd921('0x24')]['cc']+=_0x3d29c6;}}if(!_[_0xd921('0x17')](_0x1d1922[_0xd921('0x24')][_0xd921('0x25')],_0x480a60[_0xd921('0x4')])&&!_['includes'](_0x1d1922[_0xd921('0x24')]['originCc'],_0x480a60[_0xd921('0x4')])){_0x1d1922[_0xd921('0x24')][_0xd921('0x27')]=_0x480a60['email'];}if(_0x146b9d[_0xd921('0x19')]&&_0x146b9d['attachments'][_0xd921('0x10')]){_0x1d1922[_0xd921('0x24')][_0xd921('0x28')]=_0x146b9d[_0xd921('0x19')]['length'];for(var _0x2d2ea6=0x0,_0x223bf8,_0x56ed41,_0x24945d;_0x2d2ea6<_0x146b9d[_0xd921('0x19')]['length'];_0x2d2ea6+=0x1){if(_0x146b9d[_0xd921('0x19')][_0x2d2ea6][_0xd921('0x29')]===_0xd921('0x2a')){_0x24945d=_0x146b9d[_0xd921('0x19')][_0x2d2ea6][_0xd921('0x1c')]||'attachment-'+_0x2d2ea6;_0x223bf8=util[_0xd921('0x2b')](_0xd921('0x2c'),Date[_0xd921('0x2d')](),_0x24945d);_0x56ed41=path[_0xd921('0x12')](config[_0xd921('0x2e')],_0xd921('0x2f'),_0x223bf8);fs[_0xd921('0x30')](_0x56ed41,_0x146b9d[_0xd921('0x19')][_0x2d2ea6][_0xd921('0x31')]);_0x1d1922['message']['attachments'][_0xd921('0x1b')]({'name':_0x24945d,'basename':_0x223bf8,'type':_0x146b9d[_0xd921('0x19')][_0x2d2ea6][_0xd921('0x32')],'filepath':_0x56ed41});}}}if(_0x146b9d[_0xd921('0x33')]&&_0x146b9d[_0xd921('0x33')]['length']>0x0){var _0x2e1e94=['Auto-Submitted:\x20auto-replied',_0xd921('0x34'),_0xd921('0x35')];for(var _0x506059=0x0;_0x506059<_0x146b9d[_0xd921('0x33')][_0xd921('0x10')];_0x506059++){var _0x395db8=_[_0xd921('0xe')](_0x2e1e94,_0x146b9d[_0xd921('0x33')][_0x506059][_0xd921('0x36')]);if(_0x395db8>=0x0){_0x1d1922[_0xd921('0x37')]=!![];}}}return _0x1d1922;}exports[_0xd921('0x38')]=function(_0x4e9b1a,_0x3270d6,_0x5a48d3){var _0x9d12ea={'from':getAddress(_0x3270d6[_0xd921('0x39')]),'firstName':getFirstName(_0x3270d6[_0xd921('0x39')]),'lastName':getLastName(_0x3270d6[_0xd921('0x39')]),'mapKey':_0xd921('0x4'),'message':{'from':getMails(_0x4e9b1a[_0xd921('0x4')],_0x3270d6[_0xd921('0x39')]),'to':_0x4e9b1a[_0xd921('0x4')],'cc':'','subject':_0x3270d6['subject']||'','messageId':_0x3270d6[_0xd921('0x3a')],'inReplyTo':_0x3270d6[_0xd921('0x3b')],'sentAt':moment(_0x3270d6[_0xd921('0x3c')])[_0xd921('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x3270d6[_0xd921('0x15')]&&!_0x3270d6[_0xd921('0x23')]){var _0x1e8d6f=_[_0xd921('0x3d')](_0x3270d6[_0xd921('0x19')],{'contentType':_0xd921('0x3e')});if(_0x1e8d6f['length']){logger[_0xd921('0x3f')](util['format'](_0xd921('0x40'),_0x3270d6['messageId']));tnef[_0xd921('0x41')](_[_0xd921('0x42')](_0x1e8d6f)[_0xd921('0x31')],function(_0x6e86e7,_0x2e7f4f){if(_0x2e7f4f){_0x3270d6[_0xd921('0x15')]=_0x2e7f4f[_0xd921('0x43')]||'<p>Empty\x20message</p>';if(_0x2e7f4f['Attachments']){for(var _0x284f83=0x0;_0x284f83<_0x2e7f4f[_0xd921('0x44')][_0xd921('0x10')];_0x284f83++){var _0x499d1d=_0x2e7f4f['Attachments'][_0x284f83];_0x9d12ea['message'][_0xd921('0x19')]['push']({'filename':_0x499d1d['Title'],'content':Buffer[_0xd921('0x39')](_0x499d1d['Data'])});}}}_0x5a48d3(parseEmail(_0x4e9b1a,_0x3270d6,_0x9d12ea));});}else{_0x3270d6[_0xd921('0x15')]=_0xd921('0x45');_0x5a48d3(parseEmail(_0x4e9b1a,_0x3270d6,_0x9d12ea));}}else{_0x5a48d3(parseEmail(_0x4e9b1a,_0x3270d6,_0x9d12ea));}};exports[_0xd921('0x46')]=function(_0x423948,_0xc1815e){var _0x2902a7=['user='+(_0xc1815e||''),_0xd921('0x47')+_0x423948,'',''];return Buffer[_0xd921('0x39')](_0x2902a7[_0xd921('0x12')]('\ 1'),_0xd921('0x48'))['toString'](_0xd921('0x49'));};
\ No newline at end of file