Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Find the copy Mail keeps of a plug-in

Țugui Dragoș14db665cc239
diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/SearchLocation.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/SearchLocation.swift
index 07bfb56e..0782f9de 100644
--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/SearchLocation.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/SearchLocation.swift
@@ -125,7 +125,7 @@ extension SearchLocation.Kind {
case .audioUnits, .audioDrivers, .vst, .vst3, .clap, .midiDrivers, .cameraPlugIns, .internetPlugIns,
.preferencePanes, .quickLook,
.screenSavers, .spotlight, .services, .inputMethods, .colorPickers, .contextualMenuItems, .mailBundles,
- .aax, .mas, .imageUnits, .dictionaries, .automatorActions, .contactsPlugIns:
+ .mailPlugInCopies, .aax, .mas, .imageUnits, .dictionaries, .automatorActions, .contactsPlugIns:
self = .plugIns
}
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift b/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
index 9d8664ad..f18004ed 100644
--- a/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
@@ -96,7 +96,7 @@ extension Plugin.Category {
case .inputMethods: self = .inputMethods
case .colorPickers: self = .colorPickers
case .contextualMenuItems: self = .contextualMenuItems
- case .mailBundles: self = .mailBundles
+ case .mailBundles, .mailPlugInCopies: self = .mailBundles
case .aax: self = .aax
case .mas: self = .mas
case .imageUnits: self = .imageUnits
diff --git a/Packages/PeelCore/Sources/PeelPrivileged/LibraryFolder.swift b/Packages/PeelCore/Sources/PeelPrivileged/LibraryFolder.swift
index b66dda68..81567e67 100644
--- a/Packages/PeelCore/Sources/PeelPrivileged/LibraryFolder.swift
+++ b/Packages/PeelCore/Sources/PeelPrivileged/LibraryFolder.swift
@@ -38,6 +38,8 @@ public enum LibraryFolder: String, CaseIterable, Sendable {
case colorPickers = "ColorPickers"
case contextualMenuItems = "Contextual Menu Items"
case mailBundles = "Mail/Bundles"
+ /// The copy Mail keeps of each plug-in that is on, in the one folder of plug-ins its own program names.
+ case mailPlugInCopies = "Application Support/Mail/Plug-ins/Bundles"
/// Avid's "Where is the Plug-Ins folder for Pro Tools located?" (kb.avid.com).
case aax = "Application Support/Avid/Audio/Plug-Ins"
/// MOTU's "What differences are there between MAS and AU plug-ins in Digital Performer?".
@@ -55,7 +57,8 @@ public enum LibraryFolder: String, CaseIterable, Sendable {
public static let plugIns: [LibraryFolder] = [
.audioUnits, .audioDrivers, .vst, .vst3, .clap, .midiDrivers, .cameraPlugIns, .internetPlugIns,
.preferencePanes, .quickLook, .screenSavers, .spotlight, .services, .inputMethods, .colorPickers,
- .contextualMenuItems, .mailBundles, .aax, .mas, .imageUnits, .dictionaries, .automatorActions, .contactsPlugIns,
+ .contextualMenuItems, .mailBundles, .mailPlugInCopies, .aax, .mas, .imageUnits, .dictionaries,
+ .automatorActions, .contactsPlugIns,
]
/// The folders searched in the home's Library, besides the plug-in folders.
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
index e39f8834..4c974782 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
@@ -265,6 +265,22 @@ struct PluginsTests {
#expect(plugins.first?.noLongerLoaded == nil)
}
+ @Test func listsTheCopyMailKeepsOfAPlugInBesideThePublicOne() async throws {
+ let directory = try TemporaryDirectory()
+ try directory.directory("home/Library/Mail/Bundles/Public.mailbundle/Contents")
+ try directory.directory("home/Library/Application Support/Mail/Plug-ins/Bundles/Copy.mailbundle/Contents")
+ let environment = SearchEnvironment(
+ homeDirectory: directory.url.appending(path: "home", directoryHint: .isDirectory),
+ rootDirectory: directory.url.appending(path: "root", directoryHint: .isDirectory)
+ )
+
+ let plugins = await Plugins.scan(environment: environment).plugins.filter { $0.category == .mailBundles }
+
+ #expect(Set(plugins.map(\.name)) == ["Public", "Copy"])
+ #expect(plugins.allSatisfy { $0.refusal == nil })
+ #expect(environment.locations.contains { $0.url.path(percentEncoded: false).hasSuffix("Mail/Plug-ins/Bundles/") })
+ }
+
@Test func offersAMailBundleInTheUsersLibrary() async throws {
let directory = try TemporaryDirectory()
try directory.directory("home/Library/Mail/Bundles/Example.mailbundle/Contents")
diff --git a/SAFETY.md b/SAFETY.md
index 0459122e..2bba7110 100644
--- a/SAFETY.md
+++ b/SAFETY.md
@@ -43,7 +43,7 @@ In the Library of every account on the Mac and, for the last rows, in the home f
| `Application Support/MobileSync` | iPhone and iPad backups. |
| `Application Support/AddressBook`, `Contacts` | Your contacts. |
| `Application Support/CallHistoryDB` | Your call history. |
-| `Mail`, `Messages` | Your mail and your messages. A Mail plug-in in `Mail/Bundles`, which holds code and no mail, may go. |
+| `Mail`, `Messages` | Your mail and your messages. A Mail plug-in in `Mail/Bundles`, or the copy Mail keeps of it in `Application Support/Mail/Plug-ins/Bundles`, which hold code and no mail, may go. |
| `Safari` | Bookmarks, history, reading list. |
| `Calendars`, `Reminders` | Your calendars and reminders, where older systems kept them. |
| `Group Containers/` any of Apple's own | Where macOS 26 keeps notes, reminders, calendars, voice memos, the journal, and more. Apple moves these between releases, so they are recognized by their name (`com.apple.` after an optional team and an optional `group.`, `groups.`, or `systemgroup.`), not from a list. |
@@ -641,7 +641,7 @@ and it fails closed.
something on the list is refused like the thing itself.
- It serves a fixed list of folders and refuses everything else: `/Applications`, for apps only; eight folders
of `/Library` (Application Support, Caches, Preferences, Logs, LaunchAgents, LaunchDaemons,
- PrivilegedHelperTools, and StartupItems) and the 23 that hold plug-ins; the installer receipts in
+ PrivilegedHelperTools, and StartupItems) and the 24 that hold plug-ins; the installer receipts in
`/private/var/db/receipts`; the links in `/usr/local/bin`, `/usr/local/sbin`, and the four folders of
`/usr/local` that shell completions are linked into; the folders of `/Library` browsers read native messaging
manifests from; and the Library of the administrator who asks.