Mailpilot
Configuration

Attachment Processing

Configure Apache Tika integration to extract and analyze email attachments.

Prerequisites

Apache Tika Server must be running:

# Download Tika Server
wget https://dlcdn.apache.org/tika/3.0.0/tika-server-standard-3.0.0.jar

# Start Tika Server
java -jar tika-server-standard-3.0.0.jar

Tika runs on http://localhost:9998 by default.

Basic Configuration

attachments:
  enabled: true
  tika_url: http://localhost:9998
  max_size_mb: 10

Options

OptionTypeDefaultDescription
enabledbooleanfalseEnable attachment processing
tika_urlstring-Apache Tika server URL
timeoutduration30sExtraction timeout
max_size_mbnumber10Maximum attachment size in MB
max_extracted_charsinteger10000Max characters to extract
allowed_typesarraysee belowMIME types to process
extract_imagesbooleanfalseInclude images for vision models

Allowed File Types

Default allowed types:

  • application/pdf
  • application/msword
  • application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • text/plain
  • text/csv
  • Images: image/png, image/jpeg, image/gif

Custom Allowed Types

attachments:
  enabled: true
  tika_url: http://localhost:9998
  allowed_types:
    - application/pdf
    - text/plain
    - text/csv

Vision Models

Extract images for vision-enabled models:

attachments:
  enabled: true
  tika_url: http://localhost:9998
  extract_images: true  # Enable for GPT-4 Vision, Claude 3

llm_providers:
  - name: openai-vision
    provider: openai
    model: gpt-4o  # Supports vision
    supports_vision: true

Troubleshooting

Tika Not Running

Error: Failed to connect to Tika server

Solution:

# Check if Tika is running
curl http://localhost:9998/tika

# Should return "Apache Tika"

Large Attachments

Attachments exceeding max_size_mb are skipped.

Solution: Increase limit:

attachments:
  max_size_mb: 25  # Increase to 25MB

Docker Setup

Run Tika in Docker:

docker run -d -p 9998:9998 apache/tika:latest

Then configure:

attachments:
  enabled: true
  tika_url: http://localhost:9998

Next Steps