@@ -40,9 +40,10 @@ let socketIo = null;
4040 * @param email <string>
4141 * @return Imap & Smtp info
4242 */
43- const getImapSmtpHost = ( email ) => {
43+ const getImapSmtpHost = ( _email ) => {
44+ const email = _email . toLowerCase ( ) ;
4445 const yahoo = ( domain ) => {
45- if ( / y a h o o .c o .j p $ / . test ( domain ) )
46+ if ( / y a h o o .c o .j p $ / i . test ( domain ) )
4647 return 'yahoo.co.jp' ;
4748 if ( / ( ( .* \. ) { 0 , 1 } y a h o o | y a h o o g r o u p s | y a h o o x t r a | y a h o o g r u p p i | y a h o o g r u p p e r ) ( \. .{ 2 , 3 } ) { 1 , 2 } $ / . test ( domain ) )
4849 return 'yahoo.com' ;
@@ -115,9 +116,13 @@ const getImapSmtpHost = (email) => {
115116 ret . imap = 'mail.inbox.ee' ;
116117 break ;
117118 // gmx.com
119+ case 'gmx.co.uk' :
120+ case 'gmx.de' :
121+ case 'gmx.us' :
118122 case 'gmx.com' :
119123 {
120124 ret . smtp = 'mail.gmx.com' ;
125+ ret . imap = 'imap.gmx.com' ;
121126 }
122127 break ;
123128 // aim.com
@@ -543,7 +548,7 @@ const infoDefine = [
543548 error_message : {
544549 title : '错误' ,
545550 errorNotifyTitle : '系统错误' ,
546- EmailAddress :
[ '请按以下格式输入你的电子邮件地址: [email protected] .' , '您已有相同的Email账户' , '此类Email服务器暂时QTGate技术不能对应,请选择Apple公司,微软Outlook, Yahoo公司的Email服务 。' ] , 551+ EmailAddress :
[ '请按以下格式输入你的电子邮件地址: [email protected] .' , '您已有相同的Email账户' , '此类Email服务器暂时QTGate技术不能对应。' ] , 547552 required : '请填写此字段' ,
548553 doCancel : '终止完成' ,
549554 PasswordLengthError : '密码必须设定为5个字符以上。' ,
@@ -582,7 +587,9 @@ const infoDefine = [
582587 '您当天的数据通讯量达到上限,请等待明天再试或升级用户类型' ,
583588 '用来通讯的Email设定有错误,请检查IMAP设定后重试,或QTGate不支持此Email类型' ,
584589 '您所选区域不能够连结,请稍候再试' ,
585- '您的IMAP邮箱发信发生错误。请退出QTGate重试。如果持续发生此故障,您的IMAP帐号有可能被锁住,需要登陆您的IMAP邮箱网站解锁操作。 '
590+ '您的IMAP邮箱发信发生错误。请退出QTGate重试。如果持续发生此故障,您的IMAP帐号有可能被锁住,需要登陆您的IMAP邮箱网站解锁操作。 ' ,
591+ 'QTGate程序发生错误,请退出后重启QTGate!' ,
592+ '您是高手,不用我多说了。'
586593 ] ,
587594 activeing : '正在通讯中'
588595 } ,
@@ -1087,7 +1094,7 @@ const infoDefine = [
10871094 error_message : {
10881095 title : 'エラー' ,
10891096 errorNotifyTitle : 'システムエラー' ,
1090- EmailAddress :
[ 'メール アドレスを [email protected] の形式で入力してください。' , '同じEmailアカンウトが既に存在します。' , '入力したメールはQTGateシステム非対応です。QTGateは只今APPLEメール、マイクロソフトOutlookとYahooしか対応しておりません ' ] , 1097+ EmailAddress :
[ 'メール アドレスを [email protected] の形式で入力してください。' , '同じEmailアカンウトが既に存在します。' , '入力したメールはQTGateシステム非対応です。' ] , 10911098 required : 'このフィールドを入力してください。' ,
10921099 PasswordLengthError : '5文字以上の長さのパスワードが必要。' ,
10931100 localServerError : 'ローカルサーバーエラーが発生しました、QTGateを再起動をください!' ,
@@ -1127,7 +1134,9 @@ const infoDefine = [
11271134 'あなたの今日データ通信はリミットになっていますので、明日まで待ってください。またはユーザー種類をアップグレードをしてください' ,
11281135 '通信用IMAPの設定にエラーがあるか又はそのタープのIMAPアカンウトがQTGateサポートしません。よくチェックしてもう一回試しにしてください。' ,
11291136 '選択していたゲットウェーエリアは只今接続不能になっております、後ほどもう一度試しにしてください。' ,
1130- 'IMAPアカウトでEMAIL送信する際エラーが発生しました、一回退出し、起動して見てくださいね。重複発生した場合はIMAPアカウトのウェーブページでアカウトをアンロック操作を必要かもしれない。'
1137+ 'IMAPアカウトでEMAIL送信する際エラーが発生しました、一回退出し、起動して見てくださいね。重複発生した場合はIMAPアカウトのウェーブページでアカウトをアンロック操作を必要かもしれない。' ,
1138+ 'QTGateエラーが発生したした。一回退出してQTGateを再起動してください。' ,
1139+ 'アララーー、あなたには負けるそ。'
11311140 ] ,
11321141 activeing : '通信中'
11331142 } ,
@@ -1488,7 +1497,7 @@ const infoDefine = [
14881497 error_message : {
14891498 title : 'Error' ,
14901499 errorNotifyTitle : 'System Error' ,
1491- EmailAddress :
[ 'Please enter your email address in the format [email protected] .' , 'Have same email account!' , 'Sorry, QTGate system support Apple mail, Microsoft Outlook and Yahoo mail only .' ] , 1500+ EmailAddress :
[ 'Please enter your email address in the format [email protected] .' , 'Have same email account!' , 'Sorry, QTGate system have not support that kind mail server .' ] , 14921501 required : 'Please fill in this field.' ,
14931502 PasswordLengthError : 'Passwords must have at least 5 characters.' ,
14941503 localServerError : 'Local QTGate server error. restart please!' ,
@@ -1527,7 +1536,9 @@ const infoDefine = [
15271536 `Your data transfer is limit today, please try again tomorrow or upgrade your user type.` ,
15281537 'Your transfer email account looks not working, check the IMAP account please. Or your IMAP accout have not support with QTGate system.' ,
15291538 'Selected region has unavailable, try again later.' ,
1530- 'Your IMAP account got end mail error. Please exit QTGate and start up QTGate try again. If that have not be fixed, You may login to your IMAP account web side do unluck.'
1539+ 'Your IMAP account got end mail error. Please exit QTGate and start up QTGate try again. If that have not be fixed, You may login to your IMAP account web side do unluck.' ,
1540+ 'QTGate looks system error! Restart QTGate please.' ,
1541+ 'Oooooops! How are today?'
15311542 ] ,
15321543 activeing : 'sending...'
15331544 } ,
@@ -1899,7 +1910,7 @@ const infoDefine = [
18991910 Success : '完成' ,
19001911 localServerError : '本地伺服器錯誤,請重新啟動QTGate!' ,
19011912 required : '請填寫此字段' ,
1902- EmailAddress :
[ '請按照下列格式輸入你的電子郵件地址: [email protected] .' , '您已有相同的Email賬戶' , '此類Email伺服器暫時QTGate技術不能對應,請選擇Apple公司,微軟Outlook, Yahoo公司的Email服務 。' ] , 1913+ EmailAddress :
[ '請按照下列格式輸入你的電子郵件地址: [email protected] .' , '您已有相同的Email賬戶' , '此類Email伺服器暫時QTGate技術不能對應。' ] , 19031914 PasswordLengthError : '密碼必須設定為5個字符以上。' ,
19041915 finishedKeyPair : '密鑰對創建完成' ,
19051916 doCancel : '終止生成' ,
@@ -1934,7 +1945,9 @@ const infoDefine = [
19341945 '您當天的數據通訊量達到上限,請等待明天再試或升級用戶類型' ,
19351946 '用來通訊的Email設定有錯誤,請檢查IMAP設定後重試,或QTGate不支持此Email類型' ,
19361947 '您所選區域不能夠連結,請稍候再試' ,
1937- '您的IMAP郵箱發信發生錯誤。請退出QTGate重試。如果持續發生此故障,您的IMAP帳號有可能被鎖住,需要登陸您的IMAP郵箱網站解鎖操作。'
1948+ '您的IMAP郵箱發信發生錯誤。請退出QTGate重試。如果持續發生此故障,您的IMAP帳號有可能被鎖住,需要登陸您的IMAP郵箱網站解鎖操作。' ,
1949+ 'QTGate程序發生錯誤,請退出後重新啟動QTGate。' ,
1950+ '嗯,高手過招身手非凡啊!'
19381951 ] ,
19391952 activeing : '正在通訊中'
19401953 } ,
@@ -2228,7 +2241,7 @@ const _QTGateRegions = [
22282241 showConnectedArea : ko . observable ( false )
22292242 }
22302243] ;
2231- const availableImapServer = / i m a p \- m a i l \. o u t l o o k \. c o m $ | i m a p \. m a i l \. y a h o o \. c o m $ | i m a p \. m a i l \. m e \. c o m $ | i m a p \. m a i l \. y a h o o \. c o \. j p $ | i m a p \. g m a i l \. c o m $ | g m x \. c o m $ | z o h o \. c o m $ / i;
2244+ const availableImapServer = / i m a p \- m a i l \. o u t l o o k \. c o m $ | i m a p \. m a i l \. y a h o o \. c o m $ | i m a p \. m a i l \. m e \. c o m $ | i m a p \. m a i l \. y a h o o \. c o \. j p $ | i m a p \. g m a i l \. c o m $ | g m x \. c o m $ | i m a p \. z o h o \. c o m $ / i;
22322245const dummyIConnectCommand = {
22332246 connectPeer : null ,
22342247 connectType : null ,
@@ -2786,6 +2799,7 @@ var view_layout;
27862799 this . feedBackAttachImgPath = ko . observable ( '' ) ;
27872800 this . attachedLog = ko . observable ( '' ) ;
27882801 this . feedBackTextArea = ko . observable ( '' ) ;
2802+ this . hacked = ko . observable ( false ) ;
27892803 this . conformButtom = ko . computed ( ( ) => {
27902804 this . conformTextError ( false ) ;
27912805 const text = this . conformText ( ) ;
@@ -2827,18 +2841,20 @@ var view_layout;
28272841 if ( newValue == '1' ) {
28282842 }
28292843 } ) ;
2830- socketIo = io ( ) ;
2831- socketIo . emit ( 'init' , ( err , data ) => {
2832- this . config ( data ) ;
2833- if ( ! data . keypair . createDate )
2834- this . keyPairGenerateFormActive ( true ) ;
2835- else
2836- this . showKeyPairInformation ( true ) ;
2837- this . QTGateConnect1 ( data . lastConnectType ? data . lastConnectType . toString ( ) : '1' ) ;
2838- this . keyPair ( data . keypair ) ;
2839- return $ ( '.activating.element' ) . popup ( {
2840- on : 'focus' ,
2841- position : 'bottom left' ,
2844+ socketIo = io ( { reconnectionAttempts : 5 , timeout : 1000 } ) ;
2845+ socketIo . once ( 'connect' , ( ) => {
2846+ socketIo . emit ( 'init' , ( err , data ) => {
2847+ this . config ( data ) ;
2848+ if ( ! data . keypair . createDate )
2849+ this . keyPairGenerateFormActive ( true ) ;
2850+ else
2851+ this . showKeyPairInformation ( true ) ;
2852+ this . QTGateConnect1 ( data . lastConnectType ? data . lastConnectType . toString ( ) : '1' ) ;
2853+ this . keyPair ( data . keypair ) ;
2854+ return $ ( '.activating.element' ) . popup ( {
2855+ on : 'focus' ,
2856+ position : 'bottom left' ,
2857+ } ) ;
28422858 } ) ;
28432859 } ) ;
28442860 this . SystemAdministratorEmailAddress . subscribe ( newValue => {
@@ -2914,16 +2930,7 @@ var view_layout;
29142930 return this . showAddImapDataButton ( true ) ;
29152931 } ) ;
29162932 socketIo . on ( 'deleteKeyPair' , ( ) => {
2917- this . keyPair ( initKeyPair ) ;
2918- this . config ( ) . keypair = this . keyPair ( ) ;
2919- this . keyPairGenerateFormActive ( true ) ;
2920- this . passwordError ( false ) ;
2921- this . showConformMailForm ( false ) ;
2922- this . ImapErr ( false ) ;
2923- this . ImapAccountConnected ( false ) ;
2924- this . emailAddressDoingCheck ( false ) ;
2925- this . showConformMailForm ( false ) ;
2926- return this . showKeyPairInformation ( false ) ;
2933+ window . location . replace ( '/' ) ;
29272934 } ) ;
29282935 socketIo . on ( 'config' , config => {
29292936 this . config ( config ) ;
@@ -2935,7 +2942,7 @@ var view_layout;
29352942 // err = 4 unformat data from QTGate system
29362943 // err = 6 QTGate connect pair timeout from server.js
29372944 this . modalContent ( infoDefine [ this . languageIndex ( ) ] . emailConform . formatError [ err ] ) ;
2938- return $ ( '.ui.basic.modal' ) . modal ( 'show' ) ;
2945+ return $ ( '.ui.basic.modal' ) . modal ( 'setting' , 'closable' , false ) . modal ( ' show') ;
29392946 }
29402947 this . conformTextError ( true ) ;
29412948 this . conformTextErrorNumber ( err ) ;
@@ -3082,7 +3089,7 @@ var view_layout;
30823089 return this . QTGateConnectActive ( false ) ;
30833090 } ) ;
30843091 // gateway disconnect!
3085- socketIo . on ( 'disconnect ' , ( ) => {
3092+ socketIo . on ( 'disconnectClickCallBack ' , resopn => {
30863093 this . disconnecting ( true ) ;
30873094 if ( this . selectedQTGateRegion ( ) ) {
30883095 this . selectedQTGateRegion ( ) . showConnectedArea ( false ) ;
@@ -3091,6 +3098,12 @@ var view_layout;
30913098 this . selectedQTGateRegionCancel ( ) ;
30923099 }
30933100 } ) ;
3101+ socketIo . once ( 'reconnect_error' , err => {
3102+ if ( this . modalContent ( ) . length )
3103+ return ;
3104+ this . modalContent ( infoDefine [ this . languageIndex ( ) ] . emailConform . formatError [ 10 ] ) ;
3105+ return $ ( '.ui.basic.modal' ) . modal ( 'setting' , 'closable' , false ) . modal ( 'show' ) ;
3106+ } ) ;
30943107 socketIo . on ( 'disconnectClickCallBack' , ( ) => {
30953108 this . desconnectCallBack ( ) ;
30963109 } ) ;
@@ -3583,7 +3596,12 @@ var view_layout;
35833596 socketIo . emit ( 'disconnectClick' ) ;
35843597 }
35853598 exit ( ) {
3586- socketIo . emit ( 'exit' ) ;
3599+ if ( typeof require === 'undefined' ) {
3600+ this . modalContent ( infoDefine [ this . languageIndex ( ) ] . emailConform . formatError [ 11 ] ) ;
3601+ return this . hacked ( true ) ;
3602+ }
3603+ const { remote } = require ( 'electron' ) ;
3604+ remote . app . quit ( ) ;
35873605 }
35883606 }
35893607 view_layout . view = view ;
0 commit comments