Add IMAP settings to configuration and enhance email processing logic

This commit is contained in:
2025-03-01 15:27:17 +01:00
parent d326705b1d
commit 7698656c6e
4 changed files with 114 additions and 30 deletions

View File

@@ -42,6 +42,16 @@ go build -o paraclub-ai-mailer ./cmd/paraclub-ai-mailer
The application uses a YAML configuration file (`config.yaml`) with the following structure:
### IMAP Settings
- `server`: IMAP server hostname (e.g., "imap.gmail.com")
- `port`: IMAP port (typically 993 for TLS)
- `username`: Your email address
- `password`: Email password (use ${IMAP_PASSWORD} to load from environment)
- `mailbox_in`: Mailbox to check for new emails (e.g., "INBOX")
- `draft_box`: Folder to save AI-generated drafts (e.g., "Drafts")
- `processed_box`: Folder to move processed emails to (they will also be marked as read)
- `use_tls`: Whether to use TLS for connection (recommended: true)
```yaml
imap:
server: "imap.example.com"
@@ -111,7 +121,7 @@ Or specify a custom config file path:
- Retrieves HTML content from configured URLs
- Sends combined content to OpenRouter AI for response generation
- Saves the AI-generated response as a draft email
- Marks the original email as processed
- Marks the original email as read and moves it to the configured processed folder
## Logging