#!/bin/bash
set -e

# Create and fix permissions for /var/mail
mkdir -p /var/mail
chown -R 1000:1000 /var/mail
chmod -R 755 /var/mail

echo "✅ Fixed /var/mail permissions (owner: 1000:1000, mode: 755)"

# Start dovecot
exec "$@"
