<?php
declare(strict_types=1);

// SLPS mail configuration. Environment variables take priority; local XAMPP
// users may enter their Gmail address and App Password in the fallback values.
if (isset($_SERVER['SCRIPT_FILENAME']) && realpath((string)$_SERVER['SCRIPT_FILENAME']) === __FILE__) {
    http_response_code(404);
    exit;
}

return [
    'host' => getenv('SMTP_HOST') ?: 'smtp.gmail.com',
    'port' => (int)(getenv('SMTP_PORT') ?: '587'),
    'encryption' => strtolower(getenv('SMTP_ENCRYPTION') ?: 'tls'),
    'username' => getenv('SMTP_USERNAME') ?: 'obrainysikalola@gmail.com',
    'password' => getenv('SMTP_PASSWORD') ?: 'dria pivs ewiq svep',
    'from' => getenv('AUTH_MAIL_FROM') ?: 'obrainysikalola@gmail.com',
    'from_name' => getenv('SMTP_FROM_NAME') ?: 'Rockview University SLPS',
];
