{"id":50081,"date":"2025-11-17T23:27:30","date_gmt":"2025-11-18T04:27:30","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=50081"},"modified":"2025-11-17T23:28:26","modified_gmt":"2025-11-18T04:28:26","slug":"spamsieve-3-2-2","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2025\/11\/17\/spamsieve-3-2-2\/","title":{"rendered":"SpamSieve 3.2.2"},"content":{"rendered":"<p><a href=\"https:\/\/c-command.com\/blog\/2025\/11\/17\/spamsieve-3-2-2\/\">SpamSieve 3.2.2<\/a> is a maintenance release of my Mac e-mail spam filter.<\/p>\n\n<ul>\n\n<li><p><a href=\"https:\/\/mjtsai.com\/blog\/2025\/09\/18\/spamsieve-3-2\/\">SpamSieve 3.2<\/a> had a bunch of changes to deal with Microsoft&rsquo;s plan to sunset Legacy Outlook on November 1, however in early October they announced a new plan to keep supporting Legacy Outlook for another year. I think this was the right decision, because New Outlook is still missing a lot, but it&rsquo;s frustrating that the change came so late. I can only assume that they started getting customer feedback as the preview builds rolled out and took people by surprise, breaking their workflows.<\/p><\/li>\n\n<li><p>AppleScript issues continue. Over the last month or so, a small number of customers have been getting error -1751 (<code>errOSAlnvalidlD<\/code>) on macOS Tahoe and on later builds of Sequoia. Something seems to be getting messed up inside AppleScript so that an <code>NSAppleScript<\/code> cannot be run more than once. (The error is occurring before the first line of AppleScript is being executed, so it&rsquo;s not due to events being sent by the script itself.) I added a way to work around this by turning off SpamSieve&rsquo;s reuse of <code>NSAppleScript<\/code> objects.<\/p><\/li>\n\n<li><p><a href=\"https:\/\/mjtsai.com\/blog\/2025\/10\/03\/spamsieve-3-2-1\/\">SpamSieve 3.2.1<\/a> worked around a problem with AppleScript timeouts and POP accounts on macOS Tahoe. A small percentage of customers are seeing a similar issue with IMAP accounts on Tahoe, so I&rsquo;ve added a workaround for that, too.<\/p><\/li>\n\n<li><p>Some customers are seeing crashes in <code>AEDeterminePermissionToAutomateTarget()<\/code>. The point of using that was to improve the user experience, but I&rsquo;ve now added a way to disable it because it&rsquo;s better to have a confusing error message (in the event of no automation access) than a crash on launch. (This API also has a hanging problem, as <a href=\"https:\/\/mjtsai.com\/blog\/2023\/12\/27\/spamsieve-3-0-3\/\">previously discussed<\/a>.)<\/p><\/li>\n\n<li><p>Some pathological message data and an inefficient regex could combine to cause hangs when parsing a message. I fixed this by optimizing the regex. I don&rsquo;t think there are any other patterns that could cause this, no matter the data, but just in case I added a timeout for regex matches. (Alas, this feature of <code>NSRegularExpression<\/code> does not seem to have made it into Swift Regex.)<\/p><\/li>\n\n<li><p>I&rsquo;ve <a href=\"https:\/\/mjtsai.com\/blog\/2023\/10\/19\/spamsieve-3-0-1\/\">previously written<\/a> that <code>StringProtocol<\/code> had switched from ICU regular expressions to Swift Regex. However, I&rsquo;ve now seen several cases where, based on stack traces, <code>StringProtocol.range&lt;A&gt;(of:options:range:locale:)<\/code> seems to be using <em>both<\/em>. I have not been able to find the source for this method. It doesn&rsquo;t seem to be in the <a href=\"https:\/\/github.com\/swiftlang\/swift\/blob\/b4d2f8abd82a7e0bf0f4deb2f97c25823c993688\/stdlib\/public\/core\/StringProtocol.swift#L15\">core<\/a> or in <a href=\"https:\/\/github.com\/swiftlang\/swift-foundation\/blob\/f270f751710dd3cf3274dada04e4874354b7ca0f\/Sources\/FoundationEssentials\/String\/StringProtocol%2BEssentials.swift\">FoundationEssentials<\/a>. The <a href=\"https:\/\/github.com\/swiftlang\/swift-foundation\/blob\/f270f751710dd3cf3274dada04e4874354b7ca0f\/Sources\/FoundationEssentials\/String\/String%2BComparison.swift#L602\"><code>Substring<\/code> implementation<\/a> seems to only use Swift Regex.<\/p><\/li>\n\n<li><p>I&rsquo;m seeing some cases where on Tahoe <code>NSWorkspace.shared.menuBarOwningApplication<\/code> doesn&rsquo;t match the app name shown in the menu bar.<\/p><\/li>\n\n<li><p>With <a href=\"https:\/\/mjtsai.com\/blog\/2025\/10\/03\/spamsieve-3-2-1\/\">SpamSieve 3.2.1<\/a>, I mentioned a performance issue due to eager Swift bridging of <code>_NSCallStackArray<\/code>. I&rsquo;ve now made all my processing of this array lazy (using Objective-C subclasses) so that it can be collected in more places without slowing things down when it&rsquo;s not actually used. Note that it does not seem to <a href=\"https:\/\/stackoverflow.com\/questions\/67688557\/subclassing-nsarray\">be<\/a> <a href=\"https:\/\/stackoverflow.com\/questions\/27527544\/creating-an-nsmutabalearray-subclass-in-swift\">possible<\/a> to subclass <code>NSArray<\/code> from Swift.<\/p><\/li>\n\n<\/ul>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2025\/10\/03\/spamsieve-3-2-1\/\">SpamSieve 3.2.1<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2018\/08\/31\/aedeterminepermissiontoautomatetarget-added-but-aepocalyse-still-looms\/\">AEDeterminePermissionToAutomateTarget Added, But AEpocalyse Still Looms<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>SpamSieve 3.2.2 is a maintenance release of my Mac e-mail spam filter. SpamSieve 3.2 had a bunch of changes to deal with Microsoft&rsquo;s plan to sunset Legacy Outlook on November 1, however in early October they announced a new plan to keep supporting Legacy Outlook for another year. I think this was the right decision, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2025-11-18T04:27:33Z","apple_news_api_id":"98900cf7-ffc9-48d0-9d12-3f567d598998","apple_news_api_modified_at":"2025-11-18T04:28:29Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AmJAM9__JSNCdEj9WfVmJmA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[126,159,69,30,32,2742,2485,1605,138,234,372,901],"class_list":["post-50081","post","type-post","status-publish","format-standard","hentry","category-technology","tag-applemail","tag-applescript","tag-cocoa","tag-mac","tag-macapp","tag-macos-tahoe-26","tag-menu-bar","tag-microsoft-outlook","tag-optimization","tag-regex","tag-spamsieve","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/50081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=50081"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/50081\/revisions"}],"predecessor-version":[{"id":50083,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/50081\/revisions\/50083"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=50081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=50081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=50081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}