This commit is contained in:
Bendt
2025-12-18 22:11:47 -05:00
parent 0ed7800575
commit a41d59e529
26 changed files with 4187 additions and 373 deletions

View File

@@ -20,6 +20,7 @@ from src.services.microsoft_graph.calendar import (
)
from src.services.microsoft_graph.mail import (
fetch_mail_async,
fetch_archive_mail_async,
archive_mail_async,
delete_mail_async,
synchronize_maildir_async,
@@ -216,7 +217,9 @@ def create_maildir_structure(base_path):
ensure_directory_exists(os.path.join(base_path, "cur"))
ensure_directory_exists(os.path.join(base_path, "new"))
ensure_directory_exists(os.path.join(base_path, "tmp"))
ensure_directory_exists(os.path.join(base_path, ".Archives"))
ensure_directory_exists(os.path.join(base_path, ".Archive", "cur"))
ensure_directory_exists(os.path.join(base_path, ".Archive", "new"))
ensure_directory_exists(os.path.join(base_path, ".Archive", "tmp"))
ensure_directory_exists(os.path.join(base_path, ".Trash", "cur"))
# Create outbox structure for sending emails
ensure_directory_exists(os.path.join(base_path, "outbox", "new"))
@@ -436,6 +439,7 @@ async def _sync_outlook_data(
with progress:
task_fetch = progress.add_task("[green]Syncing Inbox...", total=0)
task_fetch_archive = progress.add_task("[green]Syncing Archive...", total=0)
task_calendar = progress.add_task("[cyan]Fetching calendar...", total=0)
task_local_calendar = progress.add_task(
"[magenta]Syncing local calendar...", total=0
@@ -515,6 +519,15 @@ async def _sync_outlook_data(
dry_run,
download_attachments,
),
fetch_archive_mail_async(
maildir_path,
attachments_dir,
headers,
progress,
task_fetch_archive,
dry_run,
download_attachments,
),
fetch_calendar_async(
headers,
progress,