<?php
/**
 * Run every 1-2 minutes from cPanel > Cron Jobs (NFR-03):
 *   php /home/USER/app/cron/email_ingest.php >> /home/USER/app/storage/logs/email_ingest.log 2>&1
 * No-ops safely if config.php has imap.enabled = false or php-imap isn't installed.
 */
require __DIR__ . '/../app/cron_bootstrap.php';

use App\Services\EmailIngestService;

$summary = EmailIngestService::poll();

echo date('Y-m-d H:i:s') . ' email_ingest: ' . json_encode($summary) . PHP_EOL;
