feat(smtp): implement built-in SMTP server for mail ingestion

- Add lightweight SMTP server support using `lettre` and `tokio`.
- Implement `DATA_SMTP_INGEST` permission check for inbound mail.
- Support real-time email archiving via SMTP protocol.
- Integrate with existing EML index manager for automated indexing.
This commit is contained in:
rustmailer
2026-03-10 01:25:02 +08:00
parent 16f0fad91e
commit 4b0d571cf2
38 changed files with 1609 additions and 32 deletions
+11
View File
@@ -421,6 +421,17 @@ impl AccountV4 {
list_all_impl(DB_MANAGER.meta_db()).await
}
pub async fn find_by_email(email: &str) -> BichonResult<Option<AccountModel>> {
let all: Vec<AccountModel> = list_all_impl(DB_MANAGER.meta_db()).await?;
let target_email = email.trim().to_lowercase();
let first_match = all
.into_iter()
.find(|acc| acc.email.to_lowercase() == target_email);
Ok(first_match)
}
pub async fn minimal_list(only_nosync: bool) -> BichonResult<Vec<MinimalAccount>> {
let result = list_all_impl(DB_MANAGER.meta_db())
.await?