For logout, exit from idle mode only when it is --> to head
patch d280db07c18bbe0bee399bd33a23c813c6215823
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Dec 4 23:41:31 CET 2018
* Add support for SNI
patch a960193b96b178a92741ceb58850f17b29629c95
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Dec 4 21:12:31 CET 2018
* Simplify parser of configuration file
patch 3994fdd764ce973cd13650e4fd820083d9e8b2b5
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Dec 4 20:53:19 CET 2018
* Add title to password dialog
patch e8534a5cb083b3d82aff297783e2c5d2d683c8d3
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Mon Sep 17 16:50:09 CEST 2018
* Reset client keepalive when server keepalive (untagged "OK still here" like response) is detected
patch 0b7e378659f9aec5eff13490775050929649bda2
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Sat Sep 8 21:34:57 CEST 2018
* Set icon to hourglass when the connection is lost and reconnecting
patch 459541a83671f7510008f6add9eed8e5502ea6d3
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Thu Sep 6 01:00:58 CEST 2018
* Move reset idle to exit_idle
patch bd7e29cb071eb7be716e9bb785540882402845f3
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Wed Sep 5 19:21:16 CEST 2018
* Set icon to hourglass when checking mail (searching) and waiting for logout
patch 54015fb789a93e0b2f72a72ded21190f68fc4f59
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Sep 4 21:38:00 CEST 2018
* Replace question mark icon with hourglass
patch 0e5aa389db90fbbc6e6b9515acd3aa92c94731a7
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Sep 4 19:32:19 CEST 2018
* Move non-logout code to cleanup function
patch 3eb89bff44a913b4c504d590cf62cd9c47dd3936
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Sep 4 19:17:08 CEST 2018
* For logout, exit from idle mode only when it is
Binary files old-idlebiff/check.png and new-idlebiff/check.png differ
diff -rN -u old-idlebiff/idlebiff new-idlebiff/idlebiff
--- old-idlebiff/idlebiff 2024-11-22 21:20:02.004374293 +0100
+++ new-idlebiff/idlebiff 2024-11-22 21:20:02.004374293 +0100
@@ -145,6 +145,7 @@
if { !$conf(tls) } { set nv "\nWARNING: INSECURE CONNECTION" }
toplevel .tl
+ wm title .tl {idlebiff: password}
message .tl.msg -bg black -fg yellow -width 400 -justify center \
-text "${textbad}Enter password for\n$conf(user) at $conf(host)"
pack .tl.msg -side top -fill both
@@ -181,9 +182,8 @@
while {[ >= [ gets $cf lin ] 0 ]} \
{
if {[ == [ string index [ string trim $lin ] 0 ] # ]} continue
- set sep [ string first = $lin ]
- set key [ string range $lin 0 [ - $sep 1 ] ]
- set val [ string range $lin [ + $sep 1 ] end ]
+ set lconf [ split $lin = ]
+ set val [ join [ lassign $lconf key ] = ]
set conf([ string trim $key]) [ string trim $val ]
}
}
@@ -231,6 +231,7 @@
set tevent($teidf) [ after ${conf(timeout)}000 \
{
+ update_img $::shared::img_chk
cancel_timeout
close $con
init
@@ -267,8 +268,10 @@
{
variable ::shared::ka
variable ::shared::idle
+ variable ::shared::img_chk
after cancel $ka
+ update_img $img_chk
set idle 0
catch { close $con }
after 3000 init
@@ -334,13 +337,8 @@
proc logout con \
{
- variable ::shared::ka
- variable ::shared::idle
variable ::shared::conf
- after cancel $ka
- set idle 0
- exit_idle $con
fileevent $con readable { parse_logout $con }
after ${conf(timeout_logout)}000 \
{
@@ -352,6 +350,13 @@
proc cleanup con \
{
+ variable ::shared::ka
+ variable ::shared::img_chk
+ variable ::shared::idle
+
+ update_img $img_chk
+ after cancel $ka
+ if { $idle } { exit_idle $con }
logout $con
}
@@ -369,6 +374,9 @@
proc exit_idle con \
{
+ variable ::shared::idle
+
+ set idle 0
imap_command $con DONE
}
@@ -387,7 +395,9 @@
proc do_search con \
{
variable ::shared::search
+ variable ::shared::img_chk
+ update_img $img_chk
imap_command_tagged $con $search
}
@@ -413,12 +423,10 @@
proc idle_cycle { con check } \
{
- variable ::shared::idle
variable ::shared::conf
variable ::shared::ka
after cancel $ka
- set idle 0
exit_idle $con
if { $check } { do_search $con } \
else { enter_idle $con }
@@ -504,11 +512,24 @@
proc parse_idle_check con \
{
variable ::shared::idle
+ variable ::shared::ka
+ variable ::shared::conf
if {[ catch { set linea [ read_line $con ] } ]} return
set prim [ string range $linea 0 0 ]
if {[ eq $prim + ]} { set idle 1 } \
- elseif { $idle } { if {[ eq $prim * ]} { idle_cycle $con 1 } } \
+ elseif { $idle } \
+ {
+ if {[ eq $prim * ]} \
+ {
+ if {[ ok_untagged $linea ]} \
+ {
+ after cancel $ka
+ set ka [ after ${conf(keepalive)}000 { idle_cycle $con 0 } ]
+ } \
+ else { idle_cycle $con 1 } \
+ } \
+ } \
else { parse_search $con $linea }
}
@@ -627,6 +648,8 @@
set tlsv [ package require tls ]
if {[ >= $tlsv 1.6.4 ]} { set tls1x {-tls1.1 1 -tls1.2 1} } \
else { set tls1x {} }
+ if {[ info exists conf(sni) ]} { set sni "-servername $conf(sni)" } \
+ else { set sni {} }
set sock "::tls::socket -ssl2 0 -ssl3 0 -tls1 1 $tls1x \
-cafile \"$conf(tls_ca_file)\" \
-cadir \"$conf(tls_ca_dir)\" \
@@ -635,6 +658,7 @@
-request \"$conf(tls_validate_cert)\" \
-require \"$conf(tls_validate_cert)\" \
-cipher \"$conf(tls_ciphers)\" \
+ $sni \
-command tls_cb"
} \
else { set sock socket }