Files
zemailnator/routes/console.php
idevakk c312ec3325 feat: Prepare Zemailnator for Dokploy deployment
- Add highly optimized Dockerfile with Nginx and PHP-FPM 8.4
- Add docker-compose.yml configured with Redis and MariaDB 10.11
- Implement entrypoint.sh and supervisord.conf for background workers
- Refactor legacy IMAP scripts into scheduled Artisan Commands
- Secure app by removing old routes with hardcoded basic auth credentials
- Configure email attachments to use Laravel Storage instead of insecure public/tmp
2026-02-28 23:17:39 +05:30

36 lines
964 B
PHP

<?php
use App\Models\Email;
use App\Models\Log;
use App\Models\Ticket;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schedule;
Artisan::command('inspire', function (): void {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
// Schedule the new commands instead of closures
Schedule::command('emails:fetch')->everyMinute();
Schedule::command('attachments:clean')->daily();
Schedule::command('mailbox:clean')->everyTwoHours();
// Keep other necessary schedules
Schedule::call(function (): void {
Email::deleteMessagesFromDB();
})->everyTwoHours();
Schedule::call(function (): void {
Log::deleteLogsFromDB();
})->everyThreeHours();
// Preserve existing commands
Artisan::command('cleanMail', function (): void {
$this->comment(Email::cleanMailbox());
});
Artisan::command('closeTicket', function (): void {
$this->comment(Ticket::autoClose());
});