Submail uses a hybrid architecture to provide both a modern web dashboard and a highly performant, custom-built SMTP server.
The system consists of two main logical components:
apps/web): A Next.js 14 application providing the user interface.apps/bot): A Node.js application that handles incoming emails and Discord notifications.user@example.com).user@example.com โ Reaches port 25 on the SMTP server.apps/bot receives the SMTP connection, validates the recipient alias against the DB.The database is managed by Prisma and shared between both apps. Key models include:
User: Stores Discord ID and profile info.Alias: Stores created email aliases and their status (Active/Paused).Log: Audit trail of processed emails.In a Dockerized environment, both services run as separate containers but share the same network and database volume (if using SQLite).
web container: Exposes port 3000.bot container: Exposes port 25.