# Ubuntu / Debian sudo apt update sudo apt install -y php-imap # Verify: php -m | grep -i imap # Then restart PHP-FPM and your web server: sudo systemctl restart php8.3-fpm nginx # Or if using Apache: sudo systemctl restart apache2
# From the webmail directory cp config/.env.example config/.env chmod 600 config/.env # Edit config/.env and set: # MAIL_IMAP_HOST=192.168.0.221 # MAIL_IMAP_PORT=993 # MAIL_IMAP_SSL=true # MAIL_IMAP_VALIDATE_CERT=false (internal LAN IP, no public cert) # MAIL_SMTP_HOST=192.168.0.221 # MAIL_SMTP_PORT=465 # MAIL_SMTP_SECURE=ssl # MAIL_SMTP_VALIDATE_CERT=false # DB_HOST=localhost # DB_NAME=webmail # DB_USER=root # DB_PASS=...
CREATE DATABASE webmail CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; # Optional dedicated user: CREATE USER 'webmail'@'localhost' IDENTIFIED BY 'StrongPassword123!'; GRANT ALL PRIVILEGES ON webmail.* TO 'webmail'@'localhost'; FLUSH PRIVILEGES;
From this web server, the internal IP is 192.168.0.221. Ensure this host can reach:
Mailcow default Docker exposes these on the host LAN. If ufw/Docker ACLs restrict 192.168.0.0/24, add explicit allows from this web server's IP.
Use your full Mailcow email address (e.g. you@yourapps.co.za) and the same mailbox password you use in Mailcow/SOGo. Passwords are encrypted at rest with libsodium and tied to the PHP session.