From e0640949a2911f475d36dec1d2a3b49ac4aa44c3 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it <75116288+FreddleSpl0it@users.noreply.github.com> Date: Mon, 9 Nov 2026 22:39:42 +0100 Subject: [PATCH] [Web][Dovecot] Show the last SOGo login in the mailbox list and API --- data/conf/dovecot/auth/mailcowauth.php | 4 ++-- data/web/inc/functions.mailbox.inc.php | 7 +++++++ data/web/js/site/mailbox.js | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/data/conf/dovecot/auth/mailcowauth.php b/data/conf/dovecot/auth/mailcowauth.php index 9a4637506..7d4424dc5 100644 --- a/data/conf/dovecot/auth/mailcowauth.php +++ b/data/conf/dovecot/auth/mailcowauth.php @@ -116,8 +116,8 @@ if ($result === false){ exit; } if ($result) { - error_log('MAILCOWAUTH: User auth for user ' . $post['username'] . " with service " . $post['service'] . " from IP " . $client_ip); - set_sasl_log($post['username'], $client_ip, $post['service']); + error_log('MAILCOWAUTH: User auth for user ' . $post['username'] . " with service " . $service . " from IP " . $client_ip); + set_sasl_log($post['username'], $client_ip, $service); } } diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index 121d43a0c..c6e4f6f80 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -4923,6 +4923,9 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { else if ($SaslLogs['service'] == 'SSO') { $last_sso_login = strtotime($SaslLogs['datetime']); } + else if ($SaslLogs['service'] == 'SOGO') { + $last_sogo_login = strtotime($SaslLogs['datetime']); + } } if (!isset($last_imap_login) || $GLOBALS['SHOW_LAST_LOGIN'] === false) { $last_imap_login = 0; @@ -4936,10 +4939,14 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { if (!isset($last_sso_login) || $GLOBALS['SHOW_LAST_LOGIN'] === false) { $last_sso_login = 0; } + if (!isset($last_sogo_login) || $GLOBALS['SHOW_LAST_LOGIN'] === false) { + $last_sogo_login = 0; + } $mailboxdata['last_imap_login'] = $last_imap_login; $mailboxdata['last_smtp_login'] = $last_smtp_login; $mailboxdata['last_pop3_login'] = $last_pop3_login; $mailboxdata['last_sso_login'] = $last_sso_login; + $mailboxdata['last_sogo_login'] = $last_sogo_login; if (!isset($_extra) || $_extra != 'reduced') { $rl = ratelimit('get', 'mailbox', $_data); diff --git a/data/web/js/site/mailbox.js b/data/web/js/site/mailbox.js index 32de2a8d1..2f3088839 100644 --- a/data/web/js/site/mailbox.js +++ b/data/web/js/site/mailbox.js @@ -932,6 +932,7 @@ jQuery(function($){ item.last_mail_login = (item.attributes.imap_access == 1 ? '