diff -Nru thunderbird-102.5.0+build1/BUILDID thunderbird-102.5.0+build2/BUILDID --- thunderbird-102.5.0+build1/BUILDID 2022-11-14 13:23:38.000000000 +0000 +++ thunderbird-102.5.0+build2/BUILDID 2022-11-15 21:16:27.000000000 +0000 @@ -1 +1 @@ -20221111114522 \ No newline at end of file +20221115143058 \ No newline at end of file diff -Nru thunderbird-102.5.0+build1/comm/mail/base/content/msgMail3PaneWindow.js thunderbird-102.5.0+build2/comm/mail/base/content/msgMail3PaneWindow.js --- thunderbird-102.5.0+build1/comm/mail/base/content/msgMail3PaneWindow.js 2022-11-14 13:06:40.000000000 +0000 +++ thunderbird-102.5.0+build2/comm/mail/base/content/msgMail3PaneWindow.js 2022-11-15 21:07:09.000000000 +0000 @@ -43,6 +43,7 @@ MailConsts: "resource:///modules/MailConsts.jsm", MailUtils: "resource:///modules/MailUtils.jsm", msgDBCacheManager: "resource:///modules/MsgDBCacheManager.jsm", + OAuth2Providers: "resource:///modules/OAuth2Providers.jsm", PeriodicFilterManager: "resource:///modules/PeriodicFilterManager.jsm", SessionStoreManager: "resource:///modules/SessionStoreManager.jsm", ShortcutUtils: "resource://gre/modules/ShortcutUtils.jsm", @@ -1011,28 +1012,79 @@ im_matrix: 0, im_odnoklassniki: 0, }; + + const providerReport = { + google: 0, + microsoft: 0, + yahoo_aol: 0, + other: 0, + }; + for (let account of MailServices.accounts.accounts) { - let type = account.incomingServer.type; + const incomingServer = account.incomingServer; + + let type = incomingServer.type; if (type == "none") { // Reporting one Local Folders account is not that useful. Skip it. continue; } + if (type === "im") { let protocol = - account.incomingServer.wrappedJSObject.imAccount.protocol - .normalizedName; + incomingServer.wrappedJSObject.imAccount.protocol.normalizedName; type = `im_${protocol}`; } + // It's still possible to report other types not explicitly specified due to // account types that used to exist, but no longer -- e.g. im_yahoo. if (!report[type]) { report[type] = 0; } + report[type]++; + + // Collect a rough understanding of the frequency of various OAuth + // providers. + if (incomingServer.authMethod == Ci.nsMsgAuthMethod.OAuth2) { + const hostnameDetails = OAuth2Providers.getHostnameDetails( + incomingServer.hostName + ); + + if (!hostnameDetails || hostnameDetails.length == 0) { + // Not a valid OAuth2 configuration; skip it + continue; + } + + const host = hostnameDetails[0]; + + switch (host) { + case "accounts.google.com": + providerReport.google++; + break; + case "login.microsoftonline.com": + providerReport.microsoft++; + break; + case "login.yahoo.com": + case "login.aol.com": + providerReport.yahoo_aol++; + break; + default: + providerReport.other++; + } + } } + for (let [type, count] of Object.entries(report)) { Services.telemetry.keyedScalarSet("tb.account.count", type, count); } + + for (const [provider, count] of Object.entries(providerReport)) { + Services.telemetry.keyedScalarSet( + "tb.account.oauth2_provider_count", + provider, + count + ); + } } /** diff -Nru thunderbird-102.5.0+build1/comm/mail/components/addrbook/content/aboutAddressBook.js thunderbird-102.5.0+build2/comm/mail/components/addrbook/content/aboutAddressBook.js --- thunderbird-102.5.0+build1/comm/mail/components/addrbook/content/aboutAddressBook.js 2022-11-14 13:06:40.000000000 +0000 +++ thunderbird-102.5.0+build2/comm/mail/components/addrbook/content/aboutAddressBook.js 2022-11-15 21:07:29.000000000 +0000 @@ -79,6 +79,31 @@ var booksList; window.addEventListener("load", () => { + + document.addEventListener("keydown", event => { + if ( + !(AppConstants.platform == "macosx" ? event.metaKey : event.ctrlKey) || + ["Shift", "Control", "Meta"].includes(event.key) + ) { + return; + } + + // Always use lowercase to compare the key and avoid OS inconsistencies: + // For Cmd/Ctrl+Shift+A, on Mac, key = "a" vs. on Windows/Linux, key = "A". + switch (event.key.toLowerCase()) { + // Always prevent the default behavior of the keydown if we intercepted + // the key in order to avoid triggering OS specific shortcuts. + // We're temporarily hardcoding Ctrl/Cmd+n for ESR 102 lacking the string. + case "n": { + // Ctrl/Cmd+n. + event.preventDefault(); + createContact(); + break; + } + } + }); + + document .getElementById("toolbarCreateBook") .addEventListener("command", event => { diff -Nru thunderbird-102.5.0+build1/comm/mail/components/telemetry/Scalars.yaml thunderbird-102.5.0+build2/comm/mail/components/telemetry/Scalars.yaml --- thunderbird-102.5.0+build1/comm/mail/components/telemetry/Scalars.yaml 2022-11-14 13:06:40.000000000 +0000 +++ thunderbird-102.5.0+build2/comm/mail/components/telemetry/Scalars.yaml 2022-11-15 21:07:09.000000000 +0000 @@ -177,6 +177,24 @@ record_in_processes: - 'main' + + oauth2_provider_count: + bug_numbers: + - 1799726 + description: + A count of incoming mail accounts using OAuth2 for authentication, keyed + broadly by account provider. + release_channel_collection: opt-out + expires: never + products: + - 'thunderbird' + keyed: true + kind: uint + notification_emails: + - "telemetry-client-dev@thunderbird.net" + record_in_processes: + - 'main' + tb.compose: format_html: bug_numbers: diff -Nru thunderbird-102.5.0+build1/comm/mail/test/browser/account/browser_accountTelemetry.js thunderbird-102.5.0+build2/comm/mail/test/browser/account/browser_accountTelemetry.js --- thunderbird-102.5.0+build1/comm/mail/test/browser/account/browser_accountTelemetry.js 2022-11-14 13:06:40.000000000 +0000 +++ thunderbird-102.5.0+build2/comm/mail/test/browser/account/browser_accountTelemetry.js 2022-11-15 21:07:09.000000000 +0000 @@ -29,13 +29,14 @@ ); var { FileUtils } = ChromeUtils.import("resource://gre/modules/FileUtils.jsm"); -// Collect all added accounts to be cleaned up at the end. -let addedAccounts = []; - /** * Check that we are counting account types. */ add_task(async function test_account_types() { + // Collect all added accounts to be cleaned up at the end. + + let addedAccounts = []; + Services.telemetry.clearScalars(); const NUM_IMAP = 3; @@ -77,6 +78,12 @@ addedAccounts.push(account); } + registerCleanupFunction(() => { + for (let account of addedAccounts) { + MailServices.accounts.removeAccount(account); + } + }); + reportAccountTypes(); let scalars = TelemetryTestUtils.getProcessScalars("parent", true); @@ -101,10 +108,6 @@ undefined, "Should not report Local Folders account" ); - - for (let account of addedAccounts) { - MailServices.accounts.removeAccount(account); - } }); /** @@ -177,3 +180,96 @@ "Size of all folders must be correct" ); }); + +/** + * Verify counting of OAuth2 providers + */ +add_task(async function test_account_oauth_providers() { + // Collect all added accounts to be cleaned up at the end + const addedAccounts = []; + + Services.telemetry.clearScalars(); + + const EXPECTED_GOOGLE_COUNT = 2; + const EXPECTED_MICROSOFT_COUNT = 1; + const EXPECTED_YAHOO_AOL_COUNT = 2; + const EXPECTED_OTHER_COUNT = 2; + + const hostnames = [ + "imap.googlemail.com", + "imap.gmail.com", + "imap.mail.ru", + "imap.yandex.com", + "imap.mail.yahoo.com", + "imap.aol.com", + "outlook.office365.com", + "something.totally.unexpected", + ]; + + function createIncomingImapServer(username, hostname, authMethod) { + const incoming = MailServices.accounts.createIncomingServer( + username, + hostname, + "imap" + ); + + incoming.authMethod = authMethod; + + const account = MailServices.accounts.createAccount(); + account.incomingServer = incoming; + + const identity = MailServices.accounts.createIdentity(); + account.addIdentity(identity); + + addedAccounts.push(account); + } + + // Add incoming servers + let i = 0; + const otherAuthMethods = [ + Ci.nsMsgAuthMethod.none, + Ci.nsMsgAuthMethod.passwordCleartext, + Ci.nsMsgAuthMethod.passwordEncrypted, + Ci.nsMsgAuthMethod.secure, + ]; + + for (const hostname of hostnames) { + // Create one with OAuth2 + createIncomingImapServer("nobody", hostname, Ci.nsMsgAuthMethod.OAuth2); + + // Create one with an arbitrary method from our list + createIncomingImapServer("somebody_else", hostname, otherAuthMethods[i]); + i = i + (1 % otherAuthMethods.length); + } + + registerCleanupFunction(() => { + for (const account of addedAccounts) { + MailServices.accounts.removeAccount(account); + } + }); + + reportAccountTypes(); + const scalars = TelemetryTestUtils.getProcessScalars("parent", true); + + // Check if we count account types correctly. + Assert.equal( + scalars["tb.account.oauth2_provider_count"].google, + EXPECTED_GOOGLE_COUNT, + "should have expected number of Google accounts" + ); + Assert.equal( + scalars["tb.account.oauth2_provider_count"].microsoft, + EXPECTED_MICROSOFT_COUNT, + "should have expected number of Microsoft accounts" + ); + Assert.equal( + scalars["tb.account.oauth2_provider_count"].yahoo_aol, + EXPECTED_YAHOO_AOL_COUNT, + "should have expected number of Yahoo/AOL accounts" + ); + Assert.equal( + scalars["tb.account.oauth2_provider_count"].other, + EXPECTED_OTHER_COUNT, + "should have expected number of other accounts" + ); +}); diff -Nru thunderbird-102.5.0+build1/comm/SOURCE_CHANGESET thunderbird-102.5.0+build2/comm/SOURCE_CHANGESET --- thunderbird-102.5.0+build1/comm/SOURCE_CHANGESET 2022-11-14 13:07:10.000000000 +0000 +++ thunderbird-102.5.0+build2/comm/SOURCE_CHANGESET 2022-11-15 21:07:29.000000000 +0000 @@ -1 +1 @@ -434e1e64a0b4135b448ba091a7950aeacc1f1980 \ No newline at end of file +b6e9b5a1d1b53d26cfb7032ef2ff02203ab0486b \ No newline at end of file diff -Nru thunderbird-102.5.0+build1/debian/changelog thunderbird-102.5.0+build2/debian/changelog --- thunderbird-102.5.0+build1/debian/changelog 2022-11-14 16:03:40.000000000 +0000 +++ thunderbird-102.5.0+build2/debian/changelog 2022-11-21 16:08:04.000000000 +0000 @@ -1,3 +1,9 @@ +thunderbird (1:102.5.0+build2-0ubuntu0.22.10.1) kinetic; urgency=medium + + * New upstream stable release (102.5.0+build2) + + -- Olivier Tilloy Mon, 21 Nov 2022 17:08:04 +0100 + thunderbird (1:102.5.0+build1-0ubuntu0.22.10.1) kinetic; urgency=medium * New upstream stable release (102.5.0+build1)