Repository: thunderbird/thunderbird-android (language: kotlin)

Issue:
Module :legacy:account migration
- Create Android module  `:core:android:account`
- Move contents of `:legacy:account` into  new module `:core:android:account`
- Remove `:legacy:account`


Discussion hints:
nan

Pull request: Module :legacy:account migration
- Fixes #9181 

Test command: ./gradlew :legacy:core:testDebugUnitTest --tests "com.fsck.k9.message.MessageBuilderTest" --tests "com.fsck.k9.notification.NotificationDataStoreTest" --tests "com.fsck.k9.preferences.upgrader.CombinedSettingsUpgraderTo96Test" --tests "com.fsck.k9.preferences.upgrader.CombinedSettingsUpgraderTo99Test" --tests "com.fsck.k9.preferences.upgrader.CombinedSettingsUpgraderTo100Test" --tests "com.fsck.k9.mailstore.K9BackendDefaultStorageTest" --tests "com.fsck.k9.mailstore.K9BackendFolderTest" --tests "com.fsck.k9.message.quote.TextQuoteCreatorTest" --tests "com.fsck.k9.notification.CertificateErrorNotificationControllerTest" --tests "com.fsck.k9.notification.SyncNotificationControllerTest" --tests "com.fsck.k9.message.ReplyActionStrategyTest" --tests "com.fsck.k9.helper.IdentityHelperTest" --tests "com.fsck.k9.notification.LockScreenNotificationCreatorTest" --tests "com.fsck.k9.preferences.upgrader.CombinedSettingsUpgraderTo98Test" --tests "com.fsck.k9.controller.DefaultMessageCountsProviderTest" --tests "com.fsck.k9.notification.NewMailNotificationManagerTest" --tests "com.fsck.k9.helper.ReplyToParserTest" --tests "com.fsck.k9.notification.SingleMessageNotificationDataCreatorTest" --tests "com.fsck.k9.UnifiedInboxConfiguratorTest" --tests "com.fsck.k9.notification.NotificationIdsTest" --tests "com.fsck.k9.controller.LocalDeleteOperationDeciderTest" --tests "com.fsck.k9.crypto.OpenPgpApiHelperTest" --tests "com.fsck.k9.notification.NotificationContentCreatorTest" --tests "com.fsck.k9.notification.SendFailedNotificationControllerTest" --tests "com.fsck.k9.message.IdentityHeaderBuilderTest" --tests "com.fsck.k9.notification.SummaryNotificationDataCreatorTest" --tests "com.fsck.k9.PreferencesTest" --tests "com.fsck.k9.notification.AuthenticationErrorNotificationControllerTest" --tests "com.fsck.k9.controller.MessagingControllerTest" :legacy:ui:legacy:testDebugUnitTest --tests "com.fsck.k9.ui.messageview.DisplayRecipientsExtractorTest" --tests "com.fsck.k9.activity.compose.ReplyToPresenterTest" --tests "com.fsck.k9.ui.messageview.MessageViewRecipientFormatterTest" --tests "com.fsck.k9.ui.messagelist.MessageListAdapterTest" --tests "com.fsck.k9.ui.identity.IdentityFormatterTest" --tests "com.fsck.k9.activity.compose.RecipientPresenterTest" --tests "com.fsck.k9.ui.messagedetails.MessageDetailsParticipantFormatterTest" --tests "com.fsck.k9.message.PgpMessageBuilderTest" :legacy:mailstore:testDebugUnitTest --tests "app.k9mail.legacy.mailstore.MessageStoreManagerTest" :feature:widget:unread:testDebugUnitTest --tests "app.k9mail.feature.widget.unread.UnreadWidgetDataProviderTest" :legacy:common:testDebugUnitTest --tests "com.fsck.k9.account.AccountServerSettingsUpdaterTest" --tests "com.fsck.k9.account.AccountStateLoaderTest" --tests "com.fsck.k9.account.DefaultDeletePolicyProviderTest" :legacy:storage:testDebugUnitTest --tests "com.fsck.k9.storage.StoreSchemaDefinitionTest" :app-common:testDebugUnitTest --tests "net.thunderbird.app.common.account.data.LegacyAccountProfileLocalDataSourceTest" :feature:migration:qrcode:testDebugUnitTest --tests "app.k9mail.feature.migration.qrcode.settings.XmlSettingWriterTest" :core:android:account:testDebugUnitTest --tests "net.thunderbird.core.android.account.LegacyAccountWrapperTest"

Fix patch:
diff --git a/app-common/build.gradle.kts b/app-common/build.gradle.kts
index 03ae6b8c52c..6d196b5ee79 100644
--- a/app-common/build.gradle.kts
+++ b/app-common/build.gradle.kts
@@ -15,7 +15,7 @@ dependencies {
     api(projects.feature.navigation.drawer.api)
 
     implementation(projects.legacy.core)
-    implementation(projects.legacy.account)
+    implementation(projects.core.android.account)
 
     implementation(projects.core.account)
 
diff --git a/app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountColorPicker.kt b/app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountColorPicker.kt
index 99fc1f3d836..3d73a285f7a 100644
--- a/app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountColorPicker.kt
+++ b/app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountColorPicker.kt
@@ -2,7 +2,7 @@ package net.thunderbird.app.common.account
 
 import android.content.res.Resources
 import app.k9mail.core.ui.legacy.theme2.common.R
-import app.k9mail.legacy.account.AccountManager
+import net.thunderbird.core.android.account.AccountManager
 
 internal class AccountColorPicker(
     private val accountManager: AccountManager,
diff --git a/app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountCreator.kt b/app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountCreator.kt
index 8b84b630463..ffb096fe88d 100644
--- a/app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountCreator.kt
+++ b/app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountCreator.kt
@@ -7,7 +7,6 @@ import app.k9mail.feature.account.common.domain.entity.SpecialFolderOption
 import app.k9mail.feature.account.common.domain.entity.SpecialFolderSettings
 import app.k9mail.feature.account.setup.AccountSetupExternalContract
 import app.k9mail.feature.account.setup.AccountSetupExternalContract.AccountCreator.AccountCreatorResult
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.Core
 import com.fsck.k9.Preferences
 import com.fsck.k9.account.DeletePolicyProvider
@@ -24,6 +23,7 @@ import com.fsck.k9.preferences.UnifiedInboxConfigurator
 import kotlinx.coroutines.CoroutineDispatcher
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.withContext
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.mail.folder.api.SpecialFolderSelection
 
 // TODO Move to feature/account/setup
diff --git a/app-common/src/main/kotlin/net/thunderbird/app/common/account/AppCommonAccountModule.kt b/app-common/src/main/kotlin/net/thunderbird/app/common/account/AppCommonAccountModule.kt
index 2d0044b63e8..85493d12cc8 100644
--- a/app-common/src/main/kotlin/net/thunderbird/app/common/account/AppCommonAccountModule.kt
+++ b/app-common/src/main/kotlin/net/thunderbird/app/common/account/AppCommonAccountModule.kt
@@ -1,10 +1,10 @@
 package net.thunderbird.app.common.account
 
 import app.k9mail.feature.account.setup.AccountSetupExternalContract
-import app.k9mail.legacy.account.AccountDefaultsProvider
-import app.k9mail.legacy.account.LegacyAccountWrapperManager
 import net.thunderbird.app.common.account.data.CommonAccountProfileLocalDataSource
 import net.thunderbird.app.common.account.data.CommonLegacyAccountWrapperManager
+import net.thunderbird.core.android.account.AccountDefaultsProvider
+import net.thunderbird.core.android.account.LegacyAccountWrapperManager
 import net.thunderbird.feature.account.core.AccountCoreExternalContract.AccountProfileLocalDataSource
 import net.thunderbird.feature.account.core.featureAccountCoreModule
 import org.koin.android.ext.koin.androidApplication
diff --git a/app-common/src/main/kotlin/net/thunderbird/app/common/account/CommonAccountDefaultsProvider.kt b/app-common/src/main/kotlin/net/thunderbird/app/common/account/CommonAccountDefaultsProvider.kt
index ac91610b935..18413af35ac 100644
--- a/app-common/src/main/kotlin/net/thunderbird/app/common/account/CommonAccountDefaultsProvider.kt
+++ b/app-common/src/main/kotlin/net/thunderbird/app/common/account/CommonAccountDefaultsProvider.kt
@@ -2,30 +2,30 @@ package net.thunderbird.app.common.account
 
 import app.k9mail.core.featureflag.FeatureFlagProvider
 import app.k9mail.core.featureflag.toFeatureFlagKey
-import app.k9mail.legacy.account.AccountDefaultsProvider
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MAXIMUM_AUTO_DOWNLOAD_MESSAGE_SIZE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT_AUTO
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_READ_RECEIPT
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTED_TEXT_SHOWN
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_PREFIX
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_STYLE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_REMOTE_SEARCH_NUM_RESULTS
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_REPLY_AFTER_QUOTE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_RINGTONE_URI
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_SORT_ASCENDING
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_SORT_TYPE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_STRIP_SIGNATURE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_SYNC_INTERVAL
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.UNASSIGNED_ACCOUNT_NUMBER
-import app.k9mail.legacy.account.Expunge
-import app.k9mail.legacy.account.FolderMode
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
-import app.k9mail.legacy.account.ShowPictures
 import com.fsck.k9.CoreResourceProvider
 import com.fsck.k9.K9
+import net.thunderbird.core.android.account.AccountDefaultsProvider
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MAXIMUM_AUTO_DOWNLOAD_MESSAGE_SIZE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT_AUTO
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_READ_RECEIPT
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTED_TEXT_SHOWN
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_PREFIX
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_STYLE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_REMOTE_SEARCH_NUM_RESULTS
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_REPLY_AFTER_QUOTE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_RINGTONE_URI
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_SORT_ASCENDING
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_SORT_TYPE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_STRIP_SIGNATURE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_SYNC_INTERVAL
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.UNASSIGNED_ACCOUNT_NUMBER
+import net.thunderbird.core.android.account.Expunge
+import net.thunderbird.core.android.account.FolderMode
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.ShowPictures
 import net.thunderbird.core.mail.folder.api.SpecialFolderSelection
 import net.thunderbird.core.preferences.Storage
 import net.thunderbird.feature.notification.NotificationLight
diff --git a/app-common/src/main/kotlin/net/thunderbird/app/common/account/data/CommonAccountProfileLocalDataSource.kt b/app-common/src/main/kotlin/net/thunderbird/app/common/account/data/CommonAccountProfileLocalDataSource.kt
index a4731f6d06c..7a0520c81ef 100644
--- a/app-common/src/main/kotlin/net/thunderbird/app/common/account/data/CommonAccountProfileLocalDataSource.kt
+++ b/app-common/src/main/kotlin/net/thunderbird/app/common/account/data/CommonAccountProfileLocalDataSource.kt
@@ -1,9 +1,9 @@
 package net.thunderbird.app.common.account.data
 
-import app.k9mail.legacy.account.LegacyAccountWrapperManager
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.firstOrNull
 import kotlinx.coroutines.flow.map
+import net.thunderbird.core.android.account.LegacyAccountWrapperManager
 import net.thunderbird.feature.account.api.AccountId
 import net.thunderbird.feature.account.api.profile.AccountProfile
 import net.thunderbird.feature.account.core.AccountCoreExternalContract.AccountProfileLocalDataSource
diff --git a/app-common/src/main/kotlin/net/thunderbird/app/common/account/data/CommonLegacyAccountWrapperManager.kt b/app-common/src/main/kotlin/net/thunderbird/app/common/account/data/CommonLegacyAccountWrapperManager.kt
index 53b4a5bb890..0ef0736252a 100644
--- a/app-common/src/main/kotlin/net/thunderbird/app/common/account/data/CommonLegacyAccountWrapperManager.kt
+++ b/app-common/src/main/kotlin/net/thunderbird/app/common/account/data/CommonLegacyAccountWrapperManager.kt
@@ -1,10 +1,10 @@
 package net.thunderbird.app.common.account.data
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccountWrapper
-import app.k9mail.legacy.account.LegacyAccountWrapperManager
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.map
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccountWrapper
+import net.thunderbird.core.android.account.LegacyAccountWrapperManager
 
 internal class CommonLegacyAccountWrapperManager(
     private val accountManager: AccountManager,
diff --git a/app-k9mail/src/debug/kotlin/app/k9mail/dev/DemoBackendFactory.kt b/app-k9mail/src/debug/kotlin/app/k9mail/dev/DemoBackendFactory.kt
index 9a12c3eab06..e0e5cec09a6 100644
--- a/app-k9mail/src/debug/kotlin/app/k9mail/dev/DemoBackendFactory.kt
+++ b/app-k9mail/src/debug/kotlin/app/k9mail/dev/DemoBackendFactory.kt
@@ -1,10 +1,10 @@
 package app.k9mail.dev
 
 import app.k9mail.backend.demo.DemoBackend
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.backend.BackendFactory
 import com.fsck.k9.backend.api.Backend
 import com.fsck.k9.mailstore.K9BackendStorageFactory
+import net.thunderbird.core.android.account.LegacyAccount
 
 class DemoBackendFactory(private val backendStorageFactory: K9BackendStorageFactory) : BackendFactory {
     override fun createBackend(account: LegacyAccount): Backend {
diff --git a/app-thunderbird/src/debug/kotlin/net/thunderbird/android/dev/DemoBackendFactory.kt b/app-thunderbird/src/debug/kotlin/net/thunderbird/android/dev/DemoBackendFactory.kt
index ab72693c997..2ea09b7a1cf 100644
--- a/app-thunderbird/src/debug/kotlin/net/thunderbird/android/dev/DemoBackendFactory.kt
+++ b/app-thunderbird/src/debug/kotlin/net/thunderbird/android/dev/DemoBackendFactory.kt
@@ -1,10 +1,10 @@
 package net.thunderbird.android.dev
 
 import app.k9mail.backend.demo.DemoBackend
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.backend.BackendFactory
 import com.fsck.k9.backend.api.Backend
 import com.fsck.k9.mailstore.K9BackendStorageFactory
+import net.thunderbird.core.android.account.LegacyAccount
 
 class DemoBackendFactory(private val backendStorageFactory: K9BackendStorageFactory) : BackendFactory {
     override fun createBackend(account: LegacyAccount): Backend {
diff --git a/legacy/account/build.gradle.kts b/core/android/account/build.gradle.kts
similarity index 87%
rename from legacy/account/build.gradle.kts
rename to core/android/account/build.gradle.kts
index 29e4f3fb2a9..9bed9101e13 100644
--- a/legacy/account/build.gradle.kts
+++ b/core/android/account/build.gradle.kts
@@ -4,7 +4,7 @@ plugins {
 }
 
 android {
-    namespace = "app.k9mail.legacy.account"
+    namespace = "net.thunderbird.core.android.account"
 }
 
 dependencies {
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/AccountDefaultsProvider.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountDefaultsProvider.kt
similarity index 96%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/AccountDefaultsProvider.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountDefaultsProvider.kt
index dbb481a44f1..a24e0eaacfb 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/AccountDefaultsProvider.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountDefaultsProvider.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 import net.thunderbird.core.preferences.Storage
 
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/AccountManager.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountManager.kt
similarity index 93%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/AccountManager.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountManager.kt
index 642fe7860ee..f0851247352 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/AccountManager.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountManager.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 import kotlinx.coroutines.flow.Flow
 
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/AccountRemovedListener.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountRemovedListener.kt
similarity index 66%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/AccountRemovedListener.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountRemovedListener.kt
index 3f3371e9346..308c36cb87e 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/AccountRemovedListener.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountRemovedListener.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 fun interface AccountRemovedListener {
     fun onAccountRemoved(account: LegacyAccount)
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/AccountsChangeListener.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountsChangeListener.kt
similarity index 60%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/AccountsChangeListener.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountsChangeListener.kt
index ab0a52071f8..f1776a7979c 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/AccountsChangeListener.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/AccountsChangeListener.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 fun interface AccountsChangeListener {
     fun onAccountsChanged()
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/DeletePolicy.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/DeletePolicy.kt
similarity index 89%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/DeletePolicy.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/DeletePolicy.kt
index b1dcbfeec10..40593cce831 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/DeletePolicy.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/DeletePolicy.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 @Suppress("MagicNumber")
 enum class DeletePolicy(@JvmField val setting: Int) {
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/Expunge.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/Expunge.kt
similarity index 89%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/Expunge.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/Expunge.kt
index 38ad624679b..4fa1e549f0b 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/Expunge.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/Expunge.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 import com.fsck.k9.backend.api.SyncConfig.ExpungePolicy
 
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/FolderMode.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/FolderMode.kt
similarity index 71%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/FolderMode.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/FolderMode.kt
index 844430d7ae6..90d31685c39 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/FolderMode.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/FolderMode.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 enum class FolderMode {
     NONE,
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/Identity.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/Identity.kt
similarity index 93%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/Identity.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/Identity.kt
index 72652544535..b35fe50da6b 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/Identity.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/Identity.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 import android.os.Parcelable
 import kotlinx.parcelize.Parcelize
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/LegacyAccount.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/LegacyAccount.kt
similarity index 99%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/LegacyAccount.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/LegacyAccount.kt
index e399f8c7e1e..c5aa6c03fd6 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/LegacyAccount.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/LegacyAccount.kt
@@ -1,11 +1,11 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
 import com.fsck.k9.mail.Address
 import com.fsck.k9.mail.ServerSettings
 import java.util.Calendar
 import java.util.Date
 import net.thunderbird.core.account.BaseAccount
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
 import net.thunderbird.core.mail.folder.api.SpecialFolderSelection
 import net.thunderbird.feature.notification.NotificationSettings
 
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/LegacyAccountWrapper.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/LegacyAccountWrapper.kt
similarity index 99%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/LegacyAccountWrapper.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/LegacyAccountWrapper.kt
index 2e82ba9f033..6f48000269c 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/LegacyAccountWrapper.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/LegacyAccountWrapper.kt
@@ -1,8 +1,8 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
 import com.fsck.k9.mail.ServerSettings
 import net.thunderbird.core.account.BaseAccount
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
 import net.thunderbird.core.mail.folder.api.SpecialFolderSelection
 import net.thunderbird.feature.notification.NotificationSettings
 
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/LegacyAccountWrapperManager.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/LegacyAccountWrapperManager.kt
similarity index 84%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/LegacyAccountWrapperManager.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/LegacyAccountWrapperManager.kt
index 5c4ab175d94..e876b1cd6c4 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/LegacyAccountWrapperManager.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/LegacyAccountWrapperManager.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 import kotlinx.coroutines.flow.Flow
 
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/MessageFormat.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/MessageFormat.kt
similarity index 57%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/MessageFormat.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/MessageFormat.kt
index df1b859c662..a3cd5616e4f 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/MessageFormat.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/MessageFormat.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 enum class MessageFormat {
     TEXT,
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/ShowPictures.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/ShowPictures.kt
similarity index 62%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/ShowPictures.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/ShowPictures.kt
index 6d7a122bd43..0a95c71f122 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/ShowPictures.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/ShowPictures.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 enum class ShowPictures {
     NEVER,
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/SortType.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/SortType.kt
similarity index 83%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/SortType.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/SortType.kt
index c8caf7cdca7..22bba8b7dc6 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/SortType.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/SortType.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 enum class SortType(val isDefaultAscending: Boolean) {
     SORT_DATE(false),
diff --git a/feature/migration/provider/src/main/kotlin/app/k9mail/feature/migration/provider/SettingsProvider.kt b/feature/migration/provider/src/main/kotlin/app/k9mail/feature/migration/provider/SettingsProvider.kt
index 94a8ecdf787..5456abbe716 100644
--- a/feature/migration/provider/src/main/kotlin/app/k9mail/feature/migration/provider/SettingsProvider.kt
+++ b/feature/migration/provider/src/main/kotlin/app/k9mail/feature/migration/provider/SettingsProvider.kt
@@ -9,11 +9,11 @@ import android.database.Cursor
 import android.net.Uri
 import android.os.Build
 import android.os.ParcelFileDescriptor
-import app.k9mail.legacy.account.AccountManager
 import com.fsck.k9.helper.MimeTypeUtil
 import com.fsck.k9.helper.mapToSet
 import com.fsck.k9.preferences.SettingsExporter
 import kotlin.concurrent.thread
+import net.thunderbird.core.android.account.AccountManager
 import okio.ByteString.Companion.toByteString
 import org.koin.android.ext.android.inject
 import org.koin.core.component.KoinComponent
diff --git a/feature/migration/qrcode/build.gradle.kts b/feature/migration/qrcode/build.gradle.kts
index 7a834136f4b..546092a3347 100644
--- a/feature/migration/qrcode/build.gradle.kts
+++ b/feature/migration/qrcode/build.gradle.kts
@@ -9,7 +9,7 @@ android {
 
 dependencies {
     implementation(projects.core.common)
-    implementation(projects.legacy.account)
+    implementation(projects.core.android.account)
     implementation(projects.legacy.common)
     implementation(projects.legacy.ui.base)
     implementation(projects.core.ui.compose.designsystem)
diff --git a/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/domain/entity/AccountData.kt b/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/domain/entity/AccountData.kt
index 29b94def0fb..218be8174ba 100644
--- a/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/domain/entity/AccountData.kt
+++ b/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/domain/entity/AccountData.kt
@@ -3,7 +3,7 @@ package app.k9mail.feature.migration.qrcode.domain.entity
 import app.k9mail.core.common.mail.EmailAddress
 import app.k9mail.core.common.net.Hostname
 import app.k9mail.core.common.net.Port
-import app.k9mail.legacy.account.DeletePolicy
+import net.thunderbird.core.android.account.DeletePolicy
 
 internal data class AccountData(
     val sequenceNumber: Int,
diff --git a/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/payload/QrCodePayloadMapper.kt b/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/payload/QrCodePayloadMapper.kt
index d91fe143da2..085c2ceb937 100644
--- a/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/payload/QrCodePayloadMapper.kt
+++ b/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/payload/QrCodePayloadMapper.kt
@@ -6,8 +6,8 @@ import app.k9mail.core.common.net.toHostname
 import app.k9mail.core.common.net.toPort
 import app.k9mail.feature.migration.qrcode.domain.entity.AccountData
 import app.k9mail.feature.migration.qrcode.domain.entity.AccountData.IncomingServerProtocol
-import app.k9mail.legacy.account.DeletePolicy
 import com.fsck.k9.account.DeletePolicyProvider
+import net.thunderbird.core.android.account.DeletePolicy
 
 internal class QrCodePayloadMapper(
     private val qrCodePayloadValidator: QrCodePayloadValidator,
diff --git a/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/settings/XmlSettingWriter.kt b/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/settings/XmlSettingWriter.kt
index fb6fcb3ea01..9dc6782d448 100644
--- a/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/settings/XmlSettingWriter.kt
+++ b/feature/migration/qrcode/src/main/kotlin/app/k9mail/feature/migration/qrcode/settings/XmlSettingWriter.kt
@@ -6,8 +6,8 @@ import app.k9mail.feature.migration.qrcode.domain.entity.AccountData.Identity
 import app.k9mail.feature.migration.qrcode.domain.entity.AccountData.IncomingServer
 import app.k9mail.feature.migration.qrcode.domain.entity.AccountData.OutgoingServer
 import app.k9mail.feature.migration.qrcode.domain.entity.AccountData.OutgoingServerGroup
-import app.k9mail.legacy.account.DeletePolicy
 import java.io.OutputStream
+import net.thunderbird.core.android.account.DeletePolicy
 import org.xmlpull.v1.XmlSerializer
 
 // TODO: This duplicates much of the code in SettingsExporter. Add an abstraction layer for the input data, so we can
diff --git a/feature/navigation/drawer/dropdown/build.gradle.kts b/feature/navigation/drawer/dropdown/build.gradle.kts
index 32de0aef230..458d30e10ea 100644
--- a/feature/navigation/drawer/dropdown/build.gradle.kts
+++ b/feature/navigation/drawer/dropdown/build.gradle.kts
@@ -19,7 +19,7 @@ dependencies {
 
     implementation(projects.feature.search)
     implementation(projects.core.account)
-    implementation(projects.legacy.account)
+    implementation(projects.core.android.account)
     implementation(projects.legacy.mailstore)
     implementation(projects.legacy.message)
     implementation(projects.legacy.ui.folder)
diff --git a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/GetDisplayAccounts.kt b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/GetDisplayAccounts.kt
index e8370f63b4e..797630724d9 100644
--- a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/GetDisplayAccounts.kt
+++ b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/GetDisplayAccounts.kt
@@ -1,7 +1,5 @@
 package net.thunderbird.feature.navigation.drawer.dropdown.domain.usecase
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageListChangedListener
 import app.k9mail.legacy.mailstore.MessageListRepository
 import app.k9mail.legacy.message.controller.MessageCounts
@@ -16,6 +14,8 @@ import kotlinx.coroutines.flow.combine
 import kotlinx.coroutines.flow.flatMapLatest
 import kotlinx.coroutines.flow.flowOn
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.navigation.drawer.dropdown.domain.DomainContract.UseCase
 import net.thunderbird.feature.navigation.drawer.dropdown.domain.entity.DisplayAccount
 
diff --git a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/SyncAccount.kt b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/SyncAccount.kt
index 48c196fe696..f3fc7c47098 100644
--- a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/SyncAccount.kt
+++ b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/SyncAccount.kt
@@ -1,8 +1,6 @@
 package net.thunderbird.feature.navigation.drawer.dropdown.domain.usecase
 
 import android.content.Context
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessagingControllerMailChecker
 import app.k9mail.legacy.message.controller.SimpleMessagingListener
 import kotlin.coroutines.CoroutineContext
@@ -11,6 +9,8 @@ import kotlinx.coroutines.channels.awaitClose
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.callbackFlow
 import kotlinx.coroutines.flow.flowOn
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.navigation.drawer.dropdown.domain.DomainContract.UseCase
 
 internal class SyncAccount(
diff --git a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/SyncAllAccounts.kt b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/SyncAllAccounts.kt
index 5770b2cacd3..bc058d9c91c 100644
--- a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/SyncAllAccounts.kt
+++ b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/SyncAllAccounts.kt
@@ -1,7 +1,6 @@
 package net.thunderbird.feature.navigation.drawer.dropdown.domain.usecase
 
 import android.content.Context
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessagingControllerMailChecker
 import app.k9mail.legacy.message.controller.SimpleMessagingListener
 import kotlin.coroutines.CoroutineContext
@@ -10,6 +9,7 @@ import kotlinx.coroutines.channels.awaitClose
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.callbackFlow
 import kotlinx.coroutines.flow.flowOn
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.navigation.drawer.dropdown.domain.DomainContract.UseCase
 
 class SyncAllAccounts(
diff --git a/feature/navigation/drawer/siderail/build.gradle.kts b/feature/navigation/drawer/siderail/build.gradle.kts
index 09f861ef420..939a2bdeb0c 100644
--- a/feature/navigation/drawer/siderail/build.gradle.kts
+++ b/feature/navigation/drawer/siderail/build.gradle.kts
@@ -18,7 +18,7 @@ dependencies {
 
     implementation(projects.feature.account.avatar)
 
-    implementation(projects.legacy.account)
+    implementation(projects.core.android.account)
     implementation(projects.legacy.mailstore)
     implementation(projects.legacy.message)
     implementation(projects.feature.search)
diff --git a/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/GetDisplayAccounts.kt b/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/GetDisplayAccounts.kt
index 9f6952cf4a7..6218546f8cd 100644
--- a/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/GetDisplayAccounts.kt
+++ b/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/GetDisplayAccounts.kt
@@ -1,7 +1,5 @@
 package net.thunderbird.feature.navigation.drawer.siderail.domain.usecase
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageListChangedListener
 import app.k9mail.legacy.mailstore.MessageListRepository
 import app.k9mail.legacy.message.controller.MessageCounts
@@ -16,6 +14,8 @@ import kotlinx.coroutines.flow.combine
 import kotlinx.coroutines.flow.flatMapLatest
 import kotlinx.coroutines.flow.flowOn
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.navigation.drawer.siderail.domain.DomainContract
 import net.thunderbird.feature.navigation.drawer.siderail.domain.entity.DisplayAccount
 
diff --git a/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/SyncAccount.kt b/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/SyncAccount.kt
index c22f52489f1..3717f371db7 100644
--- a/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/SyncAccount.kt
+++ b/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/SyncAccount.kt
@@ -1,8 +1,6 @@
 package net.thunderbird.feature.navigation.drawer.siderail.domain.usecase
 
 import android.content.Context
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessagingControllerMailChecker
 import app.k9mail.legacy.message.controller.SimpleMessagingListener
 import kotlin.coroutines.CoroutineContext
@@ -11,6 +9,8 @@ import kotlinx.coroutines.channels.awaitClose
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.callbackFlow
 import kotlinx.coroutines.flow.flowOn
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.navigation.drawer.siderail.domain.DomainContract
 
 internal class SyncAccount(
diff --git a/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/SyncAllAccounts.kt b/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/SyncAllAccounts.kt
index f53053ea53a..027c85d45ed 100644
--- a/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/SyncAllAccounts.kt
+++ b/feature/navigation/drawer/siderail/src/main/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/SyncAllAccounts.kt
@@ -1,7 +1,6 @@
 package net.thunderbird.feature.navigation.drawer.siderail.domain.usecase
 
 import android.content.Context
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessagingControllerMailChecker
 import app.k9mail.legacy.message.controller.SimpleMessagingListener
 import kotlin.coroutines.CoroutineContext
@@ -10,6 +9,7 @@ import kotlinx.coroutines.channels.awaitClose
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.callbackFlow
 import kotlinx.coroutines.flow.flowOn
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.navigation.drawer.siderail.domain.DomainContract
 
 class SyncAllAccounts(
diff --git a/feature/settings/import/src/main/kotlin/app/k9mail/feature/settings/import/ui/AuthViewModel.kt b/feature/settings/import/src/main/kotlin/app/k9mail/feature/settings/import/ui/AuthViewModel.kt
index f0a0dd331a4..b9acc3922ec 100644
--- a/feature/settings/import/src/main/kotlin/app/k9mail/feature/settings/import/ui/AuthViewModel.kt
+++ b/feature/settings/import/src/main/kotlin/app/k9mail/feature/settings/import/ui/AuthViewModel.kt
@@ -15,8 +15,6 @@ import androidx.lifecycle.LifecycleOwner
 import androidx.lifecycle.viewModelScope
 import app.k9mail.feature.account.oauth.domain.AccountOAuthDomainContract.UseCase.GetOAuthRequestIntent
 import app.k9mail.feature.account.oauth.domain.entity.AuthorizationIntentResult
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.flow.MutableStateFlow
 import kotlinx.coroutines.flow.StateFlow
@@ -28,6 +26,8 @@ import net.openid.appauth.AuthState
 import net.openid.appauth.AuthorizationException
 import net.openid.appauth.AuthorizationResponse
 import net.openid.appauth.AuthorizationService
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 private const val KEY_AUTHORIZATION = "app.k9mail_auth"
diff --git a/feature/settings/import/src/main/kotlin/app/k9mail/feature/settings/import/ui/OAuthFlowActivity.kt b/feature/settings/import/src/main/kotlin/app/k9mail/feature/settings/import/ui/OAuthFlowActivity.kt
index e139f6544d4..ea1b072af89 100644
--- a/feature/settings/import/src/main/kotlin/app/k9mail/feature/settings/import/ui/OAuthFlowActivity.kt
+++ b/feature/settings/import/src/main/kotlin/app/k9mail/feature/settings/import/ui/OAuthFlowActivity.kt
@@ -11,12 +11,12 @@ import androidx.lifecycle.LifecycleOwner
 import androidx.lifecycle.lifecycleScope
 import androidx.lifecycle.repeatOnLifecycle
 import app.k9mail.feature.settings.importing.R
-import app.k9mail.legacy.account.AccountManager
 import com.fsck.k9.ui.base.K9Activity
 import com.google.android.material.textview.MaterialTextView
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.FlowCollector
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.AccountManager
 import org.koin.android.ext.android.inject
 import org.koin.androidx.viewmodel.ext.android.viewModel
 
diff --git a/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListConfig.kt b/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListConfig.kt
index 2cf42cf77d3..371a84c3245 100644
--- a/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListConfig.kt
+++ b/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListConfig.kt
@@ -1,6 +1,6 @@
 package net.thunderbird.feature.widget.message.list
 
-import app.k9mail.legacy.account.SortType
+import net.thunderbird.core.android.account.SortType
 import net.thunderbird.feature.search.LocalSearch
 
 internal data class MessageListConfig(
diff --git a/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListItemMapper.kt b/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListItemMapper.kt
index 63bf918d5e0..730feb3cb46 100644
--- a/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListItemMapper.kt
+++ b/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListItemMapper.kt
@@ -1,6 +1,5 @@
 package net.thunderbird.feature.widget.message.list
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageDetailsAccessor
 import app.k9mail.legacy.mailstore.MessageMapper
 import app.k9mail.legacy.message.controller.MessageReference
@@ -8,6 +7,7 @@ import com.fsck.k9.helper.MessageHelper
 import com.fsck.k9.ui.helper.DisplayAddressHelper
 import java.util.Calendar
 import java.util.Locale
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class MessageListItemMapper(
     private val messageHelper: MessageHelper,
diff --git a/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListLoader.kt b/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListLoader.kt
index bcde614217c..1c46d56e322 100644
--- a/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListLoader.kt
+++ b/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListLoader.kt
@@ -1,13 +1,13 @@
 package net.thunderbird.feature.widget.message.list
 
-import app.k9mail.legacy.account.LegacyAccount
-import app.k9mail.legacy.account.SortType
 import app.k9mail.legacy.mailstore.MessageListRepository
 import com.fsck.k9.Preferences
 import com.fsck.k9.helper.MessageHelper
 import com.fsck.k9.mailstore.MessageColumns
 import com.fsck.k9.search.SqlQueryBuilder
 import com.fsck.k9.search.getAccounts
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.SortType
 import timber.log.Timber
 
 internal class MessageListLoader(
diff --git a/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListWidget.kt b/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListWidget.kt
index ff3450b3e41..6e009f89560 100644
--- a/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListWidget.kt
+++ b/feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListWidget.kt
@@ -11,7 +11,6 @@ import androidx.core.app.PendingIntentCompat
 import androidx.glance.GlanceId
 import androidx.glance.appwidget.GlanceAppWidget
 import androidx.glance.appwidget.provideContent
-import app.k9mail.legacy.account.SortType
 import com.fsck.k9.CoreResourceProvider
 import com.fsck.k9.K9
 import com.fsck.k9.activity.MessageList.Companion.intentDisplaySearch
@@ -20,6 +19,7 @@ import kotlinx.collections.immutable.toImmutableList
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.SortType
 import net.thunderbird.feature.search.SearchAccount.Companion.createUnifiedInboxAccount
 import net.thunderbird.feature.widget.message.list.ui.MessageListWidgetContent
 import org.koin.core.component.KoinComponent
diff --git a/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListConfig.kt b/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListConfig.kt
index fc4f3fc5099..19ce47be1e1 100644
--- a/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListConfig.kt
+++ b/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListConfig.kt
@@ -1,6 +1,6 @@
 package app.k9mail.feature.widget.message.list
 
-import app.k9mail.legacy.account.SortType
+import net.thunderbird.core.android.account.SortType
 import net.thunderbird.feature.search.LocalSearch
 
 internal data class MessageListConfig(
diff --git a/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListItemMapper.kt b/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListItemMapper.kt
index 122188b6313..7aa00a6e1eb 100644
--- a/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListItemMapper.kt
+++ b/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListItemMapper.kt
@@ -1,6 +1,5 @@
 package app.k9mail.feature.widget.message.list
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageDetailsAccessor
 import app.k9mail.legacy.mailstore.MessageMapper
 import app.k9mail.legacy.message.controller.MessageReference
@@ -8,6 +7,7 @@ import com.fsck.k9.helper.MessageHelper
 import com.fsck.k9.ui.helper.DisplayAddressHelper
 import java.util.Calendar
 import java.util.Locale
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class MessageListItemMapper(
     private val messageHelper: MessageHelper,
diff --git a/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListLoader.kt b/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListLoader.kt
index 98149433f40..7e0f5f77016 100644
--- a/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListLoader.kt
+++ b/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListLoader.kt
@@ -1,13 +1,13 @@
 package app.k9mail.feature.widget.message.list
 
-import app.k9mail.legacy.account.LegacyAccount
-import app.k9mail.legacy.account.SortType
 import app.k9mail.legacy.mailstore.MessageListRepository
 import com.fsck.k9.Preferences
 import com.fsck.k9.helper.MessageHelper
 import com.fsck.k9.mailstore.MessageColumns
 import com.fsck.k9.search.SqlQueryBuilder
 import com.fsck.k9.search.getAccounts
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.SortType
 import timber.log.Timber
 
 internal class MessageListLoader(
diff --git a/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListRemoteViewFactory.kt b/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListRemoteViewFactory.kt
index eae6e3ed7fd..e89699bd775 100644
--- a/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListRemoteViewFactory.kt
+++ b/feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/MessageListRemoteViewFactory.kt
@@ -8,10 +8,10 @@ import android.view.View
 import android.widget.RemoteViews
 import android.widget.RemoteViewsService.RemoteViewsFactory
 import androidx.core.content.ContextCompat
-import app.k9mail.legacy.account.SortType
 import com.fsck.k9.CoreResourceProvider
 import com.fsck.k9.K9
 import com.fsck.k9.activity.MessageList
+import net.thunderbird.core.android.account.SortType
 import net.thunderbird.feature.search.LocalSearch
 import net.thunderbird.feature.search.SearchAccount
 import org.koin.core.component.KoinComponent
diff --git a/feature/widget/shortcut/build.gradle.kts b/feature/widget/shortcut/build.gradle.kts
index 3016c2fe507..426af12ab30 100644
--- a/feature/widget/shortcut/build.gradle.kts
+++ b/feature/widget/shortcut/build.gradle.kts
@@ -5,7 +5,7 @@ plugins {
 dependencies {
     implementation(projects.legacy.ui.legacy)
     implementation(projects.legacy.core)
-    implementation(projects.legacy.account)
+    implementation(projects.core.android.account)
 }
 
 android {
diff --git a/feature/widget/unread/build.gradle.kts b/feature/widget/unread/build.gradle.kts
index d71f3c5293f..4f714e70fe2 100644
--- a/feature/widget/unread/build.gradle.kts
+++ b/feature/widget/unread/build.gradle.kts
@@ -6,7 +6,7 @@ dependencies {
     implementation(projects.core.account)
     implementation(projects.legacy.ui.legacy)
     implementation(projects.legacy.core)
-    implementation(projects.legacy.account)
+    implementation(projects.core.android.account)
 
     implementation(libs.preferencex)
     implementation(libs.timber)
diff --git a/feature/widget/unread/src/main/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetDataProvider.kt b/feature/widget/unread/src/main/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetDataProvider.kt
index 40a9453658d..37455c6b1f6 100644
--- a/feature/widget/unread/src/main/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetDataProvider.kt
+++ b/feature/widget/unread/src/main/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetDataProvider.kt
@@ -2,7 +2,6 @@ package app.k9mail.feature.widget.unread
 
 import android.content.Context
 import android.content.Intent
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import app.k9mail.legacy.message.controller.MessageCountsProvider
 import app.k9mail.legacy.ui.folder.FolderNameFormatter
@@ -10,6 +9,7 @@ import com.fsck.k9.CoreResourceProvider
 import com.fsck.k9.Preferences
 import com.fsck.k9.activity.MessageList
 import com.fsck.k9.ui.messagelist.DefaultFolderProvider
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.LocalSearch
 import net.thunderbird.feature.search.SearchAccount
 import timber.log.Timber
diff --git a/feature/widget/unread/src/main/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetUpdateListener.kt b/feature/widget/unread/src/main/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetUpdateListener.kt
index b3fc71c8b55..af1f8f737cc 100644
--- a/feature/widget/unread/src/main/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetUpdateListener.kt
+++ b/feature/widget/unread/src/main/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetUpdateListener.kt
@@ -1,8 +1,8 @@
 package app.k9mail.feature.widget.unread
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.SimpleMessagingListener
 import com.fsck.k9.mail.Message
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 class UnreadWidgetUpdateListener(
diff --git a/legacy/common/src/main/java/com/fsck/k9/account/AccountActivator.kt b/legacy/common/src/main/java/com/fsck/k9/account/AccountActivator.kt
index ae1cf155582..28664037b7e 100644
--- a/legacy/common/src/main/java/com/fsck/k9/account/AccountActivator.kt
+++ b/legacy/common/src/main/java/com/fsck/k9/account/AccountActivator.kt
@@ -2,10 +2,10 @@ package com.fsck.k9.account
 
 import android.content.Context
 import app.k9mail.feature.settings.import.SettingsImportExternalContract
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.Core
 import com.fsck.k9.Preferences
 import com.fsck.k9.controller.MessagingController
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Activate account after server password(s) have been provided on settings import.
diff --git a/legacy/common/src/main/java/com/fsck/k9/account/AccountServerSettingsUpdater.kt b/legacy/common/src/main/java/com/fsck/k9/account/AccountServerSettingsUpdater.kt
index da5da7fbcf7..62d473f3a6c 100644
--- a/legacy/common/src/main/java/com/fsck/k9/account/AccountServerSettingsUpdater.kt
+++ b/legacy/common/src/main/java/com/fsck/k9/account/AccountServerSettingsUpdater.kt
@@ -5,7 +5,6 @@ import app.k9mail.feature.account.common.domain.entity.AuthorizationState
 import app.k9mail.feature.account.edit.AccountEditExternalContract
 import app.k9mail.feature.account.edit.AccountEditExternalContract.AccountUpdaterFailure
 import app.k9mail.feature.account.edit.AccountEditExternalContract.AccountUpdaterResult
-import app.k9mail.legacy.account.AccountManager
 import com.fsck.k9.logging.Timber
 import com.fsck.k9.mail.ServerSettings
 import com.fsck.k9.mail.store.imap.ImapStoreSettings
@@ -16,6 +15,7 @@ import com.fsck.k9.mail.store.imap.ImapStoreSettings.pathPrefix
 import kotlinx.coroutines.CoroutineDispatcher
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.withContext
+import net.thunderbird.core.android.account.AccountManager
 
 class AccountServerSettingsUpdater(
     private val accountManager: AccountManager,
diff --git a/legacy/common/src/main/java/com/fsck/k9/account/AccountStateLoader.kt b/legacy/common/src/main/java/com/fsck/k9/account/AccountStateLoader.kt
index d9330994659..4307187bf4a 100644
--- a/legacy/common/src/main/java/com/fsck/k9/account/AccountStateLoader.kt
+++ b/legacy/common/src/main/java/com/fsck/k9/account/AccountStateLoader.kt
@@ -4,15 +4,15 @@ import app.k9mail.core.common.mail.Protocols
 import app.k9mail.feature.account.common.AccountCommonExternalContract
 import app.k9mail.feature.account.common.domain.entity.AccountState
 import app.k9mail.feature.account.common.domain.entity.AuthorizationState
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.backends.toImapServerSettings
 import com.fsck.k9.logging.Timber
 import com.fsck.k9.mail.ServerSettings
 import kotlinx.coroutines.CoroutineDispatcher
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.withContext
-import app.k9mail.legacy.account.LegacyAccount as K9Account
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount as K9Account
 
 class AccountStateLoader(
     private val accountManager: AccountManager,
diff --git a/legacy/common/src/main/java/com/fsck/k9/account/DefaultDeletePolicyProvider.kt b/legacy/common/src/main/java/com/fsck/k9/account/DefaultDeletePolicyProvider.kt
index 411c28320e4..4c8496a1f8a 100644
--- a/legacy/common/src/main/java/com/fsck/k9/account/DefaultDeletePolicyProvider.kt
+++ b/legacy/common/src/main/java/com/fsck/k9/account/DefaultDeletePolicyProvider.kt
@@ -1,7 +1,7 @@
 package com.fsck.k9.account
 
 import app.k9mail.core.common.mail.Protocols
-import app.k9mail.legacy.account.DeletePolicy
+import net.thunderbird.core.android.account.DeletePolicy
 
 class DefaultDeletePolicyProvider : DeletePolicyProvider {
     override fun getDeletePolicy(accountType: String): DeletePolicy {
diff --git a/legacy/common/src/main/java/com/fsck/k9/account/DeletePolicyProvider.kt b/legacy/common/src/main/java/com/fsck/k9/account/DeletePolicyProvider.kt
index 23a5f336234..770b0ab8f5d 100644
--- a/legacy/common/src/main/java/com/fsck/k9/account/DeletePolicyProvider.kt
+++ b/legacy/common/src/main/java/com/fsck/k9/account/DeletePolicyProvider.kt
@@ -1,7 +1,7 @@
 package com.fsck.k9.account
 
 import app.k9mail.core.common.mail.Protocols
-import app.k9mail.legacy.account.DeletePolicy
+import net.thunderbird.core.android.account.DeletePolicy
 
 /**
  * Decides which [DeletePolicy] an account uses by default.
diff --git a/legacy/common/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt b/legacy/common/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt
index 83b626ebfe1..eb6dfefd95a 100644
--- a/legacy/common/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt
+++ b/legacy/common/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt
@@ -1,9 +1,6 @@
 package com.fsck.k9.backends
 
 import android.content.Context
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.Expunge
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.backend.BackendFactory
 import com.fsck.k9.backend.api.Backend
 import com.fsck.k9.backend.imap.ImapBackend
@@ -21,6 +18,9 @@ import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.distinctUntilChanged
 import kotlinx.coroutines.flow.filterNotNull
 import kotlinx.coroutines.flow.map
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.Expunge
+import net.thunderbird.core.android.account.LegacyAccount
 
 @Suppress("LongParameterList")
 class ImapBackendFactory(
diff --git a/legacy/common/src/main/java/com/fsck/k9/backends/ImapServerSettingsExtensions.kt b/legacy/common/src/main/java/com/fsck/k9/backends/ImapServerSettingsExtensions.kt
index 0c500bea9ed..e7b4ba2cb54 100644
--- a/legacy/common/src/main/java/com/fsck/k9/backends/ImapServerSettingsExtensions.kt
+++ b/legacy/common/src/main/java/com/fsck/k9/backends/ImapServerSettingsExtensions.kt
@@ -1,10 +1,10 @@
 package com.fsck.k9.backends
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.mail.ServerSettings
 import com.fsck.k9.mail.store.imap.ImapStoreSettings
 import com.fsck.k9.mail.store.imap.ImapStoreSettings.autoDetectNamespace
 import com.fsck.k9.mail.store.imap.ImapStoreSettings.pathPrefix
+import net.thunderbird.core.android.account.LegacyAccount
 
 fun LegacyAccount.toImapServerSettings(): ServerSettings {
     val serverSettings = incomingServerSettings
diff --git a/legacy/common/src/main/java/com/fsck/k9/backends/Pop3BackendFactory.kt b/legacy/common/src/main/java/com/fsck/k9/backends/Pop3BackendFactory.kt
index c6aaf623991..8d1559d9264 100644
--- a/legacy/common/src/main/java/com/fsck/k9/backends/Pop3BackendFactory.kt
+++ b/legacy/common/src/main/java/com/fsck/k9/backends/Pop3BackendFactory.kt
@@ -1,6 +1,5 @@
 package com.fsck.k9.backends
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.backend.BackendFactory
 import com.fsck.k9.backend.api.Backend
 import com.fsck.k9.backend.pop3.Pop3Backend
@@ -9,6 +8,7 @@ import com.fsck.k9.mail.ssl.TrustedSocketFactory
 import com.fsck.k9.mail.store.pop3.Pop3Store
 import com.fsck.k9.mail.transport.smtp.SmtpTransport
 import com.fsck.k9.mailstore.K9BackendStorageFactory
+import net.thunderbird.core.android.account.LegacyAccount
 
 class Pop3BackendFactory(
     private val backendStorageFactory: K9BackendStorageFactory,
diff --git a/legacy/common/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt b/legacy/common/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt
index d40b91e19c8..95676242c36 100644
--- a/legacy/common/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt
+++ b/legacy/common/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt
@@ -9,7 +9,6 @@ import android.net.Uri
 import androidx.core.app.PendingIntentCompat
 import app.k9mail.feature.launcher.FeatureLauncherActivity
 import app.k9mail.feature.launcher.FeatureLauncherTarget
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageStoreManager
 import app.k9mail.legacy.message.controller.MessageReference
 import com.fsck.k9.K9
@@ -17,6 +16,7 @@ import com.fsck.k9.activity.MessageList
 import com.fsck.k9.activity.compose.MessageActions
 import com.fsck.k9.ui.messagelist.DefaultFolderProvider
 import com.fsck.k9.ui.notification.DeleteConfirmationActivity
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.LocalSearch
 
 /**
diff --git a/legacy/common/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt b/legacy/common/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt
index d0b02026779..48eb1b3ab93 100644
--- a/legacy/common/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt
+++ b/legacy/common/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt
@@ -2,13 +2,13 @@ package com.fsck.k9.notification
 
 import app.k9mail.core.android.common.contact.ContactRepository
 import app.k9mail.core.common.mail.toEmailAddressOrNull
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.K9
 import com.fsck.k9.mail.Flag
 import com.fsck.k9.mail.K9MailLib
 import com.fsck.k9.mail.Message
 import com.fsck.k9.mailstore.LocalFolder
 import com.fsck.k9.mailstore.LocalMessage
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 class K9NotificationStrategy(
diff --git a/legacy/core/build.gradle.kts b/legacy/core/build.gradle.kts
index ad63bf6f811..2922914c59c 100644
--- a/legacy/core/build.gradle.kts
+++ b/legacy/core/build.gradle.kts
@@ -9,6 +9,7 @@ dependencies {
     api(projects.library.htmlCleaner)
     api(projects.core.mail.mailserver)
     api(projects.core.android.common)
+    api(projects.core.android.account)
     api(projects.core.preferences)
     api(projects.core.android.logging)
     api(projects.core.android.network)
@@ -17,7 +18,7 @@ dependencies {
 
     api(projects.feature.search)
     api(projects.core.account)
-    api(projects.legacy.account)
+    api(projects.core.android.account)
     api(projects.legacy.di)
     api(projects.legacy.mailstore)
     api(projects.legacy.message)
diff --git a/legacy/core/src/main/java/com/fsck/k9/AccountPreferenceSerializer.kt b/legacy/core/src/main/java/com/fsck/k9/AccountPreferenceSerializer.kt
index a6490400c85..8acf5879e5a 100644
--- a/legacy/core/src/main/java/com/fsck/k9/AccountPreferenceSerializer.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/AccountPreferenceSerializer.kt
@@ -1,30 +1,30 @@
 package com.fsck.k9
 
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MAXIMUM_AUTO_DOWNLOAD_MESSAGE_SIZE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT_AUTO
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_READ_RECEIPT
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTED_TEXT_SHOWN
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_PREFIX
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_STYLE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_REMOTE_SEARCH_NUM_RESULTS
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_REPLY_AFTER_QUOTE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_RINGTONE_URI
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_STRIP_SIGNATURE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_SYNC_INTERVAL
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.UNASSIGNED_ACCOUNT_NUMBER
-import app.k9mail.legacy.account.DeletePolicy
-import app.k9mail.legacy.account.Expunge
-import app.k9mail.legacy.account.FolderMode
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
-import app.k9mail.legacy.account.MessageFormat
-import app.k9mail.legacy.account.QuoteStyle
-import app.k9mail.legacy.account.ShowPictures
-import app.k9mail.legacy.account.SortType
 import com.fsck.k9.helper.Utility
 import com.fsck.k9.preferences.StorageEditor
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MAXIMUM_AUTO_DOWNLOAD_MESSAGE_SIZE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT_AUTO
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_READ_RECEIPT
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTED_TEXT_SHOWN
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_PREFIX
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_STYLE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_REMOTE_SEARCH_NUM_RESULTS
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_REPLY_AFTER_QUOTE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_RINGTONE_URI
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_STRIP_SIGNATURE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_SYNC_INTERVAL
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.UNASSIGNED_ACCOUNT_NUMBER
+import net.thunderbird.core.android.account.DeletePolicy
+import net.thunderbird.core.android.account.Expunge
+import net.thunderbird.core.android.account.FolderMode
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.MessageFormat
+import net.thunderbird.core.android.account.QuoteStyle
+import net.thunderbird.core.android.account.ShowPictures
+import net.thunderbird.core.android.account.SortType
 import net.thunderbird.core.mail.folder.api.SpecialFolderSelection
 import net.thunderbird.core.preferences.Storage
 import net.thunderbird.feature.notification.NotificationLight
diff --git a/legacy/core/src/main/java/com/fsck/k9/K9.kt b/legacy/core/src/main/java/com/fsck/k9/K9.kt
index 9c2fd253a2f..b025c53a226 100644
--- a/legacy/core/src/main/java/com/fsck/k9/K9.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/K9.kt
@@ -5,8 +5,6 @@ import android.content.SharedPreferences
 import app.k9mail.core.featureflag.FeatureFlagProvider
 import app.k9mail.core.featureflag.toFeatureFlagKey
 import app.k9mail.feature.telemetry.api.TelemetryManager
-import app.k9mail.legacy.account.AccountDefaultsProvider
-import app.k9mail.legacy.account.SortType
 import app.k9mail.legacy.di.DI
 import com.fsck.k9.core.BuildConfig
 import com.fsck.k9.logging.Logger
@@ -15,6 +13,8 @@ import com.fsck.k9.mailstore.LocalStore
 import com.fsck.k9.preferences.RealGeneralSettingsManager
 import com.fsck.k9.preferences.StorageEditor
 import kotlinx.datetime.Clock
+import net.thunderbird.core.android.account.AccountDefaultsProvider
+import net.thunderbird.core.android.account.SortType
 import net.thunderbird.core.preferences.Storage
 import org.koin.core.component.KoinComponent
 import org.koin.core.component.inject
diff --git a/legacy/core/src/main/java/com/fsck/k9/LocalKeyStoreManager.kt b/legacy/core/src/main/java/com/fsck/k9/LocalKeyStoreManager.kt
index 4689fb58783..4a7fe2b985e 100644
--- a/legacy/core/src/main/java/com/fsck/k9/LocalKeyStoreManager.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/LocalKeyStoreManager.kt
@@ -1,9 +1,9 @@
 package com.fsck.k9
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.mail.ssl.LocalKeyStore
 import java.security.cert.CertificateException
 import java.security.cert.X509Certificate
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.mail.mailserver.MailServerDirection
 
 class LocalKeyStoreManager(
diff --git a/legacy/core/src/main/java/com/fsck/k9/Preferences.kt b/legacy/core/src/main/java/com/fsck/k9/Preferences.kt
index ed38273f39c..90dddb8ced5 100644
--- a/legacy/core/src/main/java/com/fsck/k9/Preferences.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/Preferences.kt
@@ -2,12 +2,6 @@ package com.fsck.k9
 
 import androidx.annotation.GuardedBy
 import androidx.annotation.RestrictTo
-import app.k9mail.legacy.account.AccountDefaultsProvider
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.UNASSIGNED_ACCOUNT_NUMBER
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.AccountRemovedListener
-import app.k9mail.legacy.account.AccountsChangeListener
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.di.DI
 import com.fsck.k9.mail.MessagingException
 import com.fsck.k9.mailstore.LocalStoreProvider
@@ -26,6 +20,12 @@ import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.buffer
 import kotlinx.coroutines.flow.callbackFlow
 import kotlinx.coroutines.flow.flowOn
+import net.thunderbird.core.android.account.AccountDefaultsProvider
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.UNASSIGNED_ACCOUNT_NUMBER
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.AccountRemovedListener
+import net.thunderbird.core.android.account.AccountsChangeListener
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.preferences.Storage
 import timber.log.Timber
 
@@ -86,7 +86,10 @@ class Preferences internal constructor(
             if (!accountUuids.isNullOrEmpty()) {
                 accountUuids.split(",").forEach { uuid ->
                     val existingAccount = accountsMap?.get(uuid)
-                    val account = existingAccount ?: LegacyAccount(uuid, K9::isSensitiveDebugLoggingEnabled)
+                    val account = existingAccount ?: LegacyAccount(
+                        uuid,
+                        K9::isSensitiveDebugLoggingEnabled,
+                    )
                     accountPreferenceSerializer.loadAccount(account, storage)
 
                     accounts[uuid] = account
@@ -181,7 +184,8 @@ class Preferences internal constructor(
     }
 
     fun newAccount(accountUuid: String): LegacyAccount {
-        val account = LegacyAccount(accountUuid, K9::isSensitiveDebugLoggingEnabled)
+        val account =
+            LegacyAccount(accountUuid, K9::isSensitiveDebugLoggingEnabled)
         accountDefaultsProvider.applyDefaults(account)
 
         synchronized(accountLock) {
diff --git a/legacy/core/src/main/java/com/fsck/k9/backend/BackendFactory.kt b/legacy/core/src/main/java/com/fsck/k9/backend/BackendFactory.kt
index aeb193ac1ec..15fdd52e2c0 100644
--- a/legacy/core/src/main/java/com/fsck/k9/backend/BackendFactory.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/backend/BackendFactory.kt
@@ -1,15 +1,15 @@
 package com.fsck.k9.backend
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.backend.api.Backend
 import net.thunderbird.backend.api.BackendFactory
+import net.thunderbird.core.android.account.LegacyAccount
 
 @Deprecated(
     message = "Use net.thunderbird.backend.api.BackendFactory<TAccount : BaseAccount> instead",
     replaceWith = ReplaceWith(
         expression = "BackendFactory<LegacyAccount>",
         "net.thunderbird.backend.api.BackendFactory",
-        "app.k9mail.legacy.account.LegacyAccount",
+        "net.thunderbird.core.android.account.LegacyAccount",
     ),
 )
 interface BackendFactory : BackendFactory<LegacyAccount> {
diff --git a/legacy/core/src/main/java/com/fsck/k9/backend/BackendManager.kt b/legacy/core/src/main/java/com/fsck/k9/backend/BackendManager.kt
index 745073f4eed..372581fd1ad 100644
--- a/legacy/core/src/main/java/com/fsck/k9/backend/BackendManager.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/backend/BackendManager.kt
@@ -1,9 +1,9 @@
 package com.fsck.k9.backend
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.backend.api.Backend
 import com.fsck.k9.mail.ServerSettings
 import java.util.concurrent.CopyOnWriteArraySet
+import net.thunderbird.core.android.account.LegacyAccount
 
 class BackendManager(private val backendFactories: Map<String, BackendFactory>) {
     private val backendCache = mutableMapOf<String, BackendContainer>()
diff --git a/legacy/core/src/main/java/com/fsck/k9/controller/ArchiveOperations.kt b/legacy/core/src/main/java/com/fsck/k9/controller/ArchiveOperations.kt
index f233b4bb6df..554443ad900 100644
--- a/legacy/core/src/main/java/com/fsck/k9/controller/ArchiveOperations.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/controller/ArchiveOperations.kt
@@ -2,12 +2,12 @@ package com.fsck.k9.controller
 
 import app.k9mail.core.featureflag.FeatureFlagProvider
 import app.k9mail.core.featureflag.toFeatureFlagKey
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import com.fsck.k9.controller.MessagingController.MessageActor
 import com.fsck.k9.controller.MessagingController.MoveOrCopyFlavor
 import com.fsck.k9.mailstore.LocalFolder
 import com.fsck.k9.mailstore.LocalMessage
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 internal class ArchiveOperations(
diff --git a/legacy/core/src/main/java/com/fsck/k9/controller/DefaultMessageCountsProvider.kt b/legacy/core/src/main/java/com/fsck/k9/controller/DefaultMessageCountsProvider.kt
index 54e8dc85d4d..d94082ccef0 100644
--- a/legacy/core/src/main/java/com/fsck/k9/controller/DefaultMessageCountsProvider.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/controller/DefaultMessageCountsProvider.kt
@@ -1,7 +1,5 @@
 package com.fsck.k9.controller
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageStoreManager
 import app.k9mail.legacy.message.controller.MessageCounts
 import app.k9mail.legacy.message.controller.MessageCountsProvider
@@ -20,6 +18,8 @@ import kotlinx.coroutines.flow.buffer
 import kotlinx.coroutines.flow.callbackFlow
 import kotlinx.coroutines.flow.distinctUntilChanged
 import kotlinx.coroutines.flow.flowOn
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.ConditionsTreeNode
 import net.thunderbird.feature.search.LocalSearch
 import net.thunderbird.feature.search.SearchAccount
diff --git a/legacy/core/src/main/java/com/fsck/k9/controller/DraftOperations.kt b/legacy/core/src/main/java/com/fsck/k9/controller/DraftOperations.kt
index 423b2f39965..3000529c3ea 100644
--- a/legacy/core/src/main/java/com/fsck/k9/controller/DraftOperations.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/controller/DraftOperations.kt
@@ -1,6 +1,5 @@
 package com.fsck.k9.controller
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageStoreManager
 import app.k9mail.legacy.mailstore.SaveMessageData
 import com.fsck.k9.K9
@@ -14,6 +13,7 @@ import com.fsck.k9.mail.MessagingException
 import com.fsck.k9.mailstore.LocalFolder
 import com.fsck.k9.mailstore.LocalMessage
 import com.fsck.k9.mailstore.SaveMessageDataCreator
+import net.thunderbird.core.android.account.LegacyAccount
 import org.jetbrains.annotations.NotNull
 import timber.log.Timber
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/controller/LocalDeleteOperationDecider.kt b/legacy/core/src/main/java/com/fsck/k9/controller/LocalDeleteOperationDecider.kt
index adc115a45d0..906efe26b7d 100644
--- a/legacy/core/src/main/java/com/fsck/k9/controller/LocalDeleteOperationDecider.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/controller/LocalDeleteOperationDecider.kt
@@ -1,6 +1,6 @@
 package com.fsck.k9.controller
 
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Decides whether deleting a message in the app moves it to the trash folder or deletes it immediately.
diff --git a/legacy/core/src/main/java/com/fsck/k9/controller/MemorizingMessagingListener.java b/legacy/core/src/main/java/com/fsck/k9/controller/MemorizingMessagingListener.java
index eeecab2c45d..4f0f4bc47bd 100644
--- a/legacy/core/src/main/java/com/fsck/k9/controller/MemorizingMessagingListener.java
+++ b/legacy/core/src/main/java/com/fsck/k9/controller/MemorizingMessagingListener.java
@@ -5,10 +5,9 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import app.k9mail.legacy.message.controller.MessagingListener;
 import app.k9mail.legacy.message.controller.SimpleMessagingListener;
+import net.thunderbird.core.android.account.LegacyAccount;
 
 
 class MemorizingMessagingListener extends SimpleMessagingListener {
diff --git a/legacy/core/src/main/java/com/fsck/k9/controller/MessagingController.java b/legacy/core/src/main/java/com/fsck/k9/controller/MessagingController.java
index 4e8ce583667..5c89e397ecf 100644
--- a/legacy/core/src/main/java/com/fsck/k9/controller/MessagingController.java
+++ b/legacy/core/src/main/java/com/fsck/k9/controller/MessagingController.java
@@ -28,8 +28,6 @@
 import androidx.annotation.NonNull;
 import androidx.annotation.VisibleForTesting;
 import app.k9mail.core.featureflag.FeatureFlagProvider;
-import app.k9mail.legacy.account.LegacyAccount;
-import app.k9mail.legacy.account.DeletePolicy;
 import app.k9mail.legacy.di.DI;
 import app.k9mail.legacy.message.controller.MessageReference;
 import app.k9mail.legacy.message.controller.MessagingControllerMailChecker;
@@ -85,6 +83,8 @@
 import com.fsck.k9.mailstore.SpecialLocalFoldersCreator;
 import com.fsck.k9.notification.NotificationController;
 import com.fsck.k9.notification.NotificationStrategy;
+import net.thunderbird.core.android.account.DeletePolicy;
+import net.thunderbird.core.android.account.LegacyAccount;
 import net.thunderbird.feature.search.LocalSearch;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
diff --git a/legacy/core/src/main/java/com/fsck/k9/controller/MessagingControllerCommands.java b/legacy/core/src/main/java/com/fsck/k9/controller/MessagingControllerCommands.java
index 944ca62577e..5633ca8105a 100644
--- a/legacy/core/src/main/java/com/fsck/k9/controller/MessagingControllerCommands.java
+++ b/legacy/core/src/main/java/com/fsck/k9/controller/MessagingControllerCommands.java
@@ -3,10 +3,9 @@
 
 import java.util.List;
 import java.util.Map;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import com.fsck.k9.mail.Flag;
 import com.fsck.k9.mail.MessagingException;
+import net.thunderbird.core.android.account.LegacyAccount;
 
 import static com.fsck.k9.controller.Preconditions.requireNotNull;
 import static com.fsck.k9.controller.Preconditions.requireValidUids;
diff --git a/legacy/core/src/main/java/com/fsck/k9/controller/NotificationOperations.kt b/legacy/core/src/main/java/com/fsck/k9/controller/NotificationOperations.kt
index 6ea534ded07..f2c68d2c92c 100644
--- a/legacy/core/src/main/java/com/fsck/k9/controller/NotificationOperations.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/controller/NotificationOperations.kt
@@ -1,12 +1,12 @@
 package com.fsck.k9.controller
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageStoreManager
 import com.fsck.k9.notification.NotificationController
 import com.fsck.k9.search.isNewMessages
 import com.fsck.k9.search.isSingleFolder
 import com.fsck.k9.search.isUnifiedInbox
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.LocalSearch
 
 internal class NotificationOperations(
diff --git a/legacy/core/src/main/java/com/fsck/k9/controller/push/AccountPushController.kt b/legacy/core/src/main/java/com/fsck/k9/controller/push/AccountPushController.kt
index 2c99b252c9e..a76bd5430fb 100644
--- a/legacy/core/src/main/java/com/fsck/k9/controller/push/AccountPushController.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/controller/push/AccountPushController.kt
@@ -1,6 +1,5 @@
 package com.fsck.k9.controller.push
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import com.fsck.k9.backend.BackendManager
 import com.fsck.k9.backend.api.BackendPusher
@@ -11,6 +10,7 @@ import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.cancel
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 internal class AccountPushController(
diff --git a/legacy/core/src/main/java/com/fsck/k9/controller/push/AccountPushControllerFactory.kt b/legacy/core/src/main/java/com/fsck/k9/controller/push/AccountPushControllerFactory.kt
index 741666db40e..1924d5199f9 100644
--- a/legacy/core/src/main/java/com/fsck/k9/controller/push/AccountPushControllerFactory.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/controller/push/AccountPushControllerFactory.kt
@@ -1,9 +1,9 @@
 package com.fsck.k9.controller.push
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import com.fsck.k9.backend.BackendManager
 import com.fsck.k9.controller.MessagingController
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class AccountPushControllerFactory(
     private val backendManager: BackendManager,
diff --git a/legacy/core/src/main/java/com/fsck/k9/controller/push/PushController.kt b/legacy/core/src/main/java/com/fsck/k9/controller/push/PushController.kt
index 5c553c27bdb..7d96beb2aa2 100644
--- a/legacy/core/src/main/java/com/fsck/k9/controller/push/PushController.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/controller/push/PushController.kt
@@ -1,7 +1,5 @@
 package com.fsck.k9.controller.push
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import com.fsck.k9.backend.BackendManager
 import com.fsck.k9.helper.mapToSet
@@ -22,6 +20,8 @@ import kotlinx.coroutines.flow.launchIn
 import kotlinx.coroutines.flow.map
 import kotlinx.coroutines.flow.onEach
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.network.ConnectivityChangeListener
 import net.thunderbird.core.android.network.ConnectivityManager
 import net.thunderbird.core.preferences.BackgroundSync
diff --git a/legacy/core/src/main/java/com/fsck/k9/crypto/OpenPgpApiHelper.java b/legacy/core/src/main/java/com/fsck/k9/crypto/OpenPgpApiHelper.java
index f2b1cf20b8d..085c06fe908 100644
--- a/legacy/core/src/main/java/com/fsck/k9/crypto/OpenPgpApiHelper.java
+++ b/legacy/core/src/main/java/com/fsck/k9/crypto/OpenPgpApiHelper.java
@@ -1,8 +1,7 @@
 package com.fsck.k9.crypto;
 
-
-import app.k9mail.legacy.account.Identity;
 import com.fsck.k9.helper.StringHelper;
+import net.thunderbird.core.android.account.Identity;
 
 
 public class OpenPgpApiHelper {
diff --git a/legacy/core/src/main/java/com/fsck/k9/helper/IdentityHelper.kt b/legacy/core/src/main/java/com/fsck/k9/helper/IdentityHelper.kt
index bab37b8b77e..15254021c6b 100644
--- a/legacy/core/src/main/java/com/fsck/k9/helper/IdentityHelper.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/helper/IdentityHelper.kt
@@ -1,9 +1,9 @@
 package com.fsck.k9.helper
 
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.mail.Message
 import com.fsck.k9.mail.Message.RecipientType
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 
 object IdentityHelper {
     private val RECIPIENT_TYPES = listOf(
diff --git a/legacy/core/src/main/java/com/fsck/k9/helper/ReplyToParser.java b/legacy/core/src/main/java/com/fsck/k9/helper/ReplyToParser.java
index 2cbf14508c7..e5f4975336d 100644
--- a/legacy/core/src/main/java/com/fsck/k9/helper/ReplyToParser.java
+++ b/legacy/core/src/main/java/com/fsck/k9/helper/ReplyToParser.java
@@ -7,11 +7,10 @@
 import java.util.List;
 
 import androidx.annotation.VisibleForTesting;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import com.fsck.k9.mail.Address;
 import com.fsck.k9.mail.Message;
 import com.fsck.k9.mail.Message.RecipientType;
+import net.thunderbird.core.android.account.LegacyAccount;
 
 
 public class ReplyToParser {
diff --git a/legacy/core/src/main/java/com/fsck/k9/job/K9JobManager.kt b/legacy/core/src/main/java/com/fsck/k9/job/K9JobManager.kt
index 440f5d6e6b6..c2b99f48ee0 100644
--- a/legacy/core/src/main/java/com/fsck/k9/job/K9JobManager.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/job/K9JobManager.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.job
 
 import androidx.work.WorkManager
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 class K9JobManager(
diff --git a/legacy/core/src/main/java/com/fsck/k9/job/MailSyncWorker.kt b/legacy/core/src/main/java/com/fsck/k9/job/MailSyncWorker.kt
index 9142c3e27ae..d3328d84ccf 100644
--- a/legacy/core/src/main/java/com/fsck/k9/job/MailSyncWorker.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/job/MailSyncWorker.kt
@@ -4,11 +4,11 @@ import android.content.ContentResolver
 import android.content.Context
 import androidx.work.Worker
 import androidx.work.WorkerParameters
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.K9
 import com.fsck.k9.Preferences
 import com.fsck.k9.controller.MessagingController
 import com.fsck.k9.mail.AuthType
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 // IMPORTANT: Update K9WorkerFactory when moving this class and the FQCN no longer starts with "com.fsck.k9".
diff --git a/legacy/core/src/main/java/com/fsck/k9/job/MailSyncWorkerManager.kt b/legacy/core/src/main/java/com/fsck/k9/job/MailSyncWorkerManager.kt
index 02e4ffc6715..a3aca951a87 100644
--- a/legacy/core/src/main/java/com/fsck/k9/job/MailSyncWorkerManager.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/job/MailSyncWorkerManager.kt
@@ -7,10 +7,10 @@ import androidx.work.NetworkType
 import androidx.work.PeriodicWorkRequestBuilder
 import androidx.work.WorkManager
 import androidx.work.workDataOf
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.K9
 import java.util.concurrent.TimeUnit
 import kotlinx.datetime.Clock
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 class MailSyncWorkerManager(
diff --git a/legacy/core/src/main/java/com/fsck/k9/mailstore/AutoExpandFolderBackendFoldersRefreshListener.kt b/legacy/core/src/main/java/com/fsck/k9/mailstore/AutoExpandFolderBackendFoldersRefreshListener.kt
index 59f10757d1b..3c83df89ff8 100644
--- a/legacy/core/src/main/java/com/fsck/k9/mailstore/AutoExpandFolderBackendFoldersRefreshListener.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/mailstore/AutoExpandFolderBackendFoldersRefreshListener.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.mailstore
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import com.fsck.k9.Preferences
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Update an Account's auto-expand folder after the folder list has been refreshed.
diff --git a/legacy/core/src/main/java/com/fsck/k9/mailstore/DefaultSpecialFolderUpdater.kt b/legacy/core/src/main/java/com/fsck/k9/mailstore/DefaultSpecialFolderUpdater.kt
index 68edb276c92..fbac5b9e074 100644
--- a/legacy/core/src/main/java/com/fsck/k9/mailstore/DefaultSpecialFolderUpdater.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/mailstore/DefaultSpecialFolderUpdater.kt
@@ -2,9 +2,9 @@ package com.fsck.k9.mailstore
 
 import app.k9mail.core.common.mail.Protocols
 import app.k9mail.core.mail.folder.api.FolderType
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import com.fsck.k9.Preferences
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.mail.folder.api.SpecialFolderSelection
 import net.thunderbird.core.mail.folder.api.SpecialFolderUpdater
 import net.thunderbird.feature.folder.api.RemoteFolder
diff --git a/legacy/core/src/main/java/com/fsck/k9/mailstore/FolderSettingsProvider.kt b/legacy/core/src/main/java/com/fsck/k9/mailstore/FolderSettingsProvider.kt
index f3311b5f743..c52c751ca0c 100644
--- a/legacy/core/src/main/java/com/fsck/k9/mailstore/FolderSettingsProvider.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/mailstore/FolderSettingsProvider.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.mailstore
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderSettings
 import com.fsck.k9.Preferences
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Provides imported folder settings if available, otherwise default values.
diff --git a/legacy/core/src/main/java/com/fsck/k9/mailstore/K9BackendStorageFactory.kt b/legacy/core/src/main/java/com/fsck/k9/mailstore/K9BackendStorageFactory.kt
index 8f29c448a46..be4a6101406 100644
--- a/legacy/core/src/main/java/com/fsck/k9/mailstore/K9BackendStorageFactory.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/mailstore/K9BackendStorageFactory.kt
@@ -1,10 +1,10 @@
 package com.fsck.k9.mailstore
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import app.k9mail.legacy.mailstore.MessageStoreManager
 import com.fsck.k9.Preferences
 import net.thunderbird.backend.api.BackendStorageFactory
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.mail.folder.api.SpecialFolderUpdater
 
 class K9BackendStorageFactory(
diff --git a/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalFolder.java b/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalFolder.java
index 192fcd230c2..86359cf6bad 100644
--- a/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalFolder.java
+++ b/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalFolder.java
@@ -4,11 +4,8 @@
 import android.content.ContentValues;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
-
 import androidx.annotation.NonNull;
-
 import androidx.annotation.Nullable;
-import app.k9mail.legacy.account.LegacyAccount;
 import app.k9mail.legacy.mailstore.MoreMessages;
 import com.fsck.k9.K9;
 import app.k9mail.legacy.message.controller.MessageReference;
@@ -35,6 +32,7 @@
 import com.fsck.k9.mailstore.LockableDatabase.DbCallback;
 import com.fsck.k9.message.extractors.AttachmentInfoExtractor;
 
+import net.thunderbird.core.android.account.LegacyAccount;
 import org.apache.commons.io.IOUtils;
 import org.apache.james.mime4j.util.MimeUtil;
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalMessage.java b/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalMessage.java
index 7155eb81f15..fefccf803bf 100644
--- a/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalMessage.java
+++ b/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalMessage.java
@@ -6,13 +6,10 @@
 import java.io.OutputStream;
 import java.util.Date;
 import java.util.Objects;
-
 import android.content.ContentValues;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import androidx.annotation.VisibleForTesting;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import com.fsck.k9.K9;
 import app.k9mail.legacy.message.controller.MessageReference;
 import com.fsck.k9.mail.Address;
@@ -24,6 +21,7 @@
 import com.fsck.k9.mail.message.MessageHeaderParser;
 import com.fsck.k9.mailstore.LockableDatabase.DbCallback;
 import app.k9mail.legacy.message.extractors.PreviewResult.PreviewType;
+import net.thunderbird.core.android.account.LegacyAccount;
 import timber.log.Timber;
 
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalStore.java b/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalStore.java
index 0376d3b30fe..b0a6f9b7123 100644
--- a/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalStore.java
+++ b/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalStore.java
@@ -24,9 +24,7 @@
 import android.database.sqlite.SQLiteDatabase;
 import androidx.annotation.Nullable;
 import android.text.TextUtils;
-
 import androidx.core.database.CursorKt;
-import app.k9mail.legacy.account.LegacyAccount;
 import app.k9mail.legacy.di.DI;
 import app.k9mail.legacy.mailstore.MessageListRepository;
 import app.k9mail.legacy.mailstore.MoreMessages;
@@ -49,6 +47,7 @@
 import com.fsck.k9.message.extractors.AttachmentInfoExtractor;
 import com.fsck.k9.search.SqlQueryBuilder;
 import kotlinx.datetime.Clock;
+import net.thunderbird.core.android.account.LegacyAccount;
 import net.thunderbird.feature.search.LocalSearch;
 import net.thunderbird.feature.search.api.SearchAttribute;
 import net.thunderbird.feature.search.api.SearchField;
diff --git a/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalStoreProvider.kt b/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalStoreProvider.kt
index 15b80ffb203..800dfe15d3f 100644
--- a/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalStoreProvider.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/mailstore/LocalStoreProvider.kt
@@ -1,10 +1,10 @@
 package com.fsck.k9.mailstore
 
 import android.content.Context
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.di.DI
 import com.fsck.k9.mail.MessagingException
 import java.util.concurrent.ConcurrentHashMap
+import net.thunderbird.core.android.account.LegacyAccount
 
 class LocalStoreProvider {
     private val localStores = ConcurrentHashMap<String, LocalStore>()
diff --git a/legacy/core/src/main/java/com/fsck/k9/mailstore/MigrationsHelper.java b/legacy/core/src/main/java/com/fsck/k9/mailstore/MigrationsHelper.java
index 2fe5485fce2..c28041c694b 100644
--- a/legacy/core/src/main/java/com/fsck/k9/mailstore/MigrationsHelper.java
+++ b/legacy/core/src/main/java/com/fsck/k9/mailstore/MigrationsHelper.java
@@ -1,7 +1,7 @@
 package com.fsck.k9.mailstore;
 
 
-import app.k9mail.legacy.account.LegacyAccount;
+import net.thunderbird.core.android.account.LegacyAccount;
 
 
 /**
diff --git a/legacy/core/src/main/java/com/fsck/k9/mailstore/SpecialLocalFoldersCreator.kt b/legacy/core/src/main/java/com/fsck/k9/mailstore/SpecialLocalFoldersCreator.kt
index 3c3f99a5ec7..31a242513e9 100644
--- a/legacy/core/src/main/java/com/fsck/k9/mailstore/SpecialLocalFoldersCreator.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/mailstore/SpecialLocalFoldersCreator.kt
@@ -1,9 +1,9 @@
 package com.fsck.k9.mailstore
 
 import app.k9mail.core.common.mail.Protocols
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.Preferences
 import com.fsck.k9.mail.FolderType
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.mail.folder.api.SpecialFolderSelection
 import timber.log.Timber
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/message/IdentityHeaderBuilder.java b/legacy/core/src/main/java/com/fsck/k9/message/IdentityHeaderBuilder.java
index 000929617ec..88bb0cc57c0 100644
--- a/legacy/core/src/main/java/com/fsck/k9/message/IdentityHeaderBuilder.java
+++ b/legacy/core/src/main/java/com/fsck/k9/message/IdentityHeaderBuilder.java
@@ -5,13 +5,12 @@
 
 import android.net.Uri;
 import android.net.Uri.Builder;
-
-import app.k9mail.legacy.account.QuoteStyle;
-import app.k9mail.legacy.account.Identity;
 import com.fsck.k9.K9;
 import app.k9mail.legacy.message.controller.MessageReference;
 import com.fsck.k9.mail.internet.TextBody;
 import com.fsck.k9.message.quote.InsertableHtmlContent;
+import net.thunderbird.core.android.account.Identity;
+import net.thunderbird.core.android.account.QuoteStyle;
 import timber.log.Timber;
 
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/message/MessageBuilder.java b/legacy/core/src/main/java/com/fsck/k9/message/MessageBuilder.java
index 86eb0b3508a..9ac17101357 100644
--- a/legacy/core/src/main/java/com/fsck/k9/message/MessageBuilder.java
+++ b/legacy/core/src/main/java/com/fsck/k9/message/MessageBuilder.java
@@ -13,10 +13,9 @@
 import com.fsck.k9.CoreResourceProvider;
 import com.fsck.k9.mail.internet.AddressHeaderBuilder;
 import com.fsck.k9.mail.internet.Headers;
+import net.thunderbird.core.android.account.Identity;
+import net.thunderbird.core.android.account.QuoteStyle;
 import timber.log.Timber;
-
-import app.k9mail.legacy.account.QuoteStyle;
-import app.k9mail.legacy.account.Identity;
 import com.fsck.k9.K9;
 import app.k9mail.legacy.message.controller.MessageReference;
 import com.fsck.k9.mail.Address;
diff --git a/legacy/core/src/main/java/com/fsck/k9/message/ReplyActionStrategy.kt b/legacy/core/src/main/java/com/fsck/k9/message/ReplyActionStrategy.kt
index 6ab56660d51..270137da8d8 100644
--- a/legacy/core/src/main/java/com/fsck/k9/message/ReplyActionStrategy.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/message/ReplyActionStrategy.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.message
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.helper.ReplyToParser
 import com.fsck.k9.mail.Message
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Figures out which reply actions are available to the user.
diff --git a/legacy/core/src/main/java/com/fsck/k9/message/quote/HtmlQuoteCreator.java b/legacy/core/src/main/java/com/fsck/k9/message/quote/HtmlQuoteCreator.java
index 5a3c375e19d..6a0410d12ea 100644
--- a/legacy/core/src/main/java/com/fsck/k9/message/quote/HtmlQuoteCreator.java
+++ b/legacy/core/src/main/java/com/fsck/k9/message/quote/HtmlQuoteCreator.java
@@ -6,9 +6,8 @@
 
 import com.fsck.k9.CoreResourceProvider;
 import app.k9mail.legacy.di.DI;
+import net.thunderbird.core.android.account.QuoteStyle;
 import timber.log.Timber;
-
-import app.k9mail.legacy.account.QuoteStyle;
 import com.fsck.k9.mail.Address;
 import com.fsck.k9.mail.Message;
 import com.fsck.k9.mail.Message.RecipientType;
diff --git a/legacy/core/src/main/java/com/fsck/k9/message/quote/TextQuoteCreator.kt b/legacy/core/src/main/java/com/fsck/k9/message/quote/TextQuoteCreator.kt
index f48c9cb25fc..7f285d4cae7 100644
--- a/legacy/core/src/main/java/com/fsck/k9/message/quote/TextQuoteCreator.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/message/quote/TextQuoteCreator.kt
@@ -1,10 +1,10 @@
 package com.fsck.k9.message.quote
 
-import app.k9mail.legacy.account.QuoteStyle
 import com.fsck.k9.CoreResourceProvider
 import com.fsck.k9.mail.Address
 import com.fsck.k9.mail.Message
 import com.fsck.k9.mail.Message.RecipientType
+import net.thunderbird.core.android.account.QuoteStyle
 
 class TextQuoteCreator(
     private val quoteDateFormatter: QuoteDateFormatter,
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotificationController.kt b/legacy/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotificationController.kt
index 24a77ac567b..86f3e85ddd1 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotificationController.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotificationController.kt
@@ -4,7 +4,7 @@ import android.app.Notification
 import android.app.PendingIntent
 import androidx.core.app.NotificationCompat
 import androidx.core.app.NotificationManagerCompat
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal open class AuthenticationErrorNotificationController(
     private val notificationHelper: NotificationHelper,
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/BaseNotificationDataCreator.kt b/legacy/core/src/main/java/com/fsck/k9/notification/BaseNotificationDataCreator.kt
index 910814f8712..c397b9428ce 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/BaseNotificationDataCreator.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/BaseNotificationDataCreator.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.K9
 import com.fsck.k9.K9.LockScreenNotificationVisibility
+import net.thunderbird.core.android.account.LegacyAccount
 
 private const val MAX_NUMBER_OF_SENDERS_IN_LOCK_SCREEN_NOTIFICATION = 5
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotificationController.kt b/legacy/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotificationController.kt
index 0f289d6caa2..8b77f158069 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotificationController.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotificationController.kt
@@ -4,7 +4,7 @@ import android.app.Notification
 import android.app.PendingIntent
 import androidx.core.app.NotificationCompat
 import androidx.core.app.NotificationManagerCompat
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal open class CertificateErrorNotificationController(
     private val notificationHelper: NotificationHelper,
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationController.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationController.kt
index 37e9c286fa6..a0f9d05e267 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationController.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationController.kt
@@ -1,9 +1,9 @@
 package com.fsck.k9.notification
 
 import androidx.core.app.NotificationManagerCompat
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import com.fsck.k9.mailstore.LocalMessage
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Handle notifications for new messages.
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationData.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationData.kt
index f7ab7c18c72..70bd580b768 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationData.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationData.kt
@@ -1,7 +1,7 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal data class NewMailNotificationData(
     val cancelNotificationIds: List<Int>,
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationManager.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationManager.kt
index 454e2c195a5..17f934eb385 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationManager.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NewMailNotificationManager.kt
@@ -1,9 +1,9 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import com.fsck.k9.mailstore.LocalMessage
 import kotlinx.datetime.Clock
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Manages notifications for new messages
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt
index a3155807fee..101d1e8df2c 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.notification
 
 import android.app.PendingIntent
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
+import net.thunderbird.core.android.account.LegacyAccount
 
 interface NotificationActionCreator {
     fun createViewMessagePendingIntent(messageReference: MessageReference): PendingIntent
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt
index e37cee9c756..a13f481542c 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt
@@ -4,7 +4,6 @@ import android.app.Service
 import android.content.Context
 import android.content.Intent
 import android.os.IBinder
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import com.fsck.k9.K9
 import com.fsck.k9.Preferences
@@ -14,6 +13,7 @@ import com.fsck.k9.mail.Flag
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.LegacyAccount
 import org.koin.android.ext.android.inject
 import org.koin.core.qualifier.named
 import timber.log.Timber
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt
index 611289d3b8e..0a27ba13d28 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt
@@ -8,9 +8,9 @@ import android.net.Uri
 import android.os.Build
 import androidx.annotation.RequiresApi
 import androidx.core.net.toUri
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import java.util.concurrent.Executor
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.notification.NotificationLight
 import net.thunderbird.feature.notification.NotificationSettings
 import timber.log.Timber
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationConfigurationConverter.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationConfigurationConverter.kt
index afaca84354f..3270f5027db 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationConfigurationConverter.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationConfigurationConverter.kt
@@ -1,6 +1,6 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.notification.NotificationSettings
 
 /**
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationContentCreator.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationContentCreator.kt
index c380ec24841..7ec02e69c4d 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationContentCreator.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationContentCreator.kt
@@ -2,12 +2,12 @@ package com.fsck.k9.notification
 
 import android.text.SpannableStringBuilder
 import app.k9mail.core.android.common.contact.ContactRepository
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.extractors.PreviewResult.PreviewType
 import com.fsck.k9.K9
 import com.fsck.k9.helper.MessageHelper
 import com.fsck.k9.mail.Message
 import com.fsck.k9.mailstore.LocalMessage
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class NotificationContentCreator(
     private val resourceProvider: NotificationResourceProvider,
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationController.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationController.kt
index 73945f7fe28..79f374ef4a2 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationController.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationController.kt
@@ -1,9 +1,9 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import com.fsck.k9.mailstore.LocalFolder
 import com.fsck.k9.mailstore.LocalMessage
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 class NotificationController internal constructor(
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationData.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationData.kt
index 00c4c5a8d30..365ea1728da 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationData.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationData.kt
@@ -1,7 +1,7 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Holds information about active and inactive new message notifications of an account.
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationDataStore.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationDataStore.kt
index dbd6816044d..aa0ce6efc57 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationDataStore.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationDataStore.kt
@@ -1,7 +1,7 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal const val MAX_NUMBER_OF_NEW_MESSAGE_NOTIFICATIONS = 9
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationGroupKeys.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationGroupKeys.kt
index f685f4e7e15..badee1b4710 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationGroupKeys.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationGroupKeys.kt
@@ -1,6 +1,6 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 
 object NotificationGroupKeys {
     private const val NOTIFICATION_GROUP_KEY_PREFIX = "newMailNotifications-"
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt
index 8569b4e0ef5..2f200089556 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt
@@ -9,9 +9,9 @@ import android.provider.Settings
 import androidx.core.app.NotificationCompat
 import androidx.core.app.NotificationManagerCompat
 import androidx.core.app.PendingIntentCompat
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.K9
 import com.fsck.k9.notification.NotificationChannelManager.ChannelType
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 class NotificationHelper(
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationIds.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationIds.kt
index 8897b393687..660f3a05977 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationIds.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationIds.kt
@@ -1,6 +1,6 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal object NotificationIds {
     const val PUSH_NOTIFICATION_ID = 1
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationRepository.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationRepository.kt
index b0d7fca952f..1292907ee7a 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationRepository.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationRepository.kt
@@ -1,9 +1,9 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageStoreManager
 import app.k9mail.legacy.message.controller.MessageReference
 import com.fsck.k9.mailstore.LocalStoreProvider
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class NotificationRepository(
     private val notificationStoreProvider: NotificationStoreProvider,
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationSettingsUpdater.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationSettingsUpdater.kt
index 455f2438931..9169a1d02bd 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationSettingsUpdater.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationSettingsUpdater.kt
@@ -2,8 +2,8 @@ package com.fsck.k9.notification
 
 import android.os.Build
 import androidx.annotation.RequiresApi
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.Preferences
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Update accounts with notification settings read from their "Messages" `NotificationChannel`.
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationStoreProvider.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationStoreProvider.kt
index ea038c1539b..193855dfc1d 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationStoreProvider.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationStoreProvider.kt
@@ -1,6 +1,6 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 
 interface NotificationStoreProvider {
     fun getNotificationStore(account: LegacyAccount): NotificationStore
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationStrategy.kt b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationStrategy.kt
index f15af20786a..2f9a7b1cbb1 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/NotificationStrategy.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/NotificationStrategy.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.mailstore.LocalFolder
 import com.fsck.k9.mailstore.LocalMessage
+import net.thunderbird.core.android.account.LegacyAccount
 
 interface NotificationStrategy {
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/SendFailedNotificationController.kt b/legacy/core/src/main/java/com/fsck/k9/notification/SendFailedNotificationController.kt
index 91ec25146c3..5f0b869677c 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/SendFailedNotificationController.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/SendFailedNotificationController.kt
@@ -3,8 +3,8 @@ package com.fsck.k9.notification
 import android.app.Notification
 import androidx.core.app.NotificationCompat
 import androidx.core.app.NotificationManagerCompat
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.helper.ExceptionHelper
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class SendFailedNotificationController(
     private val notificationHelper: NotificationHelper,
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/SingleMessageNotificationDataCreator.kt b/legacy/core/src/main/java/com/fsck/k9/notification/SingleMessageNotificationDataCreator.kt
index 1510ccf8fac..2bf647996c2 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/SingleMessageNotificationDataCreator.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/SingleMessageNotificationDataCreator.kt
@@ -1,7 +1,7 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.K9
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class SingleMessageNotificationDataCreator {
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/SummaryNotificationCreator.kt b/legacy/core/src/main/java/com/fsck/k9/notification/SummaryNotificationCreator.kt
index f378c823dc7..42076206a71 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/SummaryNotificationCreator.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/SummaryNotificationCreator.kt
@@ -3,8 +3,8 @@ package com.fsck.k9.notification
 import android.app.PendingIntent
 import androidx.core.app.NotificationCompat
 import androidx.core.app.NotificationCompat.WearableExtender
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.notification.NotificationChannelManager.ChannelType
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 import androidx.core.app.NotificationCompat.Builder as NotificationBuilder
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/SummaryNotificationDataCreator.kt b/legacy/core/src/main/java/com/fsck/k9/notification/SummaryNotificationDataCreator.kt
index 959daebf4a1..10affe11291 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/SummaryNotificationDataCreator.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/SummaryNotificationDataCreator.kt
@@ -1,7 +1,7 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.K9
+import net.thunderbird.core.android.account.LegacyAccount
 
 private const val MAX_NUMBER_OF_MESSAGES_FOR_SUMMARY_NOTIFICATION = 5
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt b/legacy/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt
index 9bf92085bcb..dc63a910d44 100644
--- a/legacy/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt
@@ -3,8 +3,8 @@ package com.fsck.k9.notification
 import android.app.Notification
 import androidx.core.app.NotificationCompat
 import androidx.core.app.NotificationManagerCompat
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.mailstore.LocalFolder
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class SyncNotificationController(
     private val notificationHelper: NotificationHelper,
diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/AccountSettingsDescriptions.java b/legacy/core/src/main/java/com/fsck/k9/preferences/AccountSettingsDescriptions.java
index cc78ff751b0..c9ccf7ad8d2 100644
--- a/legacy/core/src/main/java/com/fsck/k9/preferences/AccountSettingsDescriptions.java
+++ b/legacy/core/src/main/java/com/fsck/k9/preferences/AccountSettingsDescriptions.java
@@ -6,17 +6,7 @@
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.TreeMap;
-
 import android.content.Context;
-
-import app.k9mail.legacy.account.AccountDefaultsProvider;
-import app.k9mail.legacy.account.DeletePolicy;
-import app.k9mail.legacy.account.Expunge;
-import app.k9mail.legacy.account.FolderMode;
-import app.k9mail.legacy.account.MessageFormat;
-import app.k9mail.legacy.account.QuoteStyle;
-import app.k9mail.legacy.account.ShowPictures;
-import app.k9mail.legacy.account.SortType;
 import app.k9mail.legacy.di.DI;
 import com.fsck.k9.K9;
 import com.fsck.k9.core.R;
@@ -35,18 +25,25 @@
 import com.fsck.k9.preferences.upgrader.AccountSettingsUpgraderTo80;
 import com.fsck.k9.preferences.upgrader.AccountSettingsUpgraderTo81;
 import com.fsck.k9.preferences.upgrader.AccountSettingsUpgraderTo91;
+import net.thunderbird.core.android.account.AccountDefaultsProvider;
+import net.thunderbird.core.android.account.DeletePolicy;
+import net.thunderbird.core.android.account.Expunge;
+import net.thunderbird.core.android.account.FolderMode;
+import net.thunderbird.core.android.account.MessageFormat;
+import net.thunderbird.core.android.account.QuoteStyle;
+import net.thunderbird.core.android.account.ShowPictures;
+import net.thunderbird.core.android.account.SortType;
 import net.thunderbird.core.mail.folder.api.SpecialFolderSelection;
 import net.thunderbird.feature.notification.NotificationLight;
-
-import static app.k9mail.legacy.account.AccountDefaultsProvider.DEFAULT_MESSAGE_FORMAT_AUTO;
-import static app.k9mail.legacy.account.AccountDefaultsProvider.DEFAULT_MESSAGE_READ_RECEIPT;
-import static app.k9mail.legacy.account.AccountDefaultsProvider.DEFAULT_QUOTED_TEXT_SHOWN;
-import static app.k9mail.legacy.account.AccountDefaultsProvider.DEFAULT_QUOTE_PREFIX;
-import static app.k9mail.legacy.account.AccountDefaultsProvider.DEFAULT_REMOTE_SEARCH_NUM_RESULTS;
-import static app.k9mail.legacy.account.AccountDefaultsProvider.DEFAULT_REPLY_AFTER_QUOTE;
-import static app.k9mail.legacy.account.AccountDefaultsProvider.DEFAULT_SORT_ASCENDING;
-import static app.k9mail.legacy.account.AccountDefaultsProvider.DEFAULT_STRIP_SIGNATURE;
 import static com.fsck.k9.preferences.upgrader.AccountSettingsUpgraderTo53.FOLDER_NONE;
+import static net.thunderbird.core.android.account.AccountDefaultsProvider.DEFAULT_MESSAGE_FORMAT_AUTO;
+import static net.thunderbird.core.android.account.AccountDefaultsProvider.DEFAULT_MESSAGE_READ_RECEIPT;
+import static net.thunderbird.core.android.account.AccountDefaultsProvider.DEFAULT_QUOTED_TEXT_SHOWN;
+import static net.thunderbird.core.android.account.AccountDefaultsProvider.DEFAULT_QUOTE_PREFIX;
+import static net.thunderbird.core.android.account.AccountDefaultsProvider.DEFAULT_REMOTE_SEARCH_NUM_RESULTS;
+import static net.thunderbird.core.android.account.AccountDefaultsProvider.DEFAULT_REPLY_AFTER_QUOTE;
+import static net.thunderbird.core.android.account.AccountDefaultsProvider.DEFAULT_SORT_ASCENDING;
+import static net.thunderbird.core.android.account.AccountDefaultsProvider.DEFAULT_STRIP_SIGNATURE;
 
 
 class AccountSettingsDescriptions {
diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/AccountSettingsWriter.kt b/legacy/core/src/main/java/com/fsck/k9/preferences/AccountSettingsWriter.kt
index bded0da59e4..19df1459fb2 100644
--- a/legacy/core/src/main/java/com/fsck/k9/preferences/AccountSettingsWriter.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/preferences/AccountSettingsWriter.kt
@@ -1,7 +1,6 @@
 package com.fsck.k9.preferences
 
 import android.content.Context
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.AccountPreferenceSerializer.Companion.ACCOUNT_DESCRIPTION_KEY
 import com.fsck.k9.AccountPreferenceSerializer.Companion.INCOMING_SERVER_SETTINGS_KEY
 import com.fsck.k9.AccountPreferenceSerializer.Companion.OUTGOING_SERVER_SETTINGS_KEY
@@ -11,6 +10,7 @@ import com.fsck.k9.ServerSettingsSerializer
 import com.fsck.k9.mailstore.SpecialLocalFoldersCreator
 import java.util.UUID
 import kotlinx.datetime.Clock
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class AccountSettingsWriter(
     private val preferences: Preferences,
diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/FolderSettingsProvider.kt b/legacy/core/src/main/java/com/fsck/k9/preferences/FolderSettingsProvider.kt
index c564bafdb8a..96a032c6dbb 100644
--- a/legacy/core/src/main/java/com/fsck/k9/preferences/FolderSettingsProvider.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/preferences/FolderSettingsProvider.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.preferences
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import app.k9mail.legacy.mailstore.RemoteFolderDetails
+import net.thunderbird.core.android.account.LegacyAccount
 
 class FolderSettingsProvider(private val folderRepository: FolderRepository) {
     fun getFolderSettings(account: LegacyAccount): List<FolderSettings> {
diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/GeneralSettingsDescriptions.java b/legacy/core/src/main/java/com/fsck/k9/preferences/GeneralSettingsDescriptions.java
index f4cd974e834..de0ac63991a 100644
--- a/legacy/core/src/main/java/com/fsck/k9/preferences/GeneralSettingsDescriptions.java
+++ b/legacy/core/src/main/java/com/fsck/k9/preferences/GeneralSettingsDescriptions.java
@@ -10,8 +10,6 @@
 import android.content.Context;
 
 import app.k9mail.feature.telemetry.api.TelemetryManager;
-import app.k9mail.legacy.account.SortType;
-import app.k9mail.legacy.account.AccountDefaultsProvider;
 import app.k9mail.legacy.di.DI;
 import com.fsck.k9.FontSizes;
 import com.fsck.k9.K9;
@@ -39,6 +37,8 @@
 import com.fsck.k9.preferences.upgrader.GeneralSettingsUpgraderTo69;
 import com.fsck.k9.preferences.upgrader.GeneralSettingsUpgraderTo79;
 import com.fsck.k9.preferences.upgrader.GeneralSettingsUpgraderTo89;
+import net.thunderbird.core.android.account.AccountDefaultsProvider;
+import net.thunderbird.core.android.account.SortType;
 import net.thunderbird.core.preferences.AppTheme;
 import net.thunderbird.core.preferences.Storage;
 import net.thunderbird.core.preferences.SubTheme;
diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt b/legacy/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt
index 4b1451d79a7..f613deae6f5 100644
--- a/legacy/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt
@@ -1,7 +1,7 @@
 package com.fsck.k9.preferences
 
-import app.k9mail.legacy.account.AccountManager
 import com.fsck.k9.Preferences
+import net.thunderbird.core.android.account.AccountManager
 import net.thunderbird.core.preferences.DefaultSettingsChangeBroker
 import net.thunderbird.core.preferences.GeneralSettingsManager
 import net.thunderbird.core.preferences.SettingsChangeBroker
diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt b/legacy/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt
index 4c8745003b9..ad924a3ece9 100644
--- a/legacy/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt
@@ -3,7 +3,6 @@ package com.fsck.k9.preferences
 import android.content.ContentResolver
 import android.net.Uri
 import android.util.Xml
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import com.fsck.k9.AccountPreferenceSerializer.Companion.ACCOUNT_DESCRIPTION_KEY
 import com.fsck.k9.AccountPreferenceSerializer.Companion.IDENTITY_DESCRIPTION_KEY
@@ -18,6 +17,7 @@ import java.io.OutputStream
 import java.text.SimpleDateFormat
 import java.util.Calendar
 import java.util.Locale
+import net.thunderbird.core.android.account.LegacyAccount
 import org.xmlpull.v1.XmlSerializer
 import timber.log.Timber
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/UnifiedInboxConfigurator.kt b/legacy/core/src/main/java/com/fsck/k9/preferences/UnifiedInboxConfigurator.kt
index 11b308798fd..6dc34220139 100644
--- a/legacy/core/src/main/java/com/fsck/k9/preferences/UnifiedInboxConfigurator.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/preferences/UnifiedInboxConfigurator.kt
@@ -1,7 +1,7 @@
 package com.fsck.k9.preferences
 
-import app.k9mail.legacy.account.AccountManager
 import com.fsck.k9.K9
+import net.thunderbird.core.android.account.AccountManager
 
 /**
  * Configures the unified inbox after an account has been added.
diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo100.kt b/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo100.kt
index 50fede46101..3109c5efe93 100644
--- a/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo100.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo100.kt
@@ -1,14 +1,15 @@
 package com.fsck.k9.preferences.upgrader
 
-import app.k9mail.legacy.account.FolderMode
 import com.fsck.k9.preferences.CombinedSettingsUpgrader
 import com.fsck.k9.preferences.InternalSettingsMap
 import com.fsck.k9.preferences.ValidatedSettings
 import com.fsck.k9.preferences.legacy.FolderClass
+import net.thunderbird.core.android.account.FolderMode
 
 class CombinedSettingsUpgraderTo100 : CombinedSettingsUpgrader {
     override fun upgrade(account: ValidatedSettings.Account): ValidatedSettings.Account {
-        val folderDisplayMode = account.settings["folderDisplayMode"] as? FolderMode ?: FolderMode.NONE
+        val folderDisplayMode = account.settings["folderDisplayMode"] as? FolderMode
+            ?: FolderMode.NONE
 
         val newFolders = account.folders.map { folder ->
             val newFolderSettings = folder.settings.toMutableMap().apply {
diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo96.kt b/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo96.kt
index 985d2dd9790..33cd46ad2a3 100644
--- a/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo96.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo96.kt
@@ -1,14 +1,15 @@
 package com.fsck.k9.preferences.upgrader
 
-import app.k9mail.legacy.account.FolderMode
 import com.fsck.k9.preferences.CombinedSettingsUpgrader
 import com.fsck.k9.preferences.InternalSettingsMap
 import com.fsck.k9.preferences.ValidatedSettings
 import com.fsck.k9.preferences.legacy.FolderClass
+import net.thunderbird.core.android.account.FolderMode
 
 class CombinedSettingsUpgraderTo96 : CombinedSettingsUpgrader {
     override fun upgrade(account: ValidatedSettings.Account): ValidatedSettings.Account {
-        val notifyFolderMode = account.settings["folderNotifyNewMailMode"] as? FolderMode ?: FolderMode.NONE
+        val notifyFolderMode = account.settings["folderNotifyNewMailMode"] as? FolderMode
+            ?: FolderMode.NONE
         val ignoredFolders = getNotificationIgnoredFolders(account)
 
         val newFolders = account.folders.map { folder ->
diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo98.kt b/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo98.kt
index 65787685b6b..19a6edede9d 100644
--- a/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo98.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo98.kt
@@ -1,14 +1,15 @@
 package com.fsck.k9.preferences.upgrader
 
-import app.k9mail.legacy.account.FolderMode
 import com.fsck.k9.preferences.CombinedSettingsUpgrader
 import com.fsck.k9.preferences.InternalSettingsMap
 import com.fsck.k9.preferences.ValidatedSettings
 import com.fsck.k9.preferences.legacy.FolderClass
+import net.thunderbird.core.android.account.FolderMode
 
 class CombinedSettingsUpgraderTo98 : CombinedSettingsUpgrader {
     override fun upgrade(account: ValidatedSettings.Account): ValidatedSettings.Account {
-        val folderPushMode = account.settings["folderPushMode"] as? FolderMode ?: FolderMode.NONE
+        val folderPushMode = account.settings["folderPushMode"] as? FolderMode
+            ?: FolderMode.NONE
 
         val newFolders = account.folders.map { folder ->
             val newFolderSettings = folder.settings.toMutableMap().apply {
diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo99.kt b/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo99.kt
index 587a23ae21f..d455fad946d 100644
--- a/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo99.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo99.kt
@@ -1,14 +1,15 @@
 package com.fsck.k9.preferences.upgrader
 
-import app.k9mail.legacy.account.FolderMode
 import com.fsck.k9.preferences.CombinedSettingsUpgrader
 import com.fsck.k9.preferences.InternalSettingsMap
 import com.fsck.k9.preferences.ValidatedSettings
 import com.fsck.k9.preferences.legacy.FolderClass
+import net.thunderbird.core.android.account.FolderMode
 
 class CombinedSettingsUpgraderTo99 : CombinedSettingsUpgrader {
     override fun upgrade(account: ValidatedSettings.Account): ValidatedSettings.Account {
-        val folderSyncMode = account.settings["folderSyncMode"] as? FolderMode ?: FolderMode.NONE
+        val folderSyncMode = account.settings["folderSyncMode"] as? FolderMode
+            ?: FolderMode.NONE
 
         val newFolders = account.folders.map { folder ->
             val newFolderSettings = folder.settings.toMutableMap().apply {
diff --git a/legacy/core/src/main/java/com/fsck/k9/provider/AttachmentProvider.java b/legacy/core/src/main/java/com/fsck/k9/provider/AttachmentProvider.java
index e191cc0b72a..bdecfa8b664 100644
--- a/legacy/core/src/main/java/com/fsck/k9/provider/AttachmentProvider.java
+++ b/legacy/core/src/main/java/com/fsck/k9/provider/AttachmentProvider.java
@@ -17,9 +17,8 @@
 import app.k9mail.legacy.di.DI;
 import com.fsck.k9.helper.MimeTypeUtil;
 import com.fsck.k9.mailstore.LocalStoreProvider;
+import net.thunderbird.core.android.account.LegacyAccount;
 import timber.log.Timber;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import com.fsck.k9.Preferences;
 import com.fsck.k9.mail.MessagingException;
 import com.fsck.k9.mailstore.LocalStore;
diff --git a/legacy/core/src/main/java/com/fsck/k9/provider/RawMessageProvider.java b/legacy/core/src/main/java/com/fsck/k9/provider/RawMessageProvider.java
index fdf69bf3e36..c592340dcf6 100644
--- a/legacy/core/src/main/java/com/fsck/k9/provider/RawMessageProvider.java
+++ b/legacy/core/src/main/java/com/fsck/k9/provider/RawMessageProvider.java
@@ -16,8 +16,6 @@
 import android.provider.OpenableColumns;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import app.k9mail.legacy.di.DI;
 import com.fsck.k9.Preferences;
 import app.k9mail.legacy.message.controller.MessageReference;
@@ -28,6 +26,7 @@
 import com.fsck.k9.mailstore.LocalMessage;
 import com.fsck.k9.mailstore.LocalStore;
 import com.fsck.k9.mailstore.LocalStoreProvider;
+import net.thunderbird.core.android.account.LegacyAccount;
 import org.openintents.openpgp.util.OpenPgpApi.OpenPgpDataSource;
 import timber.log.Timber;
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/search/AccountSearchConditions.kt b/legacy/core/src/main/java/com/fsck/k9/search/AccountSearchConditions.kt
index 3ed77c72812..c5d5a53d182 100644
--- a/legacy/core/src/main/java/com/fsck/k9/search/AccountSearchConditions.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/search/AccountSearchConditions.kt
@@ -1,6 +1,6 @@
 package com.fsck.k9.search
 
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.LocalSearch
 import net.thunderbird.feature.search.api.SearchAttribute
 import net.thunderbird.feature.search.api.SearchCondition
diff --git a/legacy/core/src/main/java/com/fsck/k9/search/LocalSearchExtensions.kt b/legacy/core/src/main/java/com/fsck/k9/search/LocalSearchExtensions.kt
index e851e28966a..ef3fe2198e4 100644
--- a/legacy/core/src/main/java/com/fsck/k9/search/LocalSearchExtensions.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/search/LocalSearchExtensions.kt
@@ -2,8 +2,8 @@
 
 package com.fsck.k9.search
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.LocalSearch
 import net.thunderbird.feature.search.SearchAccount
 
diff --git a/legacy/core/src/main/java/com/fsck/k9/service/DatabaseUpgradeService.java b/legacy/core/src/main/java/com/fsck/k9/service/DatabaseUpgradeService.java
index bc3d526c8a1..cabd98878c0 100644
--- a/legacy/core/src/main/java/com/fsck/k9/service/DatabaseUpgradeService.java
+++ b/legacy/core/src/main/java/com/fsck/k9/service/DatabaseUpgradeService.java
@@ -9,14 +9,13 @@
 import android.content.Intent;
 import android.os.IBinder;
 import androidx.localbroadcastmanager.content.LocalBroadcastManager;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import app.k9mail.legacy.di.DI;
 import com.fsck.k9.K9;
 import com.fsck.k9.Preferences;
 import com.fsck.k9.mail.power.PowerManager;
 import com.fsck.k9.mail.power.WakeLock;
 import com.fsck.k9.mailstore.LocalStoreProvider;
+import net.thunderbird.core.android.account.LegacyAccount;
 import timber.log.Timber;
 
 /**
diff --git a/legacy/mailstore/build.gradle.kts b/legacy/mailstore/build.gradle.kts
index 4ab82b147d6..7952a932cb6 100644
--- a/legacy/mailstore/build.gradle.kts
+++ b/legacy/mailstore/build.gradle.kts
@@ -9,7 +9,7 @@ android {
 dependencies {
     implementation(projects.feature.search)
     implementation(projects.core.account)
-    implementation(projects.legacy.account)
+    implementation(projects.core.android.account)
     implementation(projects.legacy.di)
     implementation(projects.legacy.message)
 
diff --git a/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/FolderRepository.kt b/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/FolderRepository.kt
index f270a4915fd..e290779fd41 100644
--- a/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/FolderRepository.kt
+++ b/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/FolderRepository.kt
@@ -2,7 +2,6 @@ package app.k9mail.legacy.mailstore
 
 import app.k9mail.core.mail.folder.api.Folder
 import app.k9mail.core.mail.folder.api.FolderDetails
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderTypeMapper.folderTypeOf
 import app.k9mail.legacy.mailstore.RemoteFolderTypeMapper.toFolderType
 import kotlinx.coroutines.CoroutineDispatcher
@@ -15,6 +14,7 @@ import kotlinx.coroutines.flow.buffer
 import kotlinx.coroutines.flow.callbackFlow
 import kotlinx.coroutines.flow.distinctUntilChanged
 import kotlinx.coroutines.flow.flowOn
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.folder.api.RemoteFolder
 
 @Suppress("TooManyFunctions")
diff --git a/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/FolderTypeMapper.kt b/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/FolderTypeMapper.kt
index 186295e26d0..3e586b19f97 100644
--- a/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/FolderTypeMapper.kt
+++ b/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/FolderTypeMapper.kt
@@ -1,7 +1,7 @@
 package app.k9mail.legacy.mailstore
 
 import app.k9mail.core.mail.folder.api.FolderType
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 
 object FolderTypeMapper {
 
diff --git a/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/MessageStoreFactory.kt b/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/MessageStoreFactory.kt
index d0a22a26df0..627bee8cb45 100644
--- a/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/MessageStoreFactory.kt
+++ b/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/MessageStoreFactory.kt
@@ -1,6 +1,6 @@
 package app.k9mail.legacy.mailstore
 
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 
 interface MessageStoreFactory {
     fun create(account: LegacyAccount): ListenableMessageStore
diff --git a/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/MessageStoreManager.kt b/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/MessageStoreManager.kt
index c38b14e70eb..b2ccf14400c 100644
--- a/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/MessageStoreManager.kt
+++ b/legacy/mailstore/src/main/java/app/k9mail/legacy/mailstore/MessageStoreManager.kt
@@ -1,8 +1,8 @@
 package app.k9mail.legacy.mailstore
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import java.util.concurrent.ConcurrentHashMap
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 
 class MessageStoreManager(
     private val accountManager: AccountManager,
diff --git a/legacy/message/build.gradle.kts b/legacy/message/build.gradle.kts
index 3765750a5ed..29ebe3d6706 100644
--- a/legacy/message/build.gradle.kts
+++ b/legacy/message/build.gradle.kts
@@ -7,7 +7,7 @@ android {
 }
 
 dependencies {
-    implementation(projects.legacy.account)
+    implementation(projects.core.android.account)
     implementation(projects.feature.search)
 
     implementation(projects.mail.common)
diff --git a/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessageCountsProvider.kt b/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessageCountsProvider.kt
index f59e785563d..3c78d1d9edd 100644
--- a/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessageCountsProvider.kt
+++ b/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessageCountsProvider.kt
@@ -1,7 +1,7 @@
 package app.k9mail.legacy.message.controller
 
-import app.k9mail.legacy.account.LegacyAccount
 import kotlinx.coroutines.flow.Flow
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.LocalSearch
 import net.thunderbird.feature.search.SearchAccount
 
diff --git a/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessagingControllerMailChecker.kt b/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessagingControllerMailChecker.kt
index 747e8889309..421d59af2e8 100644
--- a/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessagingControllerMailChecker.kt
+++ b/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessagingControllerMailChecker.kt
@@ -1,6 +1,6 @@
 package app.k9mail.legacy.message.controller
 
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 
 interface MessagingControllerMailChecker {
     fun checkMail(
diff --git a/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessagingListener.java b/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessagingListener.java
index 363cd9e3a58..a5aee2d185a 100644
--- a/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessagingListener.java
+++ b/legacy/message/src/main/java/app/k9mail/legacy/message/controller/MessagingListener.java
@@ -3,12 +3,10 @@
 
 
 import java.util.List;
-
 import android.content.Context;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import com.fsck.k9.mail.Message;
 import com.fsck.k9.mail.Part;
+import net.thunderbird.core.android.account.LegacyAccount;
 
 
 public interface MessagingListener {
diff --git a/legacy/message/src/main/java/app/k9mail/legacy/message/controller/SimpleMessagingListener.java b/legacy/message/src/main/java/app/k9mail/legacy/message/controller/SimpleMessagingListener.java
index fcdbbd24061..578a98d6fc0 100644
--- a/legacy/message/src/main/java/app/k9mail/legacy/message/controller/SimpleMessagingListener.java
+++ b/legacy/message/src/main/java/app/k9mail/legacy/message/controller/SimpleMessagingListener.java
@@ -5,10 +5,9 @@
 import java.util.List;
 
 import android.content.Context;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import com.fsck.k9.mail.Message;
 import com.fsck.k9.mail.Part;
+import net.thunderbird.core.android.account.LegacyAccount;
 
 
 public abstract class SimpleMessagingListener implements MessagingListener {
diff --git a/legacy/storage/src/main/java/com/fsck/k9/storage/messages/K9MessageStoreFactory.kt b/legacy/storage/src/main/java/com/fsck/k9/storage/messages/K9MessageStoreFactory.kt
index 5b69f349a63..15cddcfdc1c 100644
--- a/legacy/storage/src/main/java/com/fsck/k9/storage/messages/K9MessageStoreFactory.kt
+++ b/legacy/storage/src/main/java/com/fsck/k9/storage/messages/K9MessageStoreFactory.kt
@@ -1,12 +1,12 @@
 package com.fsck.k9.storage.messages
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.ListenableMessageStore
 import app.k9mail.legacy.mailstore.MessageStoreFactory
 import com.fsck.k9.mailstore.LocalStoreProvider
 import com.fsck.k9.mailstore.NotifierMessageStore
 import com.fsck.k9.mailstore.StorageFilesProviderFactory
 import com.fsck.k9.message.extractors.BasicPartInfoExtractor
+import net.thunderbird.core.android.account.LegacyAccount
 
 class K9MessageStoreFactory(
     private val localStoreProvider: LocalStoreProvider,
diff --git a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo74.kt b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo74.kt
index f0eb9dde6ee..6771588bab9 100644
--- a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo74.kt
+++ b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo74.kt
@@ -2,8 +2,8 @@ package com.fsck.k9.storage.migrations
 
 import android.content.ContentValues
 import android.database.sqlite.SQLiteDatabase
-import app.k9mail.legacy.account.DeletePolicy
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.DeletePolicy
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Remove all placeholder entries in 'messages' table
diff --git a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo76.kt b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo76.kt
index 7fa87e08a24..ccbef1202c1 100644
--- a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo76.kt
+++ b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo76.kt
@@ -4,8 +4,8 @@ import android.content.ContentValues
 import android.database.sqlite.SQLiteDatabase
 import app.k9mail.core.android.common.database.map
 import app.k9mail.core.common.mail.Protocols
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.mailstore.MigrationsHelper
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 /**
diff --git a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo85.kt b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo85.kt
index 0d8ba004eff..f0f3abc535e 100644
--- a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo85.kt
+++ b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo85.kt
@@ -3,9 +3,9 @@ package com.fsck.k9.storage.migrations
 import android.database.sqlite.SQLiteDatabase
 import android.os.Build
 import androidx.core.content.contentValuesOf
-import app.k9mail.legacy.account.FolderMode
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.mailstore.MigrationsHelper
+import net.thunderbird.core.android.account.FolderMode
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class MigrationTo85(private val db: SQLiteDatabase, private val migrationsHelper: MigrationsHelper) {
     fun addFoldersNotificationsEnabledColumn() {
diff --git a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo86.kt b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo86.kt
index 977f523fe5e..13e109a6c0b 100644
--- a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo86.kt
+++ b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo86.kt
@@ -3,8 +3,8 @@ package com.fsck.k9.storage.migrations
 import android.database.sqlite.SQLiteDatabase
 import android.os.Build
 import androidx.core.content.contentValuesOf
-import app.k9mail.legacy.account.FolderMode
 import com.fsck.k9.mailstore.MigrationsHelper
+import net.thunderbird.core.android.account.FolderMode
 
 internal class MigrationTo86(private val db: SQLiteDatabase, private val migrationsHelper: MigrationsHelper) {
     fun addFoldersPushEnabledColumn() {
diff --git a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo87.kt b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo87.kt
index ebfba409fd4..771b563a9cf 100644
--- a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo87.kt
+++ b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo87.kt
@@ -3,8 +3,8 @@ package com.fsck.k9.storage.migrations
 import android.database.sqlite.SQLiteDatabase
 import android.os.Build
 import androidx.core.content.contentValuesOf
-import app.k9mail.legacy.account.FolderMode
 import com.fsck.k9.mailstore.MigrationsHelper
+import net.thunderbird.core.android.account.FolderMode
 
 internal class MigrationTo87(private val db: SQLiteDatabase, private val migrationsHelper: MigrationsHelper) {
     fun addFoldersSyncEnabledColumn() {
diff --git a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo88.kt b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo88.kt
index ef46f2307ad..fac96f092ed 100644
--- a/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo88.kt
+++ b/legacy/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo88.kt
@@ -3,8 +3,8 @@ package com.fsck.k9.storage.migrations
 import android.database.sqlite.SQLiteDatabase
 import android.os.Build
 import androidx.core.content.contentValuesOf
-import app.k9mail.legacy.account.FolderMode
 import com.fsck.k9.mailstore.MigrationsHelper
+import net.thunderbird.core.android.account.FolderMode
 
 internal class MigrationTo88(private val db: SQLiteDatabase, private val migrationsHelper: MigrationsHelper) {
     fun addFoldersVisibleColumn() {
diff --git a/legacy/storage/src/main/java/com/fsck/k9/storage/notifications/K9NotificationStoreProvider.kt b/legacy/storage/src/main/java/com/fsck/k9/storage/notifications/K9NotificationStoreProvider.kt
index 76e670ff049..75040747785 100644
--- a/legacy/storage/src/main/java/com/fsck/k9/storage/notifications/K9NotificationStoreProvider.kt
+++ b/legacy/storage/src/main/java/com/fsck/k9/storage/notifications/K9NotificationStoreProvider.kt
@@ -1,9 +1,9 @@
 package com.fsck.k9.storage.notifications
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.mailstore.LocalStoreProvider
 import com.fsck.k9.notification.NotificationStore
 import com.fsck.k9.notification.NotificationStoreProvider
+import net.thunderbird.core.android.account.LegacyAccount
 
 class K9NotificationStoreProvider(private val localStoreProvider: LocalStoreProvider) : NotificationStoreProvider {
     override fun getNotificationStore(account: LegacyAccount): NotificationStore {
diff --git a/legacy/ui/folder/build.gradle.kts b/legacy/ui/folder/build.gradle.kts
index 04556648a0f..f44e54a7e3e 100644
--- a/legacy/ui/folder/build.gradle.kts
+++ b/legacy/ui/folder/build.gradle.kts
@@ -12,7 +12,7 @@ dependencies {
     implementation(projects.core.mail.folder.api)
 
     implementation(projects.core.account)
-    implementation(projects.legacy.account)
+    implementation(projects.core.android.account)
     implementation(projects.legacy.mailstore)
     implementation(projects.legacy.message)
     implementation(projects.feature.folder.api)
diff --git a/legacy/ui/folder/src/main/java/app/k9mail/legacy/ui/folder/DefaultDisplayFolderRepository.kt b/legacy/ui/folder/src/main/java/app/k9mail/legacy/ui/folder/DefaultDisplayFolderRepository.kt
index 0291777d27d..71536f104d0 100644
--- a/legacy/ui/folder/src/main/java/app/k9mail/legacy/ui/folder/DefaultDisplayFolderRepository.kt
+++ b/legacy/ui/folder/src/main/java/app/k9mail/legacy/ui/folder/DefaultDisplayFolderRepository.kt
@@ -2,8 +2,6 @@ package app.k9mail.legacy.ui.folder
 
 import app.k9mail.core.mail.folder.api.Folder
 import app.k9mail.core.mail.folder.api.FolderType
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderSettingsChangedListener
 import app.k9mail.legacy.mailstore.FolderTypeMapper
 import app.k9mail.legacy.mailstore.MessageStoreManager
@@ -19,6 +17,8 @@ import kotlinx.coroutines.flow.buffer
 import kotlinx.coroutines.flow.callbackFlow
 import kotlinx.coroutines.flow.distinctUntilChanged
 import kotlinx.coroutines.flow.flowOn
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 
 class DefaultDisplayFolderRepository(
     private val accountManager: AccountManager,
diff --git a/legacy/ui/folder/src/main/java/app/k9mail/legacy/ui/folder/DisplayFolderRepository.kt b/legacy/ui/folder/src/main/java/app/k9mail/legacy/ui/folder/DisplayFolderRepository.kt
index 7881193fea2..e42ee89ee62 100644
--- a/legacy/ui/folder/src/main/java/app/k9mail/legacy/ui/folder/DisplayFolderRepository.kt
+++ b/legacy/ui/folder/src/main/java/app/k9mail/legacy/ui/folder/DisplayFolderRepository.kt
@@ -1,7 +1,7 @@
 package app.k9mail.legacy.ui.folder
 
-import app.k9mail.legacy.account.LegacyAccount
 import kotlinx.coroutines.flow.Flow
+import net.thunderbird.core.android.account.LegacyAccount
 
 interface DisplayFolderRepository {
 
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/account/AccountRemover.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/account/AccountRemover.kt
index f59e163e777..093882a1d40 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/account/AccountRemover.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/account/AccountRemover.kt
@@ -1,12 +1,12 @@
 package com.fsck.k9.account
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.Core
 import com.fsck.k9.LocalKeyStoreManager
 import com.fsck.k9.Preferences
 import com.fsck.k9.backend.BackendManager
 import com.fsck.k9.controller.MessagingController
 import com.fsck.k9.mailstore.LocalStoreProvider
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 /**
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/AccountList.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/AccountList.kt
index 996b7a8d5f4..4f179c028b4 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/AccountList.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/AccountList.kt
@@ -9,7 +9,6 @@ import android.widget.ArrayAdapter
 import androidx.lifecycle.Lifecycle
 import androidx.lifecycle.lifecycleScope
 import androidx.lifecycle.repeatOnLifecycle
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.CoreResourceProvider
 import com.fsck.k9.K9.isShowUnifiedInbox
 import com.fsck.k9.Preferences.Companion.getPreferences
@@ -19,6 +18,7 @@ import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.withContext
 import net.thunderbird.core.account.BaseAccount
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.SearchAccount.Companion.createUnifiedInboxAccount
 import org.koin.android.ext.android.inject
 
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/ChooseIdentity.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/ChooseIdentity.java
index a781410877a..a601c83daad 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/ChooseIdentity.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/ChooseIdentity.java
@@ -4,14 +4,13 @@
 import android.content.Intent;
 import android.os.Bundle;
 import android.view.View;
-import android.view.Window;
 import android.widget.AdapterView;
 import android.widget.ArrayAdapter;
 import android.widget.ListView;
 import android.widget.Toast;
-import app.k9mail.legacy.account.LegacyAccount;
+import net.thunderbird.core.android.account.Identity;
+import net.thunderbird.core.android.account.LegacyAccount;
 import app.k9mail.legacy.di.DI;
-import app.k9mail.legacy.account.Identity;
 import com.fsck.k9.Preferences;
 import com.fsck.k9.ui.R;
 import com.fsck.k9.ui.identity.IdentityFormatter;
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/EditIdentity.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/EditIdentity.kt
index 2d502068e07..92d8c5c8f8e 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/EditIdentity.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/EditIdentity.kt
@@ -9,13 +9,13 @@ import androidx.core.content.IntentCompat
 import androidx.core.os.BundleCompat
 import androidx.core.view.isVisible
 import androidx.core.widget.doAfterTextChanged
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.EmailAddressValidator
 import com.fsck.k9.Preferences
 import com.fsck.k9.ui.R
 import com.fsck.k9.ui.base.K9Activity
 import com.google.android.material.checkbox.MaterialCheckBox
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 import org.koin.android.ext.android.inject
 
 class EditIdentity : K9Activity() {
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/FolderInfoHolder.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/FolderInfoHolder.kt
index 468a9d70c19..0026fe30059 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/FolderInfoHolder.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/FolderInfoHolder.kt
@@ -2,9 +2,9 @@ package com.fsck.k9.activity
 
 import app.k9mail.core.mail.folder.api.Folder
 import app.k9mail.core.mail.folder.api.FolderType
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.ui.folder.FolderNameFormatter
 import com.fsck.k9.mailstore.LocalFolder
+import net.thunderbird.core.android.account.LegacyAccount
 
 class FolderInfoHolder(
     private val folderNameFormatter: FolderNameFormatter,
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/ManageIdentities.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/ManageIdentities.java
index a4e01faa7bc..815237a3775 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/ManageIdentities.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/ManageIdentities.java
@@ -13,7 +13,7 @@
 import android.widget.ListView;
 import android.widget.Toast;
 
-import app.k9mail.legacy.account.Identity;
+import net.thunderbird.core.android.account.Identity;
 import com.fsck.k9.Preferences;
 import com.fsck.k9.ui.R;
 
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java
index 361f52119df..9e62471a48d 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java
@@ -35,13 +35,11 @@
 import android.view.View.OnClickListener;
 import android.view.View.OnFocusChangeListener;
 import android.view.ViewStub;
-import android.view.Window;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.PopupMenu;
 import android.widget.Toast;
-
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.annotation.StringRes;
@@ -51,10 +49,9 @@
 import app.k9mail.core.ui.legacy.designsystem.atom.icon.Icons;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.engine.DiskCacheStrategy;
-import app.k9mail.legacy.account.LegacyAccount;
-import app.k9mail.legacy.account.MessageFormat;
+import net.thunderbird.core.android.account.LegacyAccount;
 import app.k9mail.legacy.di.DI;
-import app.k9mail.legacy.account.Identity;
+import net.thunderbird.core.android.account.Identity;
 import com.fsck.k9.K9;
 import com.fsck.k9.Preferences;
 import com.fsck.k9.activity.MessageLoaderHelper.MessageLoaderCallbacks;
@@ -119,6 +116,7 @@
 import com.fsck.k9.ui.messagelist.DefaultFolderProvider;
 import com.google.android.material.dialog.MaterialAlertDialogBuilder;
 import com.google.android.material.textview.MaterialTextView;
+import net.thunderbird.core.android.account.MessageFormat;
 import net.thunderbird.core.contact.ContactIntentHelper;
 import net.thunderbird.core.ui.theme.manager.ThemeManager;
 import net.thunderbird.feature.search.LocalSearch;
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt
index d6519335047..be7f5cdba41 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt
@@ -36,8 +36,6 @@ import app.k9mail.core.ui.legacy.designsystem.atom.icon.Icons
 import app.k9mail.feature.funding.api.FundingManager
 import app.k9mail.feature.launcher.FeatureLauncherActivity
 import app.k9mail.feature.launcher.FeatureLauncherTarget
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import com.fsck.k9.CoreResourceProvider
 import com.fsck.k9.K9
@@ -65,6 +63,8 @@ import com.fsck.k9.ui.settings.SettingsActivity
 import com.fsck.k9.view.ViewSwitcher
 import com.fsck.k9.view.ViewSwitcher.OnSwitchCompleteListener
 import com.google.android.material.textview.MaterialTextView
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.preferences.GeneralSettingsManager
 import net.thunderbird.feature.navigation.drawer.api.NavigationDrawer
 import net.thunderbird.feature.navigation.drawer.dropdown.DropDownDrawer
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageLoaderHelper.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageLoaderHelper.java
index ca487df02eb..da180944460 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageLoaderHelper.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageLoaderHelper.java
@@ -15,8 +15,6 @@
 import androidx.loader.app.LoaderManager;
 import androidx.loader.app.LoaderManager.LoaderCallbacks;
 import androidx.loader.content.Loader;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import com.fsck.k9.Preferences;
 import com.fsck.k9.autocrypt.AutocryptOperations;
 import app.k9mail.legacy.message.controller.MessageReference;
@@ -35,6 +33,7 @@
 import com.fsck.k9.ui.crypto.OpenPgpApiFactory;
 import com.fsck.k9.ui.message.LocalMessageExtractorLoader;
 import com.fsck.k9.ui.message.LocalMessageLoader;
+import net.thunderbird.core.android.account.LegacyAccount;
 import org.openintents.openpgp.OpenPgpDecryptionResult;
 import timber.log.Timber;
 
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/UpgradeDatabases.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/UpgradeDatabases.java
index d3bce4f93e4..be74cbe17f4 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/UpgradeDatabases.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/UpgradeDatabases.java
@@ -11,7 +11,7 @@
 
 import androidx.core.content.IntentCompat;
 import androidx.localbroadcastmanager.content.LocalBroadcastManager;
-import app.k9mail.legacy.account.LegacyAccount;
+import net.thunderbird.core.android.account.LegacyAccount;
 import com.fsck.k9.K9;
 import com.fsck.k9.Preferences;
 import com.fsck.k9.controller.MessagingController;
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/IdentityAdapter.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/IdentityAdapter.java
index af00d2aaf62..d64c8a1c68d 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/IdentityAdapter.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/IdentityAdapter.java
@@ -11,9 +11,9 @@
 import android.view.ViewGroup;
 import android.widget.BaseAdapter;
 
-import app.k9mail.legacy.account.LegacyAccount;
+import net.thunderbird.core.android.account.LegacyAccount;
 import app.k9mail.legacy.di.DI;
-import app.k9mail.legacy.account.Identity;
+import net.thunderbird.core.android.account.Identity;
 import com.fsck.k9.Preferences;
 import com.fsck.k9.ui.R;
 import com.fsck.k9.ui.identity.IdentityFormatter;
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/MessageActions.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/MessageActions.java
index 1dbecc798ef..c2e2fef5b34 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/MessageActions.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/MessageActions.java
@@ -6,10 +6,11 @@
 
 import app.k9mail.feature.launcher.FeatureLauncherActivity;
 import app.k9mail.feature.launcher.FeatureLauncherTarget.AccountSetup;
-import app.k9mail.legacy.account.LegacyAccount;
 import com.fsck.k9.Preferences;
 import com.fsck.k9.activity.MessageCompose;
 import app.k9mail.legacy.message.controller.MessageReference;
+import net.thunderbird.core.android.account.LegacyAccount;
+
 
 public class MessageActions {
     /**
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.kt
index b7f17a92bd9..114de826637 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.kt
@@ -11,8 +11,6 @@ import android.os.Bundle
 import android.view.Menu
 import androidx.core.content.ContextCompat
 import androidx.loader.app.LoaderManager
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.K9
 import com.fsck.k9.activity.compose.ComposeCryptoStatus.AttachErrorState
 import com.fsck.k9.activity.compose.ComposeCryptoStatus.SendErrorState
@@ -32,6 +30,8 @@ import com.fsck.k9.message.MessageBuilder
 import com.fsck.k9.message.PgpMessageBuilder
 import com.fsck.k9.ui.R
 import com.fsck.k9.view.RecipientSelectView.Recipient
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.contact.ContactIntentHelper
 import org.openintents.openpgp.OpenPgpApiManager
 import org.openintents.openpgp.OpenPgpApiManager.OpenPgpApiManagerCallback
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToPresenter.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToPresenter.kt
index e2d99b7d220..e9c31e87b28 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToPresenter.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToPresenter.kt
@@ -1,9 +1,9 @@
 package com.fsck.k9.activity.compose
 
 import android.os.Bundle
-import app.k9mail.legacy.account.Identity
 import com.fsck.k9.mail.Address
 import com.fsck.k9.mail.Message
+import net.thunderbird.core.android.account.Identity
 
 private const val STATE_KEY_REPLY_TO_SHOWN = "com.fsck.k9.activity.compose.ReplyToPresenter.replyToShown"
 
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/SaveMessageTask.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/SaveMessageTask.java
index 4b7ac8750ec..7b52fa2aae6 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/SaveMessageTask.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/SaveMessageTask.java
@@ -4,7 +4,7 @@
 import android.os.AsyncTask;
 import android.os.Handler;
 
-import app.k9mail.legacy.account.LegacyAccount;
+import net.thunderbird.core.android.account.LegacyAccount;
 import com.fsck.k9.activity.MessageCompose;
 import com.fsck.k9.controller.MessagingController;
 import com.fsck.k9.mail.Message;
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.kt
index 3d49be80fb9..bd19b5fd233 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.kt
@@ -9,13 +9,13 @@ import android.widget.EditText
 import android.widget.LinearLayout
 import androidx.core.view.isVisible
 import androidx.core.widget.doAfterTextChanged
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.EmailAddressValidator
 import com.fsck.k9.Preferences
 import com.fsck.k9.ui.R
 import com.fsck.k9.ui.base.K9Activity
 import com.google.android.material.checkbox.MaterialCheckBox
 import com.google.android.material.radiobutton.MaterialRadioButton
+import net.thunderbird.core.android.account.LegacyAccount
 import org.koin.android.ext.android.inject
 
 class AccountSetupComposition : K9Activity() {
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderActivity.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderActivity.kt
index 8ffb6adab95..dee874c0099 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderActivity.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderActivity.kt
@@ -10,7 +10,6 @@ import androidx.appcompat.widget.SearchView
 import androidx.recyclerview.widget.RecyclerView
 import app.k9mail.core.mail.folder.api.FolderType
 import app.k9mail.core.ui.legacy.designsystem.atom.icon.Icons
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import app.k9mail.legacy.ui.folder.DisplayFolder
 import app.k9mail.legacy.ui.folder.FolderIconProvider
@@ -22,6 +21,7 @@ import com.fsck.k9.ui.base.K9Activity
 import com.mikepenz.fastadapter.FastAdapter
 import com.mikepenz.fastadapter.adapters.ItemAdapter
 import java.util.Locale
+import net.thunderbird.core.android.account.LegacyAccount
 import org.koin.android.ext.android.inject
 import org.koin.androidx.viewmodel.ext.android.viewModel
 import org.koin.core.parameter.parametersOf
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderViewModel.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderViewModel.kt
index fc727aae4c4..dcabef6acfe 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderViewModel.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderViewModel.kt
@@ -4,13 +4,13 @@ import androidx.lifecycle.LiveData
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.asLiveData
 import androidx.lifecycle.viewModelScope
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.ui.folder.DisplayFolder
 import app.k9mail.legacy.ui.folder.DisplayFolderRepository
 import kotlinx.coroutines.ExperimentalCoroutinesApi
 import kotlinx.coroutines.flow.MutableSharedFlow
 import kotlinx.coroutines.flow.flatMapLatest
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.LegacyAccount
 
 @OptIn(ExperimentalCoroutinesApi::class)
 class ChooseFolderViewModel(
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/compose/QuotedMessagePresenter.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/compose/QuotedMessagePresenter.java
index 248619ca3bb..42de571123e 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/compose/QuotedMessagePresenter.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/compose/QuotedMessagePresenter.java
@@ -7,9 +7,8 @@
 
 import androidx.annotation.NonNull;
 import app.k9mail.core.android.common.compat.BundleCompat;
-import app.k9mail.legacy.account.LegacyAccount;
-import app.k9mail.legacy.account.MessageFormat;
-import app.k9mail.legacy.account.QuoteStyle;
+import net.thunderbird.core.android.account.LegacyAccount;
+import net.thunderbird.core.android.account.MessageFormat;
 import app.k9mail.legacy.di.DI;
 import com.fsck.k9.activity.MessageCompose;
 import com.fsck.k9.activity.MessageCompose.Action;
@@ -30,6 +29,7 @@
 import com.fsck.k9.message.quote.TextQuoteCreator;
 import com.fsck.k9.message.signature.HtmlSignatureRemover;
 import com.fsck.k9.message.signature.TextSignatureRemover;
+import net.thunderbird.core.android.account.QuoteStyle;
 import timber.log.Timber;
 
 
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptKeyTransferPresenter.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptKeyTransferPresenter.kt
index 139223613a4..a06cabf1180 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptKeyTransferPresenter.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptKeyTransferPresenter.kt
@@ -2,11 +2,11 @@ package com.fsck.k9.ui.endtoend
 
 import android.app.PendingIntent
 import androidx.lifecycle.LifecycleOwner
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.Preferences
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.MainScope
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.LegacyAccount
 import org.openintents.openpgp.OpenPgpApiManager
 import org.openintents.openpgp.OpenPgpApiManager.OpenPgpApiManagerCallback
 import org.openintents.openpgp.OpenPgpApiManager.OpenPgpProviderError
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupMessageLiveEvent.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupMessageLiveEvent.kt
index 5fbee7f3e5d..870e58fd18b 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupMessageLiveEvent.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupMessageLiveEvent.kt
@@ -3,7 +3,6 @@ package com.fsck.k9.ui.endtoend
 import android.app.PendingIntent
 import android.content.Intent
 import androidx.core.content.IntentCompat
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.autocrypt.AutocryptTransferMessageCreator
 import com.fsck.k9.helper.SingleLiveEvent
 import com.fsck.k9.mail.Address
@@ -15,6 +14,7 @@ import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.MainScope
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.withContext
+import net.thunderbird.core.android.account.LegacyAccount
 import org.openintents.openpgp.util.OpenPgpApi
 
 class AutocryptSetupMessageLiveEvent(
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupTransferLiveEvent.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupTransferLiveEvent.kt
index c755cff2b36..0062b0ffde5 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupTransferLiveEvent.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupTransferLiveEvent.kt
@@ -1,7 +1,6 @@
 package com.fsck.k9.ui.endtoend
 
 import android.app.PendingIntent
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.controller.MessagingController
 import com.fsck.k9.helper.SingleLiveEvent
 import kotlinx.coroutines.CoroutineScope
@@ -10,6 +9,7 @@ import kotlinx.coroutines.MainScope
 import kotlinx.coroutines.async
 import kotlinx.coroutines.delay
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.LegacyAccount
 
 class AutocryptSetupTransferLiveEvent(
     private val messagingController: MessagingController,
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/helper/DisplayAddressHelper.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/helper/DisplayAddressHelper.kt
index d4963c86b03..8643b03f606 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/helper/DisplayAddressHelper.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/helper/DisplayAddressHelper.kt
@@ -1,6 +1,6 @@
 package com.fsck.k9.ui.helper
 
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 
 object DisplayAddressHelper {
     fun shouldShowRecipients(account: LegacyAccount, folderId: Long): Boolean {
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/identity/IdentityFormatter.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/identity/IdentityFormatter.kt
index 6642e515752..eaa1deedc1c 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/identity/IdentityFormatter.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/identity/IdentityFormatter.kt
@@ -1,6 +1,6 @@
 package com.fsck.k9.ui.identity
 
-import app.k9mail.legacy.account.Identity
+import net.thunderbird.core.android.account.Identity
 
 class IdentityFormatter {
     fun getDisplayName(identity: Identity): String {
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt
index 9528157c6d9..a79eca7cd9e 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt
@@ -2,12 +2,12 @@ package com.fsck.k9.ui.managefolders
 
 import androidx.preference.PreferenceDataStore
 import app.k9mail.core.mail.folder.api.FolderDetails
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.SupervisorJob
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.LegacyAccount
 
 class FolderSettingsDataStore(
     private val folderRepository: FolderRepository,
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsViewModel.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsViewModel.kt
index f23903e258c..ebd16f83a4b 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsViewModel.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsViewModel.kt
@@ -6,13 +6,13 @@ import androidx.lifecycle.liveData
 import androidx.lifecycle.viewModelScope
 import app.k9mail.core.mail.folder.api.Folder
 import app.k9mail.core.mail.folder.api.FolderDetails
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import com.fsck.k9.Preferences
 import com.fsck.k9.controller.MessagingController
 import com.fsck.k9.helper.SingleLiveEvent
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.withContext
+import net.thunderbird.core.android.account.LegacyAccount
 import timber.log.Timber
 
 private const val NO_FOLDER_ID = 0L
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersActivity.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersActivity.kt
index 89a70f13fa7..f370a4bfdd7 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersActivity.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersActivity.kt
@@ -7,10 +7,10 @@ import androidx.core.os.bundleOf
 import androidx.navigation.NavController
 import androidx.navigation.ui.AppBarConfiguration
 import androidx.navigation.ui.setupActionBarWithNavController
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.ui.R
 import com.fsck.k9.ui.base.K9Activity
 import com.fsck.k9.ui.base.extensions.findNavController
+import net.thunderbird.core.android.account.LegacyAccount
 
 class ManageFoldersActivity : K9Activity() {
     private lateinit var navController: NavController
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersFragment.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersFragment.kt
index 49266b83d28..6ae0d6e7d6c 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersFragment.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersFragment.kt
@@ -12,7 +12,6 @@ import androidx.core.os.bundleOf
 import androidx.fragment.app.Fragment
 import androidx.navigation.fragment.findNavController
 import androidx.recyclerview.widget.RecyclerView
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.ui.folder.DisplayFolder
 import app.k9mail.legacy.ui.folder.FolderIconProvider
 import app.k9mail.legacy.ui.folder.FolderNameFormatter
@@ -23,6 +22,7 @@ import com.fsck.k9.ui.base.livedata.observeNotNull
 import com.mikepenz.fastadapter.FastAdapter
 import com.mikepenz.fastadapter.adapters.ItemAdapter
 import java.util.Locale
+import net.thunderbird.core.android.account.LegacyAccount
 import org.koin.android.ext.android.inject
 import org.koin.androidx.viewmodel.ext.android.viewModel
 import org.koin.core.parameter.parametersOf
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersViewModel.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersViewModel.kt
index 5e69f544672..df78172d102 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersViewModel.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersViewModel.kt
@@ -3,9 +3,9 @@ package com.fsck.k9.ui.managefolders
 import androidx.lifecycle.LiveData
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.asLiveData
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.ui.folder.DisplayFolder
 import app.k9mail.legacy.ui.folder.DisplayFolderRepository
+import net.thunderbird.core.android.account.LegacyAccount
 
 class ManageFoldersViewModel(
     private val folderRepository: DisplayFolderRepository,
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/message/LocalMessageLoader.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/message/LocalMessageLoader.java
index ee7e7dd2820..1aa1787a112 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/message/LocalMessageLoader.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/message/LocalMessageLoader.java
@@ -4,9 +4,8 @@
 import android.content.Context;
 import androidx.loader.content.AsyncTaskLoader;
 
+import net.thunderbird.core.android.account.LegacyAccount;
 import timber.log.Timber;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import app.k9mail.legacy.message.controller.MessageReference;
 import com.fsck.k9.controller.MessagingController;
 import com.fsck.k9.mail.MessagingException;
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatter.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatter.kt
index 717de5b6df2..eb52bf1a167 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatter.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatter.kt
@@ -4,12 +4,12 @@ import android.content.res.Resources
 import android.text.Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
 import android.text.SpannableString
 import android.text.style.ForegroundColorSpan
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.K9
 import com.fsck.k9.helper.ContactNameProvider
 import com.fsck.k9.mail.Address
 import com.fsck.k9.ui.R
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Get the display name for a participant to be shown in the message details screen.
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagedetails/MessageDetailsViewModel.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagedetails/MessageDetailsViewModel.kt
index 4d2d382557e..1996cacea41 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagedetails/MessageDetailsViewModel.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagedetails/MessageDetailsViewModel.kt
@@ -10,8 +10,6 @@ import app.k9mail.core.android.common.contact.ContactPermissionResolver
 import app.k9mail.core.android.common.contact.ContactRepository
 import app.k9mail.core.common.mail.toEmailAddressOrNull
 import app.k9mail.core.mail.folder.api.Folder
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import app.k9mail.legacy.message.controller.MessageReference
 import app.k9mail.legacy.ui.folder.FolderNameFormatter
@@ -30,6 +28,8 @@ import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.MutableStateFlow
 import kotlinx.coroutines.flow.receiveAsFlow
 import kotlinx.coroutines.launch
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 
 @Suppress("TooManyFunctions")
 internal class MessageDetailsViewModel(
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/DefaultFolderProvider.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/DefaultFolderProvider.kt
index db0b2874993..9fb94a94579 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/DefaultFolderProvider.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/DefaultFolderProvider.kt
@@ -1,6 +1,6 @@
 package com.fsck.k9.ui.messagelist
 
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Decides which folder to display when an account is selected.
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListConfig.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListConfig.kt
index 0a949c6083e..6ee3f88741d 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListConfig.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListConfig.kt
@@ -1,7 +1,7 @@
 package com.fsck.k9.ui.messagelist
 
-import app.k9mail.legacy.account.SortType
 import app.k9mail.legacy.message.controller.MessageReference
+import net.thunderbird.core.android.account.SortType
 import net.thunderbird.feature.search.LocalSearch
 
 data class MessageListConfig(
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListFragment.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListFragment.kt
index 6a82111e7c7..ac59d46317a 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListFragment.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListFragment.kt
@@ -31,10 +31,6 @@ import androidx.fragment.app.Fragment
 import androidx.lifecycle.Observer
 import androidx.recyclerview.widget.RecyclerView
 import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.Expunge
-import app.k9mail.legacy.account.LegacyAccount
-import app.k9mail.legacy.account.SortType
 import app.k9mail.legacy.message.controller.MessageReference
 import app.k9mail.legacy.message.controller.SimpleMessagingListener
 import app.k9mail.legacy.ui.folder.FolderNameFormatter
@@ -67,6 +63,10 @@ import com.google.android.material.textview.MaterialTextView
 import java.util.concurrent.Future
 import kotlinx.datetime.Clock
 import net.jcip.annotations.GuardedBy
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.Expunge
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.SortType
 import net.thunderbird.core.android.network.ConnectivityManager
 import net.thunderbird.feature.search.LocalSearch
 import net.thunderbird.feature.search.SearchAccount
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListItem.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListItem.kt
index 6f42ce29bb8..e961574b734 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListItem.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListItem.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.ui.messagelist
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import com.fsck.k9.mail.Address
+import net.thunderbird.core.android.account.LegacyAccount
 
 data class MessageListItem(
     val account: LegacyAccount,
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListItemMapper.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListItemMapper.kt
index 8bafd9cd94b..ead93a2e3c7 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListItemMapper.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListItemMapper.kt
@@ -1,11 +1,11 @@
 package com.fsck.k9.ui.messagelist
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageDetailsAccessor
 import app.k9mail.legacy.mailstore.MessageMapper
 import app.k9mail.legacy.message.extractors.PreviewResult.PreviewType
 import com.fsck.k9.helper.MessageHelper
 import com.fsck.k9.ui.helper.DisplayAddressHelper
+import net.thunderbird.core.android.account.LegacyAccount
 
 class MessageListItemMapper(
     private val messageHelper: MessageHelper,
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListLiveData.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListLiveData.kt
index c1536d8e88a..0b5702991e0 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListLiveData.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListLiveData.kt
@@ -1,7 +1,6 @@
 package com.fsck.k9.ui.messagelist
 
 import androidx.lifecycle.LiveData
-import app.k9mail.legacy.account.AccountManager
 import app.k9mail.legacy.mailstore.MessageListChangedListener
 import app.k9mail.legacy.mailstore.MessageListRepository
 import com.fsck.k9.search.getAccountUuids
@@ -9,6 +8,7 @@ import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.withContext
+import net.thunderbird.core.android.account.AccountManager
 
 class MessageListLiveData(
     private val messageListLoader: MessageListLoader,
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListLoader.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListLoader.kt
index 7e4517a2851..23b155a4465 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListLoader.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListLoader.kt
@@ -1,7 +1,5 @@
 package com.fsck.k9.ui.messagelist
 
-import app.k9mail.legacy.account.LegacyAccount
-import app.k9mail.legacy.account.SortType
 import app.k9mail.legacy.mailstore.MessageListRepository
 import com.fsck.k9.Preferences
 import com.fsck.k9.helper.MessageHelper
@@ -9,6 +7,8 @@ import com.fsck.k9.mailstore.LocalStoreProvider
 import com.fsck.k9.mailstore.MessageColumns
 import com.fsck.k9.search.SqlQueryBuilder
 import com.fsck.k9.search.getAccounts
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.SortType
 import net.thunderbird.feature.search.LocalSearch
 import net.thunderbird.feature.search.api.SearchField
 import timber.log.Timber
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MlfUtils.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MlfUtils.java
index c402828f4b9..2a2e504ffaa 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MlfUtils.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MlfUtils.java
@@ -2,10 +2,7 @@
 
 
 import java.util.List;
-
 import android.text.TextUtils;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import app.k9mail.legacy.di.DI;
 import app.k9mail.legacy.message.controller.MessageReference;
 import com.fsck.k9.helper.Utility;
@@ -13,7 +10,8 @@
 import com.fsck.k9.mailstore.LocalFolder;
 import com.fsck.k9.mailstore.LocalStore;
 import com.fsck.k9.mailstore.LocalStoreProvider;
-import app.k9mail.legacy.account.AccountManager;
+import net.thunderbird.core.android.account.AccountManager;
+import net.thunderbird.core.android.account.LegacyAccount;
 
 
 public class MlfUtils {
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/SortTypeToastProvider.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/SortTypeToastProvider.kt
index 4ebe32bef0d..7c9a34a2113 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/SortTypeToastProvider.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/SortTypeToastProvider.kt
@@ -1,14 +1,14 @@
 package com.fsck.k9.ui.messagelist
 
-import app.k9mail.legacy.account.SortType
-import app.k9mail.legacy.account.SortType.SORT_ARRIVAL
-import app.k9mail.legacy.account.SortType.SORT_ATTACHMENT
-import app.k9mail.legacy.account.SortType.SORT_DATE
-import app.k9mail.legacy.account.SortType.SORT_FLAGGED
-import app.k9mail.legacy.account.SortType.SORT_SENDER
-import app.k9mail.legacy.account.SortType.SORT_SUBJECT
-import app.k9mail.legacy.account.SortType.SORT_UNREAD
 import com.fsck.k9.ui.R
+import net.thunderbird.core.android.account.SortType
+import net.thunderbird.core.android.account.SortType.SORT_ARRIVAL
+import net.thunderbird.core.android.account.SortType.SORT_ATTACHMENT
+import net.thunderbird.core.android.account.SortType.SORT_DATE
+import net.thunderbird.core.android.account.SortType.SORT_FLAGGED
+import net.thunderbird.core.android.account.SortType.SORT_SENDER
+import net.thunderbird.core.android.account.SortType.SORT_SUBJECT
+import net.thunderbird.core.android.account.SortType.SORT_UNREAD
 
 class SortTypeToastProvider {
     fun getToast(sortType: SortType, ascending: Boolean): Int {
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/AttachmentController.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/AttachmentController.java
index c0935481ae1..16febc88565 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/AttachmentController.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/AttachmentController.java
@@ -14,7 +14,7 @@
 import android.widget.Toast;
 
 import androidx.annotation.WorkerThread;
-import app.k9mail.legacy.account.LegacyAccount;
+import net.thunderbird.core.android.account.LegacyAccount;
 import com.fsck.k9.Preferences;
 import com.fsck.k9.controller.MessagingController;
 import app.k9mail.legacy.message.controller.SimpleMessagingListener;
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/DisplayRecipientsExtractor.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/DisplayRecipientsExtractor.kt
index 131f27493f6..02470d4518b 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/DisplayRecipientsExtractor.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/DisplayRecipientsExtractor.kt
@@ -1,7 +1,7 @@
 package com.fsck.k9.ui.messageview
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.mail.Message
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Extract recipient names from a message to display them in the message view.
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageCryptoPresenter.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageCryptoPresenter.java
index 35c44c49588..0a8bfd63e78 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageCryptoPresenter.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageCryptoPresenter.java
@@ -11,11 +11,10 @@
 import android.os.Parcelable;
 import androidx.annotation.Nullable;
 import android.text.TextUtils;
-
-import app.k9mail.legacy.account.LegacyAccount;
 import com.fsck.k9.mailstore.CryptoResultAnnotation;
 import com.fsck.k9.mailstore.MessageViewInfo;
 import com.fsck.k9.view.MessageCryptoDisplayStatus;
+import net.thunderbird.core.android.account.LegacyAccount;
 import timber.log.Timber;
 
 
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.kt
index 77b4a672203..d3219091667 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.kt
@@ -18,8 +18,6 @@ import android.widget.ProgressBar
 import app.k9mail.core.android.common.contact.ContactRepository
 import app.k9mail.core.common.mail.EmailAddress
 import app.k9mail.core.common.mail.toEmailAddressOrNull
-import app.k9mail.legacy.account.LegacyAccount
-import app.k9mail.legacy.account.ShowPictures
 import com.fsck.k9.mail.Message
 import com.fsck.k9.mailstore.AttachmentViewInfo
 import com.fsck.k9.mailstore.MessageViewInfo
@@ -30,6 +28,8 @@ import com.fsck.k9.view.ThemeUtils
 import com.fsck.k9.view.ToolableViewAnimator
 import com.google.android.material.button.MaterialButton
 import com.google.android.material.textview.MaterialTextView
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.ShowPictures
 import org.koin.core.component.KoinComponent
 import org.koin.core.component.inject
 
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt
index c9ff907e263..1774f00c52b 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt
@@ -29,8 +29,6 @@ import androidx.fragment.app.setFragmentResultListener
 import app.k9mail.core.android.common.activity.CreateDocumentResultContract
 import app.k9mail.core.ui.legacy.designsystem.atom.icon.Icons
 import app.k9mail.core.ui.theme.api.Theme
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import com.fsck.k9.K9
 import com.fsck.k9.activity.MessageCompose
@@ -58,6 +56,8 @@ import com.fsck.k9.ui.messageview.MessageCryptoPresenter.MessageCryptoMvpView
 import com.fsck.k9.ui.settings.account.AccountSettingsActivity
 import com.fsck.k9.ui.share.ShareIntentBuilder
 import java.util.Locale
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.preferences.GeneralSettingsManager
 import net.thunderbird.core.ui.theme.manager.ThemeManager
 import org.koin.android.ext.android.inject
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatter.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatter.kt
index ce32c3c16bd..274aeb97004 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatter.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatter.kt
@@ -4,12 +4,12 @@ import android.content.res.Resources
 import android.text.Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
 import android.text.SpannableString
 import android.text.style.ForegroundColorSpan
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.K9
 import com.fsck.k9.helper.ContactNameProvider
 import com.fsck.k9.mail.Address
 import com.fsck.k9.ui.R
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 
 /**
  * Get the display name for a recipient to be shown in the message view screen.
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/notification/DeleteConfirmationActivity.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/notification/DeleteConfirmationActivity.kt
index 7d159a92dab..c9ca63fb132 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/notification/DeleteConfirmationActivity.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/notification/DeleteConfirmationActivity.kt
@@ -4,7 +4,6 @@ import android.content.Context
 import android.content.Intent
 import android.os.Bundle
 import androidx.fragment.app.DialogFragment
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import com.fsck.k9.Preferences
 import com.fsck.k9.controller.MessageReferenceHelper
@@ -15,6 +14,7 @@ import com.fsck.k9.notification.NotificationActionService
 import com.fsck.k9.ui.R
 import com.fsck.k9.ui.base.K9Activity
 import com.fsck.k9.ui.base.ThemeType
+import net.thunderbird.core.android.account.LegacyAccount
 import org.koin.android.ext.android.inject
 
 class DeleteConfirmationActivity : K9Activity(ThemeType.DIALOG), ConfirmationDialogFragmentListener {
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/AccountItem.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/AccountItem.kt
index 14c610dac71..f862f25a0ba 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/AccountItem.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/AccountItem.kt
@@ -6,13 +6,13 @@ import android.widget.ImageView
 import androidx.core.view.isGone
 import androidx.core.view.isVisible
 import androidx.recyclerview.widget.RecyclerView
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.ui.R
 import com.google.android.material.textview.MaterialTextView
 import com.mikepenz.fastadapter.FastAdapter
 import com.mikepenz.fastadapter.drag.IDraggable
 import com.mikepenz.fastadapter.items.AbstractItem
 import com.mikepenz.fastadapter.listeners.TouchEventHook
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class AccountItem(
     val account: LegacyAccount,
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/SettingsListFragment.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/SettingsListFragment.kt
index f6483a88c64..df44de1a3eb 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/SettingsListFragment.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/SettingsListFragment.kt
@@ -21,7 +21,6 @@ import app.k9mail.feature.funding.api.FundingManager
 import app.k9mail.feature.funding.api.FundingType
 import app.k9mail.feature.launcher.FeatureLauncherActivity
 import app.k9mail.feature.launcher.FeatureLauncherTarget
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.ui.R
 import com.fsck.k9.ui.base.livedata.observeNotNull
 import com.fsck.k9.ui.settings.account.AccountSettingsActivity
@@ -32,6 +31,7 @@ import com.mikepenz.fastadapter.adapters.ItemAdapter
 import com.mikepenz.fastadapter.drag.ItemTouchCallback
 import com.mikepenz.fastadapter.drag.SimpleDragCallback
 import com.mikepenz.fastadapter.utils.DragDropUtil
+import net.thunderbird.core.android.account.LegacyAccount
 import org.koin.android.ext.android.inject
 import org.koin.androidx.viewmodel.ext.android.viewModel
 import app.k9mail.feature.settings.importing.R as SettingsImportR
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/SettingsViewModel.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/SettingsViewModel.kt
index f2e78a476cf..82ff895629f 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/SettingsViewModel.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/SettingsViewModel.kt
@@ -3,14 +3,14 @@ package com.fsck.k9.ui.settings
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.asLiveData
 import androidx.lifecycle.viewModelScope
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import kotlinx.coroutines.CoroutineDispatcher
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.NonCancellable
 import kotlinx.coroutines.delay
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.withContext
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class SettingsViewModel(
     private val accountManager: AccountManager,
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSelectionSpinner.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSelectionSpinner.kt
index df0282e95ff..6fe8a33d477 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSelectionSpinner.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSelectionSpinner.kt
@@ -9,9 +9,9 @@ import android.view.ViewGroup
 import android.widget.ArrayAdapter
 import androidx.appcompat.widget.AppCompatSpinner
 import androidx.core.view.isVisible
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.ui.R
 import com.google.android.material.textview.MaterialTextView
+import net.thunderbird.core.android.account.LegacyAccount
 
 class AccountSelectionSpinner : AppCompatSpinner {
     var selection: LegacyAccount
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt
index 32acb57d996..505b7c75137 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt
@@ -1,18 +1,18 @@
 package com.fsck.k9.ui.settings.account
 
 import androidx.preference.PreferenceDataStore
-import app.k9mail.legacy.account.DeletePolicy
-import app.k9mail.legacy.account.Expunge
-import app.k9mail.legacy.account.LegacyAccount
-import app.k9mail.legacy.account.MessageFormat
-import app.k9mail.legacy.account.QuoteStyle
-import app.k9mail.legacy.account.ShowPictures
 import com.fsck.k9.Preferences
 import com.fsck.k9.controller.MessagingController
 import com.fsck.k9.job.K9JobManager
 import com.fsck.k9.notification.NotificationChannelManager
 import com.fsck.k9.notification.NotificationController
 import java.util.concurrent.ExecutorService
+import net.thunderbird.core.android.account.DeletePolicy
+import net.thunderbird.core.android.account.Expunge
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.MessageFormat
+import net.thunderbird.core.android.account.QuoteStyle
+import net.thunderbird.core.android.account.ShowPictures
 import net.thunderbird.core.mail.folder.api.SpecialFolderSelection
 import net.thunderbird.feature.notification.NotificationLight
 import net.thunderbird.feature.notification.NotificationVibration
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStoreFactory.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStoreFactory.kt
index 250f98cbc6c..9ce884c2c17 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStoreFactory.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStoreFactory.kt
@@ -1,12 +1,12 @@
 package com.fsck.k9.ui.settings.account
 
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.Preferences
 import com.fsck.k9.controller.MessagingController
 import com.fsck.k9.job.K9JobManager
 import com.fsck.k9.notification.NotificationChannelManager
 import com.fsck.k9.notification.NotificationController
 import java.util.concurrent.ExecutorService
+import net.thunderbird.core.android.account.LegacyAccount
 
 class AccountSettingsDataStoreFactory(
     private val preferences: Preferences,
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt
index 189808e8101..407d96397f9 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt
@@ -19,9 +19,6 @@ import app.k9mail.core.featureflag.FeatureFlagProvider
 import app.k9mail.core.mail.folder.api.FolderType
 import app.k9mail.feature.launcher.FeatureLauncherActivity
 import app.k9mail.feature.launcher.FeatureLauncherTarget
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
-import app.k9mail.legacy.account.LegacyAccount
-import app.k9mail.legacy.account.QuoteStyle
 import com.fsck.k9.account.BackgroundAccountRemover
 import com.fsck.k9.activity.ManageIdentities
 import com.fsck.k9.activity.setup.AccountSetupComposition
@@ -40,6 +37,9 @@ import com.fsck.k9.ui.settings.oneTimeClickListener
 import com.fsck.k9.ui.settings.remove
 import com.fsck.k9.ui.settings.removeEntry
 import com.takisoft.preferencex.PreferenceFragmentCompat
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.QuoteStyle
 import net.thunderbird.feature.folder.api.RemoteFolder
 import org.koin.android.ext.android.inject
 import org.koin.androidx.viewmodel.ext.android.activityViewModel
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt
index f395333900e..0fdb93d54fb 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt
@@ -6,14 +6,14 @@ import androidx.lifecycle.ViewModel
 import androidx.lifecycle.asLiveData
 import androidx.lifecycle.viewModelScope
 import app.k9mail.core.mail.folder.api.FolderType
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import com.fsck.k9.mailstore.SpecialFolderSelectionStrategy
 import kotlinx.coroutines.CoroutineDispatcher
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.withContext
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.folder.api.RemoteFolder
 
 class AccountSettingsViewModel(
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/OpenPgpAppSelectDialog.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/OpenPgpAppSelectDialog.java
index 46d65b8839b..65aaad7cc2d 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/OpenPgpAppSelectDialog.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/OpenPgpAppSelectDialog.java
@@ -23,7 +23,7 @@
 
 import androidx.annotation.NonNull;
 import androidx.fragment.app.DialogFragment;
-import app.k9mail.legacy.account.LegacyAccount;
+import net.thunderbird.core.android.account.LegacyAccount;
 import com.fsck.k9.Preferences;
 import com.fsck.k9.ui.R;
 import com.fsck.k9.ui.base.K9Activity;
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/export/SettingsExportViewModel.kt b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/export/SettingsExportViewModel.kt
index ac4e6934a6c..6b4aa9ca6c3 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/export/SettingsExportViewModel.kt
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/ui/settings/export/SettingsExportViewModel.kt
@@ -7,7 +7,6 @@ import androidx.lifecycle.LiveData
 import androidx.lifecycle.MutableLiveData
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.viewModelScope
-import app.k9mail.legacy.account.AccountManager
 import com.fsck.k9.helper.SingleLiveEvent
 import com.fsck.k9.helper.measureRealtimeMillis
 import com.fsck.k9.logging.Timber
@@ -16,6 +15,7 @@ import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.delay
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.withContext
+import net.thunderbird.core.android.account.AccountManager
 
 private typealias AccountUuid = String
 private typealias AccountNumber = Int
diff --git a/legacy/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/legacy/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java
index ea630d25f06..3efde626e5b 100644
--- a/legacy/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java
+++ b/legacy/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java
@@ -12,13 +12,11 @@
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.Toast;
-
 import androidx.annotation.DrawableRes;
 import androidx.annotation.NonNull;
 import androidx.appcompat.widget.PopupMenu;
 import androidx.appcompat.widget.TooltipCompat;
 import app.k9mail.core.ui.legacy.designsystem.atom.icon.Icons;
-import app.k9mail.legacy.account.LegacyAccount;
 import app.k9mail.legacy.di.DI;
 import com.fsck.k9.FontSizes;
 import com.fsck.k9.K9;
@@ -42,6 +40,7 @@
 import com.fsck.k9.ui.messageview.RecipientNamesView;
 import com.google.android.material.chip.Chip;
 import com.google.android.material.textview.MaterialTextView;
+import net.thunderbird.core.android.account.LegacyAccount;
 
 
 public class MessageHeader extends LinearLayout implements OnClickListener, OnLongClickListener {
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 094678355c8..8731d89e24b 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -157,7 +157,6 @@ include(
 )
 
 include(
-    ":legacy:account",
     ":legacy:common",
     ":legacy:core",
     ":legacy:crypto-openpgp",
@@ -227,3 +226,4 @@ include(":feature:notification")
 include(":core:ui:theme:manager")
 include(":core:contact")
 include(":core:ui:account")
+include(":core:android:account")


Test patch:
diff --git a/app-common/src/test/kotlin/net/thunderbird/app/common/account/CommonAccountDefaultsProviderTest.kt b/app-common/src/test/kotlin/net/thunderbird/app/common/account/CommonAccountDefaultsProviderTest.kt
index ed5c374c430..589addc5e0d 100644
--- a/app-common/src/test/kotlin/net/thunderbird/app/common/account/CommonAccountDefaultsProviderTest.kt
+++ b/app-common/src/test/kotlin/net/thunderbird/app/common/account/CommonAccountDefaultsProviderTest.kt
@@ -1,27 +1,6 @@
 package net.thunderbird.app.common.account
 
 import app.k9mail.core.featureflag.FeatureFlagResult
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MAXIMUM_AUTO_DOWNLOAD_MESSAGE_SIZE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT_AUTO
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_READ_RECEIPT
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTED_TEXT_SHOWN
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_PREFIX
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_STYLE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_REMOTE_SEARCH_NUM_RESULTS
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_REPLY_AFTER_QUOTE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_RINGTONE_URI
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_SORT_ASCENDING
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_SORT_TYPE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_STRIP_SIGNATURE
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.DEFAULT_SYNC_INTERVAL
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
-import app.k9mail.legacy.account.AccountDefaultsProvider.Companion.UNASSIGNED_ACCOUNT_NUMBER
-import app.k9mail.legacy.account.Expunge
-import app.k9mail.legacy.account.FolderMode
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
-import app.k9mail.legacy.account.ShowPictures
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import assertk.assertions.isFalse
@@ -29,6 +8,27 @@ import assertk.assertions.isNull
 import assertk.assertions.isTrue
 import com.fsck.k9.CoreResourceProvider
 import com.fsck.k9.K9
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MAXIMUM_AUTO_DOWNLOAD_MESSAGE_SIZE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_FORMAT_AUTO
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_MESSAGE_READ_RECEIPT
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTED_TEXT_SHOWN
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_PREFIX
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_QUOTE_STYLE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_REMOTE_SEARCH_NUM_RESULTS
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_REPLY_AFTER_QUOTE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_RINGTONE_URI
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_SORT_ASCENDING
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_SORT_TYPE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_STRIP_SIGNATURE
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.DEFAULT_SYNC_INTERVAL
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.NO_OPENPGP_KEY
+import net.thunderbird.core.android.account.AccountDefaultsProvider.Companion.UNASSIGNED_ACCOUNT_NUMBER
+import net.thunderbird.core.android.account.Expunge
+import net.thunderbird.core.android.account.FolderMode
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.ShowPictures
 import net.thunderbird.core.mail.folder.api.SpecialFolderSelection
 import net.thunderbird.core.preferences.Storage
 import net.thunderbird.feature.notification.NotificationLight
diff --git a/app-common/src/test/kotlin/net/thunderbird/app/common/account/data/FakeLegacyAccountWrapperManager.kt b/app-common/src/test/kotlin/net/thunderbird/app/common/account/data/FakeLegacyAccountWrapperManager.kt
index 0aea0502b43..f5c73b5b8b5 100644
--- a/app-common/src/test/kotlin/net/thunderbird/app/common/account/data/FakeLegacyAccountWrapperManager.kt
+++ b/app-common/src/test/kotlin/net/thunderbird/app/common/account/data/FakeLegacyAccountWrapperManager.kt
@@ -1,12 +1,12 @@
 package net.thunderbird.app.common.account.data
 
-import app.k9mail.legacy.account.LegacyAccountWrapper
-import app.k9mail.legacy.account.LegacyAccountWrapperManager
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.MutableStateFlow
 import kotlinx.coroutines.flow.StateFlow
 import kotlinx.coroutines.flow.map
 import kotlinx.coroutines.flow.update
+import net.thunderbird.core.android.account.LegacyAccountWrapper
+import net.thunderbird.core.android.account.LegacyAccountWrapperManager
 
 internal class FakeLegacyAccountWrapperManager(
     initialAccounts: List<LegacyAccountWrapper> = emptyList(),
diff --git a/app-common/src/test/kotlin/net/thunderbird/app/common/account/data/LegacyAccountProfileLocalDataSourceTest.kt b/app-common/src/test/kotlin/net/thunderbird/app/common/account/data/LegacyAccountProfileLocalDataSourceTest.kt
index 53acd663797..779016c189f 100644
--- a/app-common/src/test/kotlin/net/thunderbird/app/common/account/data/LegacyAccountProfileLocalDataSourceTest.kt
+++ b/app-common/src/test/kotlin/net/thunderbird/app/common/account/data/LegacyAccountProfileLocalDataSourceTest.kt
@@ -1,18 +1,18 @@
 package net.thunderbird.app.common.account.data
 
 import app.cash.turbine.test
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccountWrapper
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import com.fsck.k9.mail.AuthType
 import com.fsck.k9.mail.ConnectionSecurity
 import com.fsck.k9.mail.ServerSettings
 import kotlinx.coroutines.test.runTest
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccountWrapper
 import net.thunderbird.feature.account.api.AccountId
 import net.thunderbird.feature.account.api.profile.AccountProfile
 import org.junit.Test
-import app.k9mail.legacy.account.LegacyAccount as LegacyAccount
 
 class LegacyAccountProfileLocalDataSourceTest {
 
diff --git a/legacy/account/src/main/java/app/k9mail/legacy/account/QuoteStyle.kt b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/QuoteStyle.kt
similarity index 53%
rename from legacy/account/src/main/java/app/k9mail/legacy/account/QuoteStyle.kt
rename to core/android/account/src/main/kotlin/net/thunderbird/core/android/account/QuoteStyle.kt
index 36955f80d13..1afeecd09e9 100644
--- a/legacy/account/src/main/java/app/k9mail/legacy/account/QuoteStyle.kt
+++ b/core/android/account/src/main/kotlin/net/thunderbird/core/android/account/QuoteStyle.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 enum class QuoteStyle {
     PREFIX,
diff --git a/legacy/account/src/test/kotlin/app/k9mail/legacy/account/LegacyAccountWrapperTest.kt b/core/android/account/src/test/kotlin/net/thunderbird/core/android/account/LegacyAccountWrapperTest.kt
similarity index 99%
rename from legacy/account/src/test/kotlin/app/k9mail/legacy/account/LegacyAccountWrapperTest.kt
rename to core/android/account/src/test/kotlin/net/thunderbird/core/android/account/LegacyAccountWrapperTest.kt
index d5942ddd6e4..294898c4eaa 100644
--- a/legacy/account/src/test/kotlin/app/k9mail/legacy/account/LegacyAccountWrapperTest.kt
+++ b/core/android/account/src/test/kotlin/net/thunderbird/core/android/account/LegacyAccountWrapperTest.kt
@@ -1,4 +1,4 @@
-package app.k9mail.legacy.account
+package net.thunderbird.core.android.account
 
 import assertk.assertThat
 import assertk.assertions.isEqualTo
diff --git a/feature/migration/qrcode/src/test/kotlin/app/k9mail/feature/migration/qrcode/payload/FakeDeletePolicyProvider.kt b/feature/migration/qrcode/src/test/kotlin/app/k9mail/feature/migration/qrcode/payload/FakeDeletePolicyProvider.kt
index 82a00808281..cd443755a37 100644
--- a/feature/migration/qrcode/src/test/kotlin/app/k9mail/feature/migration/qrcode/payload/FakeDeletePolicyProvider.kt
+++ b/feature/migration/qrcode/src/test/kotlin/app/k9mail/feature/migration/qrcode/payload/FakeDeletePolicyProvider.kt
@@ -1,7 +1,7 @@
 package app.k9mail.feature.migration.qrcode.payload
 
-import app.k9mail.legacy.account.DeletePolicy
 import com.fsck.k9.account.DeletePolicyProvider
+import net.thunderbird.core.android.account.DeletePolicy
 
 class FakeDeletePolicyProvider : DeletePolicyProvider {
     override fun getDeletePolicy(accountType: String): DeletePolicy {
diff --git a/feature/migration/qrcode/src/test/kotlin/app/k9mail/feature/migration/qrcode/settings/XmlSettingWriterTest.kt b/feature/migration/qrcode/src/test/kotlin/app/k9mail/feature/migration/qrcode/settings/XmlSettingWriterTest.kt
index 0f42c94522f..1a262a94d63 100644
--- a/feature/migration/qrcode/src/test/kotlin/app/k9mail/feature/migration/qrcode/settings/XmlSettingWriterTest.kt
+++ b/feature/migration/qrcode/src/test/kotlin/app/k9mail/feature/migration/qrcode/settings/XmlSettingWriterTest.kt
@@ -5,10 +5,10 @@ import app.k9mail.core.common.net.toHostname
 import app.k9mail.core.common.net.toPort
 import app.k9mail.feature.migration.qrcode.domain.entity.AccountData
 import app.k9mail.feature.migration.qrcode.domain.entity.AccountData.ConnectionSecurity
-import app.k9mail.legacy.account.DeletePolicy
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import kotlin.test.Test
+import net.thunderbird.core.android.account.DeletePolicy
 import okio.Buffer
 import org.junit.runner.RunWith
 import org.robolectric.RobolectricTestRunner
diff --git a/feature/navigation/drawer/dropdown/src/debug/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/FakeData.kt b/feature/navigation/drawer/dropdown/src/debug/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/FakeData.kt
index 9ee8bc6cf96..accb7879878 100644
--- a/feature/navigation/drawer/dropdown/src/debug/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/FakeData.kt
+++ b/feature/navigation/drawer/dropdown/src/debug/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/FakeData.kt
@@ -4,11 +4,11 @@ import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.graphics.toArgb
 import app.k9mail.core.mail.folder.api.Folder
 import app.k9mail.core.mail.folder.api.FolderType
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import kotlinx.collections.immutable.PersistentList
 import kotlinx.collections.immutable.persistentListOf
 import kotlinx.collections.immutable.toPersistentList
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.navigation.drawer.dropdown.domain.entity.DisplayAccount
 import net.thunderbird.feature.navigation.drawer.dropdown.domain.entity.DisplayAccountFolder
 import net.thunderbird.feature.navigation.drawer.dropdown.domain.entity.DisplayFolder
diff --git a/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/data/FakeMessageCountsProvider.kt b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/data/FakeMessageCountsProvider.kt
index 0b98f3167f7..06da6165d5a 100644
--- a/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/data/FakeMessageCountsProvider.kt
+++ b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/data/FakeMessageCountsProvider.kt
@@ -1,10 +1,10 @@
 package net.thunderbird.feature.navigation.drawer.dropdown.data
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageCounts
 import app.k9mail.legacy.message.controller.MessageCountsProvider
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.flowOf
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.LocalSearch
 import net.thunderbird.feature.search.SearchAccount
 
diff --git a/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeAccountManager.kt b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeAccountManager.kt
index 8b2b2a4be16..48987138d6f 100644
--- a/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeAccountManager.kt
+++ b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeAccountManager.kt
@@ -1,10 +1,10 @@
 package net.thunderbird.feature.navigation.drawer.dropdown.domain.usecase
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.AccountRemovedListener
-import app.k9mail.legacy.account.AccountsChangeListener
-import app.k9mail.legacy.account.LegacyAccount
 import kotlinx.coroutines.flow.Flow
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.AccountRemovedListener
+import net.thunderbird.core.android.account.AccountsChangeListener
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class FakeAccountManager(
     val recordedParameters: MutableList<String> = mutableListOf(),
diff --git a/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeDisplayFolderRepository.kt b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeDisplayFolderRepository.kt
index 4dc1bdd6210..f60c51231f6 100644
--- a/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeDisplayFolderRepository.kt
+++ b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeDisplayFolderRepository.kt
@@ -1,9 +1,9 @@
 package net.thunderbird.feature.navigation.drawer.dropdown.domain.usecase
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.ui.folder.DisplayFolder
 import app.k9mail.legacy.ui.folder.DisplayFolderRepository
 import kotlinx.coroutines.flow.Flow
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class FakeDisplayFolderRepository(
     private val foldersFlow: Flow<List<DisplayFolder>>,
diff --git a/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeMessagingControllerMailChecker.kt b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeMessagingControllerMailChecker.kt
index a4b8b91112b..7c2e50676c6 100644
--- a/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeMessagingControllerMailChecker.kt
+++ b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/domain/usecase/FakeMessagingControllerMailChecker.kt
@@ -1,8 +1,8 @@
 package net.thunderbird.feature.navigation.drawer.dropdown.domain.usecase
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessagingControllerMailChecker
 import app.k9mail.legacy.message.controller.MessagingListener
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class FakeMessagingControllerMailChecker(
     val recordedParameters: MutableList<CheckMailParameters> = mutableListOf(),
diff --git a/feature/navigation/drawer/siderail/src/debug/kotlin/net/thunderbird/feature/navigation/drawer/siderail/ui/FakeData.kt b/feature/navigation/drawer/siderail/src/debug/kotlin/net/thunderbird/feature/navigation/drawer/siderail/ui/FakeData.kt
index 79df2d5800a..b74af7c783f 100644
--- a/feature/navigation/drawer/siderail/src/debug/kotlin/net/thunderbird/feature/navigation/drawer/siderail/ui/FakeData.kt
+++ b/feature/navigation/drawer/siderail/src/debug/kotlin/net/thunderbird/feature/navigation/drawer/siderail/ui/FakeData.kt
@@ -4,11 +4,11 @@ import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.graphics.toArgb
 import app.k9mail.core.mail.folder.api.Folder
 import app.k9mail.core.mail.folder.api.FolderType
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import kotlinx.collections.immutable.PersistentList
 import kotlinx.collections.immutable.persistentListOf
 import kotlinx.collections.immutable.toPersistentList
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.navigation.drawer.siderail.domain.entity.DisplayAccount
 import net.thunderbird.feature.navigation.drawer.siderail.domain.entity.DisplayAccountFolder
 import net.thunderbird.feature.navigation.drawer.siderail.domain.entity.DisplayFolder
diff --git a/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/data/FakeMessageCountsProvider.kt b/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/data/FakeMessageCountsProvider.kt
index 1379a831ff5..ba228045901 100644
--- a/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/data/FakeMessageCountsProvider.kt
+++ b/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/data/FakeMessageCountsProvider.kt
@@ -1,10 +1,10 @@
 package net.thunderbird.feature.navigation.drawer.siderail.data
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageCounts
 import app.k9mail.legacy.message.controller.MessageCountsProvider
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.flowOf
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.LocalSearch
 import net.thunderbird.feature.search.SearchAccount
 
diff --git a/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeAccountManager.kt b/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeAccountManager.kt
index 6ad3279880f..8b0626427de 100644
--- a/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeAccountManager.kt
+++ b/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeAccountManager.kt
@@ -1,10 +1,10 @@
 package net.thunderbird.feature.navigation.drawer.siderail.domain.usecase
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.AccountRemovedListener
-import app.k9mail.legacy.account.AccountsChangeListener
-import app.k9mail.legacy.account.LegacyAccount
 import kotlinx.coroutines.flow.Flow
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.AccountRemovedListener
+import net.thunderbird.core.android.account.AccountsChangeListener
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class FakeAccountManager(
     val recordedParameters: MutableList<String> = mutableListOf(),
diff --git a/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeDisplayFolderRepository.kt b/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeDisplayFolderRepository.kt
index 1873f211d75..d02d61842f7 100644
--- a/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeDisplayFolderRepository.kt
+++ b/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeDisplayFolderRepository.kt
@@ -1,9 +1,9 @@
 package net.thunderbird.feature.navigation.drawer.siderail.domain.usecase
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.ui.folder.DisplayFolder
 import app.k9mail.legacy.ui.folder.DisplayFolderRepository
 import kotlinx.coroutines.flow.Flow
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class FakeDisplayFolderRepository(
     private val foldersFlow: Flow<List<DisplayFolder>>,
diff --git a/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeMessagingControllerMailChecker.kt b/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeMessagingControllerMailChecker.kt
index 0c6afc46764..4dce1293573 100644
--- a/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeMessagingControllerMailChecker.kt
+++ b/feature/navigation/drawer/siderail/src/test/kotlin/net/thunderbird/feature/navigation/drawer/siderail/domain/usecase/FakeMessagingControllerMailChecker.kt
@@ -1,8 +1,8 @@
 package net.thunderbird.feature.navigation.drawer.siderail.domain.usecase
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessagingControllerMailChecker
 import app.k9mail.legacy.message.controller.MessagingListener
+import net.thunderbird.core.android.account.LegacyAccount
 
 internal class FakeMessagingControllerMailChecker(
     val recordedParameters: MutableList<CheckMailParameters> = mutableListOf(),
diff --git a/feature/widget/unread/src/test/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetDataProviderTest.kt b/feature/widget/unread/src/test/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetDataProviderTest.kt
index 59744debdd2..fb452e5804f 100644
--- a/feature/widget/unread/src/test/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetDataProviderTest.kt
+++ b/feature/widget/unread/src/test/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetDataProviderTest.kt
@@ -3,7 +3,6 @@ package app.k9mail.feature.widget.unread
 import android.content.Context
 import app.k9mail.core.mail.folder.api.Folder
 import app.k9mail.core.mail.folder.api.FolderType
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderRepository
 import app.k9mail.legacy.message.controller.MessageCounts
 import app.k9mail.legacy.message.controller.MessageCountsProvider
@@ -15,6 +14,7 @@ import com.fsck.k9.CoreResourceProvider
 import com.fsck.k9.Preferences
 import com.fsck.k9.ui.messagelist.DefaultFolderProvider
 import kotlinx.coroutines.flow.Flow
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.LocalSearch
 import net.thunderbird.feature.search.SearchAccount
 import org.junit.Before
diff --git a/legacy/common/src/main/java/com/fsck/k9/backends/AccountAuthStateStorage.kt b/legacy/common/src/main/java/com/fsck/k9/backends/AccountAuthStateStorage.kt
index 870341e5e8c..465fc817235 100644
--- a/legacy/common/src/main/java/com/fsck/k9/backends/AccountAuthStateStorage.kt
+++ b/legacy/common/src/main/java/com/fsck/k9/backends/AccountAuthStateStorage.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.backends
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.mail.oauth.AuthStateStorage
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 
 class AccountAuthStateStorage(
     private val accountManager: AccountManager,
diff --git a/legacy/common/src/test/java/com/fsck/k9/account/AccountServerSettingsUpdaterTest.kt b/legacy/common/src/test/java/com/fsck/k9/account/AccountServerSettingsUpdaterTest.kt
index 9e241bc7edc..91eff4d3e12 100644
--- a/legacy/common/src/test/java/com/fsck/k9/account/AccountServerSettingsUpdaterTest.kt
+++ b/legacy/common/src/test/java/com/fsck/k9/account/AccountServerSettingsUpdaterTest.kt
@@ -14,7 +14,7 @@ import com.fsck.k9.mail.ConnectionSecurity
 import com.fsck.k9.mail.ServerSettings
 import kotlinx.coroutines.test.runTest
 import org.junit.Test
-import app.k9mail.legacy.account.LegacyAccount as K9Account
+import net.thunderbird.core.android.account.LegacyAccount as K9Account
 
 class AccountServerSettingsUpdaterTest {
 
diff --git a/legacy/common/src/test/java/com/fsck/k9/account/AccountStateLoaderTest.kt b/legacy/common/src/test/java/com/fsck/k9/account/AccountStateLoaderTest.kt
index 2f8ab5a299f..6480e6442e8 100644
--- a/legacy/common/src/test/java/com/fsck/k9/account/AccountStateLoaderTest.kt
+++ b/legacy/common/src/test/java/com/fsck/k9/account/AccountStateLoaderTest.kt
@@ -2,8 +2,6 @@ package com.fsck.k9.account
 
 import app.k9mail.feature.account.common.domain.entity.AccountState
 import app.k9mail.feature.account.common.domain.entity.AuthorizationState
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import assertk.assertions.isNull
@@ -11,6 +9,8 @@ import com.fsck.k9.mail.AuthType
 import com.fsck.k9.mail.ConnectionSecurity
 import com.fsck.k9.mail.ServerSettings
 import kotlinx.coroutines.test.runTest
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.Test
 
 class AccountStateLoaderTest {
diff --git a/legacy/common/src/test/java/com/fsck/k9/account/DefaultDeletePolicyProviderTest.kt b/legacy/common/src/test/java/com/fsck/k9/account/DefaultDeletePolicyProviderTest.kt
index 73f2d07c8aa..6ecff8cf854 100644
--- a/legacy/common/src/test/java/com/fsck/k9/account/DefaultDeletePolicyProviderTest.kt
+++ b/legacy/common/src/test/java/com/fsck/k9/account/DefaultDeletePolicyProviderTest.kt
@@ -1,11 +1,11 @@
 package com.fsck.k9.account
 
 import app.k9mail.core.common.mail.Protocols
-import app.k9mail.legacy.account.DeletePolicy
 import assertk.assertFailure
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import assertk.assertions.isInstanceOf
+import net.thunderbird.core.android.account.DeletePolicy
 import org.junit.Test
 
 class DefaultDeletePolicyProviderTest {
diff --git a/legacy/common/src/test/java/com/fsck/k9/account/FakeAccountManager.kt b/legacy/common/src/test/java/com/fsck/k9/account/FakeAccountManager.kt
index 833c36f48dc..371771d12a6 100644
--- a/legacy/common/src/test/java/com/fsck/k9/account/FakeAccountManager.kt
+++ b/legacy/common/src/test/java/com/fsck/k9/account/FakeAccountManager.kt
@@ -1,10 +1,10 @@
 package com.fsck.k9.account
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.AccountRemovedListener
-import app.k9mail.legacy.account.AccountsChangeListener
-import app.k9mail.legacy.account.LegacyAccount
 import kotlinx.coroutines.flow.Flow
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.AccountRemovedListener
+import net.thunderbird.core.android.account.AccountsChangeListener
+import net.thunderbird.core.android.account.LegacyAccount
 
 class FakeAccountManager(
     private val accounts: MutableMap<String, LegacyAccount> = mutableMapOf(),
diff --git a/legacy/core/src/test/java/com/fsck/k9/PreferencesTest.kt b/legacy/core/src/test/java/com/fsck/k9/PreferencesTest.kt
index d6e3dfbe7c4..c13e5a61ac3 100644
--- a/legacy/core/src/test/java/com/fsck/k9/PreferencesTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/PreferencesTest.kt
@@ -1,6 +1,5 @@
 package com.fsck.k9
 
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import assertk.assertions.isSameInstanceAs
@@ -8,6 +7,7 @@ import com.fsck.k9.mail.AuthType
 import com.fsck.k9.mail.ConnectionSecurity
 import com.fsck.k9.mail.ServerSettings
 import kotlin.test.Test
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.preferences.InMemoryStoragePersister
 import org.junit.Before
 import org.mockito.kotlin.any
diff --git a/legacy/core/src/test/java/com/fsck/k9/TestApp.kt b/legacy/core/src/test/java/com/fsck/k9/TestApp.kt
index fe421997935..54684098c76 100644
--- a/legacy/core/src/test/java/com/fsck/k9/TestApp.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/TestApp.kt
@@ -6,7 +6,6 @@ import app.k9mail.core.featureflag.FeatureFlag
 import app.k9mail.core.featureflag.FeatureFlagProvider
 import app.k9mail.core.featureflag.InMemoryFeatureFlagProvider
 import app.k9mail.feature.telemetry.telemetryModule
-import app.k9mail.legacy.account.AccountDefaultsProvider
 import app.k9mail.legacy.di.DI
 import com.fsck.k9.backend.BackendManager
 import com.fsck.k9.controller.ControllerExtension
@@ -16,6 +15,7 @@ import com.fsck.k9.notification.NotificationResourceProvider
 import com.fsck.k9.notification.NotificationStrategy
 import com.fsck.k9.preferences.StoragePersister
 import com.fsck.k9.storage.storageModule
+import net.thunderbird.core.android.account.AccountDefaultsProvider
 import net.thunderbird.core.android.preferences.InMemoryStoragePersister
 import net.thunderbird.legacy.core.FakeAccountDefaultsProvider
 import org.koin.core.qualifier.named
diff --git a/legacy/core/src/test/java/com/fsck/k9/UnifiedInboxConfiguratorTest.kt b/legacy/core/src/test/java/com/fsck/k9/UnifiedInboxConfiguratorTest.kt
index 064bbd13e0f..fde688a4a6b 100644
--- a/legacy/core/src/test/java/com/fsck/k9/UnifiedInboxConfiguratorTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/UnifiedInboxConfiguratorTest.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9
 
-import app.k9mail.legacy.account.AccountManager
 import com.fsck.k9.preferences.RealGeneralSettingsManager
 import com.fsck.k9.preferences.UnifiedInboxConfigurator
+import net.thunderbird.core.android.account.AccountManager
 import org.junit.After
 import org.junit.Assert.assertTrue
 import org.junit.Before
diff --git a/legacy/core/src/test/java/com/fsck/k9/controller/DefaultMessageCountsProviderTest.kt b/legacy/core/src/test/java/com/fsck/k9/controller/DefaultMessageCountsProviderTest.kt
index ec5c8bbcd62..60026afcaee 100644
--- a/legacy/core/src/test/java/com/fsck/k9/controller/DefaultMessageCountsProviderTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/controller/DefaultMessageCountsProviderTest.kt
@@ -1,8 +1,6 @@
 package com.fsck.k9.controller
 
 import app.cash.turbine.test
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.ListenableMessageStore
 import app.k9mail.legacy.mailstore.MessageStoreManager
 import app.k9mail.legacy.message.controller.MessageCounts
@@ -12,6 +10,8 @@ import app.k9mail.legacy.message.controller.SimpleMessagingListener
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import kotlinx.coroutines.test.runTest
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.search.ConditionsTreeNode
 import net.thunderbird.feature.search.LocalSearch
 import org.junit.Test
diff --git a/legacy/core/src/test/java/com/fsck/k9/controller/LocalDeleteOperationDeciderTest.kt b/legacy/core/src/test/java/com/fsck/k9/controller/LocalDeleteOperationDeciderTest.kt
index 8cfe84e555f..d825dda6fbd 100644
--- a/legacy/core/src/test/java/com/fsck/k9/controller/LocalDeleteOperationDeciderTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/controller/LocalDeleteOperationDeciderTest.kt
@@ -1,11 +1,11 @@
 package com.fsck.k9.controller
 
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.isFalse
 import assertk.assertions.isTrue
 import java.util.UUID
 import kotlin.test.Test
+import net.thunderbird.core.android.account.LegacyAccount
 
 class LocalDeleteOperationDeciderTest {
     private val localDeleteOperationDecider = LocalDeleteOperationDecider()
diff --git a/legacy/core/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java b/legacy/core/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java
index 08018bde9f0..597f7efff3b 100644
--- a/legacy/core/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java
+++ b/legacy/core/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java
@@ -9,7 +9,7 @@
 import android.content.Context;
 import app.k9mail.core.featureflag.FeatureFlagProvider;
 import app.k9mail.core.featureflag.FeatureFlagResult.Disabled;
-import app.k9mail.legacy.account.LegacyAccount;
+import net.thunderbird.core.android.account.LegacyAccount;
 import app.k9mail.legacy.message.controller.SimpleMessagingListener;
 import com.fsck.k9.K9;
 import com.fsck.k9.K9RobolectricTest;
diff --git a/legacy/core/src/test/java/com/fsck/k9/crypto/OpenPgpApiHelperTest.kt b/legacy/core/src/test/java/com/fsck/k9/crypto/OpenPgpApiHelperTest.kt
index 7cee221d72d..e4446d174f6 100644
--- a/legacy/core/src/test/java/com/fsck/k9/crypto/OpenPgpApiHelperTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/crypto/OpenPgpApiHelperTest.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.crypto
 
-import app.k9mail.legacy.account.Identity
 import assertk.assertThat
 import assertk.assertions.isEqualTo
+import net.thunderbird.core.android.account.Identity
 import org.junit.Test
 
 class OpenPgpApiHelperTest {
diff --git a/legacy/core/src/test/java/com/fsck/k9/helper/IdentityHelperTest.kt b/legacy/core/src/test/java/com/fsck/k9/helper/IdentityHelperTest.kt
index 8148009ee02..9d8ac068728 100644
--- a/legacy/core/src/test/java/com/fsck/k9/helper/IdentityHelperTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/helper/IdentityHelperTest.kt
@@ -1,7 +1,5 @@
 package com.fsck.k9.helper
 
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import com.fsck.k9.mail.Address
@@ -10,6 +8,8 @@ import com.fsck.k9.mail.Message.RecipientType
 import com.fsck.k9.mail.internet.AddressHeaderBuilder
 import com.fsck.k9.mail.internet.MimeMessage
 import java.util.UUID
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
 
diff --git a/legacy/core/src/test/java/com/fsck/k9/helper/ReplyToParserTest.java b/legacy/core/src/test/java/com/fsck/k9/helper/ReplyToParserTest.java
index 5a30ef0fc5a..f2cff9752fd 100644
--- a/legacy/core/src/test/java/com/fsck/k9/helper/ReplyToParserTest.java
+++ b/legacy/core/src/test/java/com/fsck/k9/helper/ReplyToParserTest.java
@@ -4,7 +4,7 @@
 import java.util.ArrayList;
 
 import net.thunderbird.core.android.testing.RobolectricTest;
-import app.k9mail.legacy.account.LegacyAccount;
+import net.thunderbird.core.android.account.LegacyAccount;
 import com.fsck.k9.helper.ReplyToParser.ReplyToAddresses;
 import com.fsck.k9.mail.Address;
 import com.fsck.k9.mail.Message;
diff --git a/legacy/core/src/test/java/com/fsck/k9/mailstore/K9BackendDefaultStorageTest.kt b/legacy/core/src/test/java/com/fsck/k9/mailstore/K9BackendDefaultStorageTest.kt
index 88f3ca875d5..97a6d110603 100644
--- a/legacy/core/src/test/java/com/fsck/k9/mailstore/K9BackendDefaultStorageTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/mailstore/K9BackendDefaultStorageTest.kt
@@ -1,6 +1,5 @@
 package com.fsck.k9.mailstore
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.FolderSettings
 import app.k9mail.legacy.mailstore.MessageStoreManager
 import assertk.assertThat
@@ -8,6 +7,7 @@ import assertk.assertions.isEqualTo
 import com.fsck.k9.K9RobolectricTest
 import com.fsck.k9.Preferences
 import com.fsck.k9.backend.api.BackendStorage
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.After
 import org.junit.Test
 import org.koin.core.component.inject
diff --git a/legacy/core/src/test/java/com/fsck/k9/mailstore/K9BackendFolderTest.kt b/legacy/core/src/test/java/com/fsck/k9/mailstore/K9BackendFolderTest.kt
index 1986bd3e414..9937d9b0519 100644
--- a/legacy/core/src/test/java/com/fsck/k9/mailstore/K9BackendFolderTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/mailstore/K9BackendFolderTest.kt
@@ -2,7 +2,6 @@ package com.fsck.k9.mailstore
 
 import android.database.sqlite.SQLiteDatabase
 import androidx.core.content.contentValuesOf
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageStoreManager
 import assertk.assertFailure
 import assertk.assertThat
@@ -24,6 +23,7 @@ import com.fsck.k9.mail.MessageDownloadState
 import com.fsck.k9.mail.internet.MimeMessage
 import com.fsck.k9.mail.internet.MimeMessageHelper
 import com.fsck.k9.mail.internet.TextBody
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.After
 import org.junit.Test
 import org.koin.core.component.inject
diff --git a/legacy/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt b/legacy/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt
index 1d84072a0ff..59ce927a5ec 100644
--- a/legacy/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt
@@ -1,14 +1,14 @@
 package com.fsck.k9.message
 
 import android.net.Uri
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.QuoteStyle
 import assertk.Assert
 import assertk.assertThat
 import assertk.assertions.contains
 import assertk.assertions.isGreaterThan
 import com.fsck.k9.mail.internet.MimeHeaderChecker
 import com.fsck.k9.mail.internet.TextBody
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.QuoteStyle
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
 
diff --git a/legacy/core/src/test/java/com/fsck/k9/message/MessageBuilderTest.java b/legacy/core/src/test/java/com/fsck/k9/message/MessageBuilderTest.java
index fd886fb7107..73dc1bb83a4 100644
--- a/legacy/core/src/test/java/com/fsck/k9/message/MessageBuilderTest.java
+++ b/legacy/core/src/test/java/com/fsck/k9/message/MessageBuilderTest.java
@@ -13,9 +13,9 @@
 import java.util.Map;
 
 import net.thunderbird.core.android.testing.RobolectricTest;
-import app.k9mail.legacy.account.QuoteStyle;
+import net.thunderbird.core.android.account.QuoteStyle;
 import com.fsck.k9.CoreResourceProvider;
-import app.k9mail.legacy.account.Identity;
+import net.thunderbird.core.android.account.Identity;
 import com.fsck.k9.TestCoreResourceProvider;
 import com.fsck.k9.mail.Address;
 import com.fsck.k9.mail.BodyPart;
diff --git a/legacy/core/src/test/java/com/fsck/k9/message/ReplyActionStrategyTest.kt b/legacy/core/src/test/java/com/fsck/k9/message/ReplyActionStrategyTest.kt
index 4dbf804badf..1715fa79ae2 100644
--- a/legacy/core/src/test/java/com/fsck/k9/message/ReplyActionStrategyTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/message/ReplyActionStrategyTest.kt
@@ -1,7 +1,5 @@
 package com.fsck.k9.message
 
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.containsExactly
 import assertk.assertions.isEmpty
@@ -9,6 +7,8 @@ import assertk.assertions.isEqualTo
 import assertk.assertions.isNull
 import com.fsck.k9.helper.ReplyToParser
 import com.fsck.k9.mail.testing.message.buildMessage
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.Test
 
 private const val IDENTITY_EMAIL_ADDRESS = "myself@domain.example"
diff --git a/legacy/core/src/test/java/com/fsck/k9/message/quote/TextQuoteCreatorTest.kt b/legacy/core/src/test/java/com/fsck/k9/message/quote/TextQuoteCreatorTest.kt
index e31cb78c667..292c2dbafc4 100644
--- a/legacy/core/src/test/java/com/fsck/k9/message/quote/TextQuoteCreatorTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/message/quote/TextQuoteCreatorTest.kt
@@ -1,6 +1,5 @@
 package com.fsck.k9.message.quote
 
-import app.k9mail.legacy.account.QuoteStyle
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import com.fsck.k9.TestCoreResourceProvider
@@ -9,6 +8,7 @@ import com.fsck.k9.mail.Message
 import com.fsck.k9.mail.Message.RecipientType
 import com.fsck.k9.mail.testing.crlf
 import java.util.Date
+import net.thunderbird.core.android.account.QuoteStyle
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
 import org.mockito.kotlin.doReturn
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationControllerTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationControllerTest.kt
index e1927a74ffe..d43bef9cce8 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationControllerTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationControllerTest.kt
@@ -5,7 +5,7 @@ import android.app.PendingIntent
 import androidx.core.app.NotificationCompat
 import androidx.core.app.NotificationManagerCompat
 import androidx.test.core.app.ApplicationProvider
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.testing.MockHelper.mockBuilder
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/BaseNotificationDataCreatorTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/BaseNotificationDataCreatorTest.kt
index 7296c19bb2d..1a51f4e6caf 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/BaseNotificationDataCreatorTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/BaseNotificationDataCreatorTest.kt
@@ -1,7 +1,5 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import assertk.assertions.isInstanceOf
@@ -9,6 +7,8 @@ import assertk.assertions.isNotNull
 import assertk.assertions.isSameInstanceAs
 import com.fsck.k9.K9
 import com.fsck.k9.K9.LockScreenNotificationVisibility
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.feature.notification.NotificationLight
 import net.thunderbird.feature.notification.NotificationVibration
 import net.thunderbird.feature.notification.VibratePattern
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationControllerTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationControllerTest.kt
index bc0d984ab27..643f67d208f 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationControllerTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationControllerTest.kt
@@ -5,7 +5,7 @@ import android.app.PendingIntent
 import androidx.core.app.NotificationCompat
 import androidx.core.app.NotificationManagerCompat
 import androidx.test.core.app.ApplicationProvider
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.testing.MockHelper.mockBuilder
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationCreatorTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationCreatorTest.kt
index d5032f9c1f2..4bfce473822 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationCreatorTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationCreatorTest.kt
@@ -2,7 +2,7 @@ package com.fsck.k9.notification
 
 import androidx.core.app.NotificationCompat
 import androidx.test.core.app.ApplicationProvider
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.testing.MockHelper.mockBuilder
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/NewMailNotificationManagerTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/NewMailNotificationManagerTest.kt
index 22c119a0eb6..ec3c72bcf96 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/NewMailNotificationManagerTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/NewMailNotificationManagerTest.kt
@@ -1,7 +1,6 @@
 package com.fsck.k9.notification
 
 import app.k9mail.core.testing.TestClock
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.mailstore.MessageStoreManager
 import app.k9mail.legacy.message.controller.MessageReference
 import assertk.assertThat
@@ -21,6 +20,7 @@ import com.fsck.k9.mailstore.LocalStoreProvider
 import com.fsck.k9.mailstore.NotificationMessage
 import kotlin.test.assertNotNull
 import kotlinx.datetime.Instant
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.Test
 import org.mockito.kotlin.doAnswer
 import org.mockito.kotlin.doReturn
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt
index ee8411991db..71777caa26f 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt
@@ -1,7 +1,6 @@
 package com.fsck.k9.notification
 
 import app.k9mail.core.android.common.contact.ContactRepository
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import app.k9mail.legacy.message.extractors.PreviewResult.PreviewType
 import assertk.assertThat
@@ -9,6 +8,7 @@ import assertk.assertions.isEqualTo
 import com.fsck.k9.mail.Address
 import com.fsck.k9.mail.Message.RecipientType
 import com.fsck.k9.mailstore.LocalMessage
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
 import org.mockito.kotlin.any
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt
index 9fb5fc8099c..84b296d7819 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt
@@ -1,6 +1,5 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import assertk.assertThat
 import assertk.assertions.containsExactly
@@ -14,6 +13,7 @@ import assertk.assertions.isNull
 import assertk.assertions.isSameInstanceAs
 import assertk.assertions.isTrue
 import kotlin.test.assertNotNull
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
 
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/NotificationIdsTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/NotificationIdsTest.kt
index e929695aba9..ff531baed29 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/NotificationIdsTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/NotificationIdsTest.kt
@@ -1,12 +1,12 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.containsExactly
 import assertk.assertions.containsNoDuplicates
 import assertk.assertions.doesNotContain
 import assertk.assertions.isEmpty
 import assertk.assertions.isEqualTo
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.Test
 
 class NotificationIdsTest {
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationControllerTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationControllerTest.kt
index eb7efea595a..0593d2ca0b3 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationControllerTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationControllerTest.kt
@@ -5,7 +5,7 @@ import android.app.PendingIntent
 import androidx.core.app.NotificationCompat
 import androidx.core.app.NotificationManagerCompat
 import androidx.test.core.app.ApplicationProvider
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.testing.MockHelper.mockBuilder
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/SingleMessageNotificationDataCreatorTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/SingleMessageNotificationDataCreatorTest.kt
index 3d764b9dd1f..4b4ae5d2297 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/SingleMessageNotificationDataCreatorTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/SingleMessageNotificationDataCreatorTest.kt
@@ -1,6 +1,5 @@
 package com.fsck.k9.notification
 
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import assertk.assertThat
 import assertk.assertions.contains
@@ -10,6 +9,7 @@ import assertk.assertions.isFalse
 import assertk.assertions.isTrue
 import com.fsck.k9.K9
 import com.fsck.k9.K9.NotificationQuickDelete
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.Test
 
 class SingleMessageNotificationDataCreatorTest {
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/SummaryNotificationDataCreatorTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/SummaryNotificationDataCreatorTest.kt
index e42d62e2733..068103a390c 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/SummaryNotificationDataCreatorTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/SummaryNotificationDataCreatorTest.kt
@@ -1,7 +1,6 @@
 package com.fsck.k9.notification
 
 import app.k9mail.core.testing.TestClock
-import app.k9mail.legacy.account.LegacyAccount
 import app.k9mail.legacy.message.controller.MessageReference
 import assertk.assertThat
 import assertk.assertions.contains
@@ -12,6 +11,7 @@ import assertk.assertions.isInstanceOf
 import assertk.assertions.isTrue
 import com.fsck.k9.K9
 import kotlinx.datetime.Clock
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.After
 import org.junit.Before
 import org.junit.Test
diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt
index f6b7115886c..73997c020ef 100644
--- a/legacy/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt
@@ -5,9 +5,9 @@ import android.app.PendingIntent
 import androidx.core.app.NotificationCompat
 import androidx.core.app.NotificationManagerCompat
 import androidx.test.core.app.ApplicationProvider
-import app.k9mail.legacy.account.LegacyAccount
 import com.fsck.k9.mailstore.LocalFolder
 import com.fsck.k9.notification.NotificationIds.getFetchingMailNotificationId
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.testing.MockHelper.mockBuilder
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
diff --git a/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo100Test.kt b/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo100Test.kt
index bb4682238d6..a96fdeba81b 100644
--- a/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo100Test.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo100Test.kt
@@ -1,12 +1,12 @@
 package com.fsck.k9.preferences.upgrader
 
-import app.k9mail.legacy.account.FolderMode
 import assertk.assertThat
 import assertk.assertions.containsExactlyInAnyOrder
 import com.fsck.k9.preferences.InternalSettingsMap
 import com.fsck.k9.preferences.ValidatedSettings
 import com.fsck.k9.preferences.legacy.FolderClass
 import kotlin.test.Test
+import net.thunderbird.core.android.account.FolderMode
 
 class CombinedSettingsUpgraderTo100Test {
     private val upgrader = CombinedSettingsUpgraderTo100()
diff --git a/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo96Test.kt b/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo96Test.kt
index b14f38d1117..ddfadbb90e1 100644
--- a/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo96Test.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo96Test.kt
@@ -1,12 +1,12 @@
 package com.fsck.k9.preferences.upgrader
 
-import app.k9mail.legacy.account.FolderMode
 import assertk.assertThat
 import assertk.assertions.containsExactlyInAnyOrder
 import com.fsck.k9.preferences.InternalSettingsMap
 import com.fsck.k9.preferences.ValidatedSettings
 import com.fsck.k9.preferences.legacy.FolderClass
 import kotlin.test.Test
+import net.thunderbird.core.android.account.FolderMode
 
 class CombinedSettingsUpgraderTo96Test {
     private val upgrader = CombinedSettingsUpgraderTo96()
diff --git a/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo98Test.kt b/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo98Test.kt
index 56942b7bb4b..00c64ebe4b8 100644
--- a/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo98Test.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo98Test.kt
@@ -1,12 +1,12 @@
 package com.fsck.k9.preferences.upgrader
 
-import app.k9mail.legacy.account.FolderMode
 import assertk.assertThat
 import assertk.assertions.containsExactlyInAnyOrder
 import com.fsck.k9.preferences.InternalSettingsMap
 import com.fsck.k9.preferences.ValidatedSettings
 import com.fsck.k9.preferences.legacy.FolderClass
 import kotlin.test.Test
+import net.thunderbird.core.android.account.FolderMode
 
 class CombinedSettingsUpgraderTo98Test {
     private val upgrader = CombinedSettingsUpgraderTo98()
diff --git a/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo99Test.kt b/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo99Test.kt
index 7c8d910b0e0..f2b9d8f7c9e 100644
--- a/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo99Test.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/preferences/upgrader/CombinedSettingsUpgraderTo99Test.kt
@@ -1,12 +1,12 @@
 package com.fsck.k9.preferences.upgrader
 
-import app.k9mail.legacy.account.FolderMode
 import assertk.assertThat
 import assertk.assertions.containsExactlyInAnyOrder
 import com.fsck.k9.preferences.InternalSettingsMap
 import com.fsck.k9.preferences.ValidatedSettings
 import com.fsck.k9.preferences.legacy.FolderClass
 import kotlin.test.Test
+import net.thunderbird.core.android.account.FolderMode
 
 class CombinedSettingsUpgraderTo99Test {
     private val upgrader = CombinedSettingsUpgraderTo99()
diff --git a/legacy/core/src/test/java/net/thunderbird/legacy/core/FakeAccountDefaultsProvider.kt b/legacy/core/src/test/java/net/thunderbird/legacy/core/FakeAccountDefaultsProvider.kt
index 63f7048051d..c62173156ca 100644
--- a/legacy/core/src/test/java/net/thunderbird/legacy/core/FakeAccountDefaultsProvider.kt
+++ b/legacy/core/src/test/java/net/thunderbird/legacy/core/FakeAccountDefaultsProvider.kt
@@ -1,8 +1,8 @@
 package net.thunderbird.legacy.core
 
-import app.k9mail.legacy.account.AccountDefaultsProvider
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
+import net.thunderbird.core.android.account.AccountDefaultsProvider
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.preferences.Storage
 
 class FakeAccountDefaultsProvider : AccountDefaultsProvider {
diff --git a/legacy/mailstore/src/test/java/app/k9mail/legacy/mailstore/MessageStoreManagerTest.kt b/legacy/mailstore/src/test/java/app/k9mail/legacy/mailstore/MessageStoreManagerTest.kt
index dbd14cbbe75..2a596ad8b25 100644
--- a/legacy/mailstore/src/test/java/app/k9mail/legacy/mailstore/MessageStoreManagerTest.kt
+++ b/legacy/mailstore/src/test/java/app/k9mail/legacy/mailstore/MessageStoreManagerTest.kt
@@ -1,10 +1,10 @@
 package app.k9mail.legacy.mailstore
 
-import app.k9mail.legacy.account.AccountManager
-import app.k9mail.legacy.account.AccountRemovedListener
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.isSameInstanceAs
+import net.thunderbird.core.android.account.AccountManager
+import net.thunderbird.core.android.account.AccountRemovedListener
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.Test
 import org.mockito.kotlin.KStubbing
 import org.mockito.kotlin.argumentCaptor
diff --git a/legacy/storage/src/test/java/com/fsck/k9/storage/StoreSchemaDefinitionTest.kt b/legacy/storage/src/test/java/com/fsck/k9/storage/StoreSchemaDefinitionTest.kt
index e610991d0cb..e7754e747dd 100644
--- a/legacy/storage/src/test/java/com/fsck/k9/storage/StoreSchemaDefinitionTest.kt
+++ b/legacy/storage/src/test/java/com/fsck/k9/storage/StoreSchemaDefinitionTest.kt
@@ -3,8 +3,6 @@ package com.fsck.k9.storage
 import android.database.sqlite.SQLiteDatabase
 import androidx.core.content.contentValuesOf
 import app.k9mail.core.android.common.database.map
-import app.k9mail.legacy.account.FolderMode
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.Assert
 import assertk.assertFailure
 import assertk.assertThat
@@ -20,6 +18,8 @@ import com.fsck.k9.mail.AuthType
 import com.fsck.k9.mail.ConnectionSecurity
 import com.fsck.k9.mail.ServerSettings
 import com.fsck.k9.mailstore.MigrationsHelper
+import net.thunderbird.core.android.account.FolderMode
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.Before
 import org.junit.Test
 import org.mockito.kotlin.doReturn
diff --git a/legacy/storage/src/test/java/com/fsck/k9/storage/TestApp.kt b/legacy/storage/src/test/java/com/fsck/k9/storage/TestApp.kt
index d00663fb189..d806fc3aace 100644
--- a/legacy/storage/src/test/java/com/fsck/k9/storage/TestApp.kt
+++ b/legacy/storage/src/test/java/com/fsck/k9/storage/TestApp.kt
@@ -5,7 +5,6 @@ import app.k9mail.core.featureflag.FeatureFlag
 import app.k9mail.core.featureflag.FeatureFlagProvider
 import app.k9mail.core.featureflag.InMemoryFeatureFlagProvider
 import app.k9mail.feature.telemetry.telemetryModule
-import app.k9mail.legacy.account.AccountDefaultsProvider
 import app.k9mail.legacy.di.DI
 import com.fsck.k9.AppConfig
 import com.fsck.k9.Core
@@ -16,6 +15,7 @@ import com.fsck.k9.crypto.EncryptionExtractor
 import com.fsck.k9.legacyCoreModules
 import com.fsck.k9.preferences.K9StoragePersister
 import com.fsck.k9.preferences.StoragePersister
+import net.thunderbird.core.android.account.AccountDefaultsProvider
 import org.koin.dsl.module
 import org.mockito.kotlin.mock
 
diff --git a/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo85Test.kt b/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo85Test.kt
index ebd4bd9ce3e..495624b7a5e 100644
--- a/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo85Test.kt
+++ b/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo85Test.kt
@@ -2,14 +2,14 @@ package com.fsck.k9.storage.migrations
 
 import android.content.ContentValues
 import android.database.sqlite.SQLiteDatabase
-import app.k9mail.legacy.account.FolderMode
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.containsExactlyInAnyOrder
 import com.fsck.k9.mailstore.MigrationsHelper
 import com.fsck.k9.storage.messages.FolderEntry
 import com.fsck.k9.storage.messages.readFolders
 import kotlin.test.Test
+import net.thunderbird.core.android.account.FolderMode
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.After
 import org.junit.runner.RunWith
 import org.mockito.kotlin.doAnswer
diff --git a/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo86Test.kt b/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo86Test.kt
index 0cec7444b4e..2d1a9d6f4c0 100644
--- a/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo86Test.kt
+++ b/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo86Test.kt
@@ -2,14 +2,14 @@ package com.fsck.k9.storage.migrations
 
 import android.content.ContentValues
 import android.database.sqlite.SQLiteDatabase
-import app.k9mail.legacy.account.FolderMode
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.containsExactlyInAnyOrder
 import com.fsck.k9.mailstore.MigrationsHelper
 import com.fsck.k9.storage.messages.FolderEntry
 import com.fsck.k9.storage.messages.readFolders
 import kotlin.test.Test
+import net.thunderbird.core.android.account.FolderMode
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.After
 import org.junit.runner.RunWith
 import org.mockito.kotlin.doAnswer
diff --git a/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo87Test.kt b/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo87Test.kt
index d4f7692357f..d36ba3ba385 100644
--- a/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo87Test.kt
+++ b/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo87Test.kt
@@ -2,14 +2,14 @@ package com.fsck.k9.storage.migrations
 
 import android.content.ContentValues
 import android.database.sqlite.SQLiteDatabase
-import app.k9mail.legacy.account.FolderMode
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.containsExactlyInAnyOrder
 import com.fsck.k9.mailstore.MigrationsHelper
 import com.fsck.k9.storage.messages.FolderEntry
 import com.fsck.k9.storage.messages.readFolders
 import kotlin.test.Test
+import net.thunderbird.core.android.account.FolderMode
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.After
 import org.junit.runner.RunWith
 import org.mockito.kotlin.doAnswer
diff --git a/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo88Test.kt b/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo88Test.kt
index 7f122ec5259..dd4a3842dde 100644
--- a/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo88Test.kt
+++ b/legacy/storage/src/test/java/com/fsck/k9/storage/migrations/MigrationTo88Test.kt
@@ -2,14 +2,14 @@ package com.fsck.k9.storage.migrations
 
 import android.content.ContentValues
 import android.database.sqlite.SQLiteDatabase
-import app.k9mail.legacy.account.FolderMode
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.containsExactlyInAnyOrder
 import com.fsck.k9.mailstore.MigrationsHelper
 import com.fsck.k9.storage.messages.FolderEntry
 import com.fsck.k9.storage.messages.readFolders
 import kotlin.test.Test
+import net.thunderbird.core.android.account.FolderMode
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.After
 import org.junit.runner.RunWith
 import org.mockito.kotlin.doAnswer
diff --git a/legacy/ui/legacy/src/test/java/com/fsck/k9/TestApp.kt b/legacy/ui/legacy/src/test/java/com/fsck/k9/TestApp.kt
index 3f3d755c191..7e77f003da2 100644
--- a/legacy/ui/legacy/src/test/java/com/fsck/k9/TestApp.kt
+++ b/legacy/ui/legacy/src/test/java/com/fsck/k9/TestApp.kt
@@ -5,10 +5,10 @@ import app.k9mail.core.featureflag.FeatureFlag
 import app.k9mail.core.featureflag.FeatureFlagProvider
 import app.k9mail.core.featureflag.InMemoryFeatureFlagProvider
 import app.k9mail.feature.telemetry.telemetryModule
-import app.k9mail.legacy.account.AccountDefaultsProvider
 import app.k9mail.legacy.di.DI
 import com.fsck.k9.contacts.ContactPictureLoader
 import com.fsck.k9.preferences.StoragePersister
+import net.thunderbird.core.android.account.AccountDefaultsProvider
 import net.thunderbird.core.android.preferences.InMemoryStoragePersister
 import org.koin.dsl.module
 import org.mockito.Mockito.mock
diff --git a/legacy/ui/legacy/src/test/java/com/fsck/k9/activity/compose/RecipientPresenterTest.kt b/legacy/ui/legacy/src/test/java/com/fsck/k9/activity/compose/RecipientPresenterTest.kt
index e7418f87364..960313aa3e6 100644
--- a/legacy/ui/legacy/src/test/java/com/fsck/k9/activity/compose/RecipientPresenterTest.kt
+++ b/legacy/ui/legacy/src/test/java/com/fsck/k9/activity/compose/RecipientPresenterTest.kt
@@ -1,7 +1,6 @@
 package com.fsck.k9.activity.compose
 
 import androidx.test.core.app.ApplicationProvider
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import assertk.assertions.isFalse
@@ -24,6 +23,7 @@ import com.fsck.k9.message.ComposePgpEnableByDefaultDecider
 import com.fsck.k9.message.ComposePgpInlineDecider
 import com.fsck.k9.view.RecipientSelectView.Recipient
 import kotlin.test.assertNotNull
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.Before
 import org.junit.Ignore
 import org.junit.Test
diff --git a/legacy/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt b/legacy/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt
index 488f8175bbd..557860609eb 100644
--- a/legacy/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt
+++ b/legacy/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt
@@ -1,12 +1,12 @@
 package com.fsck.k9.activity.compose
 
 import android.os.Bundle
-import app.k9mail.legacy.account.Identity
 import assertk.assertThat
 import assertk.assertions.isFalse
 import assertk.assertions.isSameInstanceAs
 import assertk.assertions.isTrue
 import com.fsck.k9.mail.Address
+import net.thunderbird.core.android.account.Identity
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
 import org.mockito.kotlin.doReturn
diff --git a/legacy/ui/legacy/src/test/java/com/fsck/k9/message/PgpMessageBuilderTest.kt b/legacy/ui/legacy/src/test/java/com/fsck/k9/message/PgpMessageBuilderTest.kt
index 49907120e01..0624c544962 100644
--- a/legacy/ui/legacy/src/test/java/com/fsck/k9/message/PgpMessageBuilderTest.kt
+++ b/legacy/ui/legacy/src/test/java/com/fsck/k9/message/PgpMessageBuilderTest.kt
@@ -4,8 +4,6 @@ import android.app.Activity
 import android.app.PendingIntent
 import android.content.Intent
 import android.os.Parcelable
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.QuoteStyle
 import assertk.Assert
 import assertk.all
 import assertk.assertThat
@@ -48,6 +46,8 @@ import com.fsck.k9.message.quote.InsertableHtmlContent
 import com.fsck.k9.view.RecipientSelectView
 import java.io.OutputStream
 import java.util.Date
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.QuoteStyle
 import org.apache.james.mime4j.util.MimeUtil
 import org.junit.Before
 import org.junit.Test
diff --git a/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/identity/IdentityFormatterTest.kt b/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/identity/IdentityFormatterTest.kt
index da668fb1aba..dd64a36b277 100644
--- a/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/identity/IdentityFormatterTest.kt
+++ b/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/identity/IdentityFormatterTest.kt
@@ -1,8 +1,8 @@
 package com.fsck.k9.ui.identity
 
-import app.k9mail.legacy.account.Identity
 import assertk.assertThat
 import assertk.assertions.isEqualTo
+import net.thunderbird.core.android.account.Identity
 import org.junit.Test
 
 private const val IDENTITY_NAME = "Identity Name"
@@ -14,7 +14,11 @@ class IdentityFormatterTest {
 
     @Test
     fun `getDisplayName() with identity name`() {
-        val identity = Identity(description = IDENTITY_NAME, name = "irrelevant", email = EMAIL)
+        val identity = Identity(
+            description = IDENTITY_NAME,
+            name = "irrelevant",
+            email = EMAIL,
+        )
 
         val displayName = identityFormatter.getDisplayName(identity)
 
@@ -23,7 +27,8 @@ class IdentityFormatterTest {
 
     @Test
     fun `getDisplayName() without identity name, but sender name`() {
-        val identity = Identity(description = null, name = SENDER_NAME, email = EMAIL)
+        val identity =
+            Identity(description = null, name = SENDER_NAME, email = EMAIL)
 
         val displayName = identityFormatter.getDisplayName(identity)
 
@@ -59,7 +64,8 @@ class IdentityFormatterTest {
 
     @Test
     fun `getEmailDisplayName() should ignore identity name`() {
-        val identity = Identity(description = IDENTITY_NAME, name = null, email = EMAIL)
+        val identity =
+            Identity(description = IDENTITY_NAME, name = null, email = EMAIL)
 
         val displayName = identityFormatter.getEmailDisplayName(identity)
 
diff --git a/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatterTest.kt b/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatterTest.kt
index 94c24c34dd6..d9252c8c4c0 100644
--- a/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatterTest.kt
+++ b/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatterTest.kt
@@ -4,8 +4,6 @@ import android.graphics.Color
 import android.text.Spannable
 import android.text.style.ForegroundColorSpan
 import androidx.core.text.getSpans
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.containsExactly
 import assertk.assertions.isEqualTo
@@ -14,6 +12,8 @@ import assertk.assertions.isNotNull
 import assertk.assertions.isNull
 import com.fsck.k9.helper.ContactNameProvider
 import com.fsck.k9.mail.Address
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
 
@@ -49,7 +49,10 @@ class MessageDetailsParticipantFormatterTest : RobolectricTest() {
     fun `identity address with multiple identities`() {
         val account = LegacyAccount("uuid").apply {
             identities += Identity(name = IDENTITY_NAME, email = IDENTITY_ADDRESS)
-            identities += Identity(name = "Another identity", email = "irrelevant@domain.example")
+            identities += Identity(
+                name = "Another identity",
+                email = "irrelevant@domain.example",
+            )
         }
 
         val displayName = participantFormatter.getDisplayName(Address(IDENTITY_ADDRESS, "irrelevant"), account)
@@ -72,7 +75,10 @@ class MessageDetailsParticipantFormatterTest : RobolectricTest() {
     fun `identity and address without a display name`() {
         val account = LegacyAccount("uuid").apply {
             identities += Identity(name = null, email = IDENTITY_ADDRESS)
-            identities += Identity(name = "Another identity", email = "irrelevant@domain.example")
+            identities += Identity(
+                name = "Another identity",
+                email = "irrelevant@domain.example",
+            )
         }
 
         val displayName = participantFormatter.getDisplayName(Address(IDENTITY_ADDRESS), account)
diff --git a/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messagelist/MessageListAdapterTest.kt b/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messagelist/MessageListAdapterTest.kt
index 0fa895aa6eb..49a9363d965 100644
--- a/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messagelist/MessageListAdapterTest.kt
+++ b/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messagelist/MessageListAdapterTest.kt
@@ -11,7 +11,6 @@ import androidx.appcompat.app.AppCompatActivity
 import androidx.core.view.isGone
 import androidx.core.view.isVisible
 import app.k9mail.core.testing.TestClock
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.Assert
 import assertk.assertThat
 import assertk.assertions.isEqualTo
@@ -26,6 +25,7 @@ import com.fsck.k9.mail.Address
 import com.fsck.k9.ui.R
 import com.fsck.k9.ui.helper.RelativeDateTimeFormatter
 import com.google.android.material.textview.MaterialTextView
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
 import org.mockito.kotlin.mock
@@ -425,7 +425,9 @@ class MessageListAdapterTest : RobolectricTest() {
     }
 
     fun createMessageListItem(
-        account: LegacyAccount = LegacyAccount(SOME_ACCOUNT_UUID),
+        account: LegacyAccount = LegacyAccount(
+            SOME_ACCOUNT_UUID,
+        ),
         subject: String? = "irrelevant",
         threadCount: Int = 0,
         messageDate: Long = 0L,
diff --git a/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/DisplayRecipientsExtractorTest.kt b/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/DisplayRecipientsExtractorTest.kt
index 22d05e6bbee..0443e228149 100644
--- a/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/DisplayRecipientsExtractorTest.kt
+++ b/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/DisplayRecipientsExtractorTest.kt
@@ -1,11 +1,11 @@
 package com.fsck.k9.ui.messageview
 
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import com.fsck.k9.mail.Address
 import com.fsck.k9.mail.testing.message.buildMessage
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 import org.junit.Test
 
 private const val IDENTITY_ADDRESS = "me@domain.example"
diff --git a/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatterTest.kt b/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatterTest.kt
index ddb63fbcae5..9b99878139f 100644
--- a/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatterTest.kt
+++ b/legacy/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatterTest.kt
@@ -4,14 +4,14 @@ import android.graphics.Color
 import android.text.Spannable
 import android.text.style.ForegroundColorSpan
 import androidx.core.text.getSpans
-import app.k9mail.legacy.account.Identity
-import app.k9mail.legacy.account.LegacyAccount
 import assertk.assertThat
 import assertk.assertions.containsExactly
 import assertk.assertions.isEqualTo
 import assertk.assertions.isInstanceOf
 import com.fsck.k9.helper.ContactNameProvider
 import com.fsck.k9.mail.Address
+import net.thunderbird.core.android.account.Identity
+import net.thunderbird.core.android.account.LegacyAccount
 import net.thunderbird.core.android.testing.RobolectricTest
 import org.junit.Test
 
@@ -45,7 +45,10 @@ class MessageViewRecipientFormatterTest : RobolectricTest() {
     @Test
     fun `multiple identities`() {
         val account = LegacyAccount("uuid").apply {
-            identities += Identity(description = "My identity", email = IDENTITY_ADDRESS)
+            identities += Identity(
+                description = "My identity",
+                email = IDENTITY_ADDRESS,
+            )
             identities += Identity(email = "another.one@domain.example")
         }
         val recipientFormatter = createRecipientFormatter()