{% extends "documentation/base.html" %} {% block doc_content %}

Auto-Import Configuration

Configure automatic email import from your Microsoft Graph mailbox to run on a schedule.

Overview

BackupChecks can automatically import backup report emails from your mailbox at regular intervals. This eliminates the need to manually trigger imports and ensures new backup reports are processed promptly.

Auto-import features:

Automatic Import

Automatic import runs continuously in the background and fetches new emails based on a configured interval.

Enabling Auto-Import

To enable automatic import:

  1. Navigate to SettingsImports tab
  2. Locate the Automatic mail import section
  3. Check the Enable automatic import checkbox
  4. Set the Import interval in minutes (default: 15 minutes)
  5. Click Save settings at the bottom of the page
💡 First Run:
After enabling auto-import, the first import runs immediately. Subsequent imports run at the configured interval.

Import Interval

The import interval determines how often BackupChecks checks for new emails:

Interval Use Case Recommendation
5 minutes High-frequency backups, real-time monitoring May increase server load, use only if necessary
15 minutes Standard setup (default) Recommended for most organizations
30 minutes Low-priority backups, small teams Good balance between timeliness and load
60 minutes Batch processing, overnight backups only Suitable for organizations with scheduled backup windows
💡 Performance Consideration:
Shorter intervals provide faster email processing but increase server load and Microsoft Graph API usage. 15 minutes is recommended as a good balance for most organizations.

Batch Size

Auto-import fetches a fixed number of emails per run to prevent overwhelming the system:

How Auto-Import Works

Here's what happens during each automatic import cycle:

  1. Timer triggers: The configured interval elapses (e.g., 15 minutes)
  2. Check settings: Verify that auto-import is still enabled
  3. Authenticate: Obtain access token from Microsoft Graph
  4. Fetch emails: Retrieve up to 10 new emails from the incoming folder
  5. Parse emails: Run parsers to extract backup information
  6. Auto-approve: If the email matches an existing approved job, automatically approve it
  7. Move emails: Move processed emails to the processed folder (if configured)
  8. Log results: Record import statistics in the audit log
  9. Persist objects: Store backup objects for auto-approved runs
  10. Wait: Sleep until the next interval

Auto-Approval

During automatic import, BackupChecks can automatically approve emails that match previously approved jobs. This eliminates the need to manually approve recurring backup reports.

How Auto-Approval Works

An email is automatically approved if:

  1. The email is successfully parsed (backup software, type, and job name extracted)
  2. A matching job already exists in the database (based on sender, job name, backup software)
  3. The job was previously approved by a user
  4. The match is unique across all customers (no ambiguity)

When auto-approved:

💡 First Approval is Manual:
The first email for a new backup job must always be manually approved from the inbox. After that, future emails for the same job are automatically approved.

When Auto-Approval Fails

If auto-approval fails, the email remains in the inbox and requires manual approval:

Manual Import

You can manually trigger an import at any time without waiting for the automatic import interval.

Triggering Manual Import

  1. Navigate to SettingsImports tab
  2. Scroll to the Manual mail import section
  3. Optionally adjust the Number of items (default: 50)
  4. Click the Import now button
  5. BackupChecks will immediately fetch emails from the mailbox
  6. You'll see a success message showing how many emails were imported

Manual Import Batch Size

Manual import allows you to configure how many emails to fetch:

The default batch size can be changed in SettingsImportsManual import batch size.

💡 When to Use Manual Import:
Manual import is useful when:

Import Settings Summary

Here's a complete reference of all mail import settings:

Setting Location Default Description
Enable automatic import Settings → Imports Disabled Turn automatic email import on or off
Import interval Settings → Imports 15 minutes How often to check for new emails (automatic import only)
Manual import batch size Settings → Imports 50 messages Default number of emails to fetch during manual import
EML retention period Settings → Imports 7 days How long to store raw .eml files (0, 7, or 14 days)

Monitoring Import Activity

You can monitor import activity through several interfaces:

Audit Log

Every import operation is logged in the audit log:

  1. Navigate to SettingsMaintenanceAdmin events
  2. Look for events like:
  3. Event messages show statistics: fetched=10, new=3, auto_approved=7, errors=0

Inbox Page

The inbox shows all imported emails:

Jobs and Daily Jobs

Auto-approved emails appear as new runs in:

Troubleshooting

Auto-Import Not Running

If auto-import is enabled but emails are not being imported:

  1. Verify that Enable automatic import is checked in Settings → Imports
  2. Check the audit log for mail_import_auto_error events
  3. Verify Microsoft Graph credentials are still valid (client secret may have expired)
  4. Ensure the BackupChecks application server is running (the background thread starts on app startup)
  5. Check system logs for thread errors or crashes

Emails Not Auto-Approved

If emails are imported but not auto-approved:

  1. Check the Inbox - emails may be parsed but not matched to existing jobs
  2. Verify the first email for this job was manually approved (auto-approval only works for subsequent emails)
  3. Ensure the job name, backup software, and sender match exactly between emails
  4. Check for duplicate jobs across different customers (auto-approval requires a unique match)

Import Errors

If imports fail with errors:

Best Practices

Advanced Configuration

Disabling Auto-Import Temporarily

To temporarily stop automatic imports without losing configuration:

  1. Navigate to SettingsImports
  2. Uncheck Enable automatic import
  3. Click Save settings
  4. The background thread will stop fetching emails but settings are preserved
  5. Re-enable later by checking the box again

EML Storage Retention

Control how long raw .eml files are stored in the database:

Older .eml files are automatically purged based on this retention period.

High-Volume Environments

For organizations with hundreds of backup jobs:

Next Steps

{% endblock %}