#!/bin/bash # Test script to demonstrate aerc integration with the sendmail wrapper # This shows how aerc would interact with our email sending system echo "=== Testing Email Sending Daemon ===" echo # Get the full path to our sendmail wrapper SENDMAIL_PATH="$(pwd)/sendmail" echo "Sendmail wrapper: $SENDMAIL_PATH" echo # Show current queue status echo "Current outbox queue:" find ~/Mail/*/outbox/new -type f 2>/dev/null | wc -l | xargs echo "Pending emails:" echo # Create a test email that aerc might send echo "Creating test email as aerc would..." cat << 'EOF' | $SENDMAIL_PATH From: user@corteva.com To: colleague@example.com Cc: team@example.com Subject: Project Update from aerc Hi team, This email was composed in aerc using helix editor and queued for sending through our Microsoft Graph adapter. The email will be sent when the sync daemon processes the outbox. Best regards, User EOF echo "Email queued successfully!" echo # Show updated queue status echo "Updated outbox queue:" find ~/Mail/*/outbox/new -type f 2>/dev/null | wc -l | xargs echo "Pending emails:" echo echo "To process the queue, run:" echo " python3 -m src.cli sync --daemon --notify" echo echo "Or for a one-time sync:" echo " python3 -m src.cli sync --dry-run" echo echo "=== aerc Configuration ===" echo "Add this to your aerc config:" echo echo "[outgoing]" echo "sendmail = $SENDMAIL_PATH" echo echo "Then compose emails in aerc as usual - they'll be queued offline" echo "and sent when you run the sync daemon."