Mailpilot
Configuration

Email Accounts Configuration

Configure one or more email accounts for Mailpilot to process.

Basic Configuration

accounts:
  - name: personal
    imap:
      host: imap.gmail.com
      port: 993
      username: ${GMAIL_USER}
      password: ${GMAIL_APP_PASSWORD}
      tls: true

    folders:
      - name: INBOX
        llm_provider: openai
        prompt: |
          Classify this email...

    polling_interval: 60s

Account Options

OptionTypeRequiredDefaultDescription
namestringYes-Unique account identifier
imapobjectYes-IMAP connection settings
foldersarrayNo-Folders to watch and process
polling_intervaldurationNo60sHow often to check for new mail
webhooksarrayNo-Account-specific webhooks

IMAP Settings

imap:
  host: imap.gmail.com
  port: 993
  tls: true
  username: you@gmail.com
  password: ${PASSWORD}
OptionTypeRequiredDefaultDescription
hoststringYes-IMAP server hostname
portintegerNo993IMAP server port
tlsbooleanNotrueEnable TLS encryption
usernamestringYes-Login username
passwordstringYes-Password or app password

TLS Configuration

Recommended (port 993):

imap:
  host: imap.gmail.com
  port: 993
  tls: true

STARTTLS (port 143):

imap:
  host: imap.example.com
  port: 143
  tls: true
  starttls: true

Polling Interval

How often to check for new emails when IMAP IDLE is not supported:

accounts:
  - name: personal
    polling_interval: 60s  # Check every 60 seconds

Recommendations:

Use CaseInterval
High-priority inbox30s - 60s
Normal inbox2m - 5m
Low-priority inbox10m - 30m
Archive folder1h - 24h

Webhooks

Send HTTP notifications for account events:

accounts:
  - name: personal
    webhooks:
      - url: https://example.com/webhook
        events: [action_taken, error]
        headers:
          Authorization: Bearer ${WEBHOOK_TOKEN}

Webhook Events

EventDescription
action_takenEmail action executed
errorProcessing error occurred
connection_lostIMAP connection lost
connection_restoredIMAP connection restored

Multiple Accounts

Process multiple email accounts:

accounts:
  - name: personal-gmail
    imap:
      host: imap.gmail.com
      port: 993
      username: ${GMAIL_PERSONAL_USER}
      password: ${GMAIL_PERSONAL_PASSWORD}
    polling_interval: 60s

  - name: work-outlook
    imap:
      host: outlook.office365.com
      port: 993
      username: ${OUTLOOK_WORK_USER}
      password: ${OUTLOOK_WORK_PASSWORD}
    polling_interval: 30s

Next Steps