This repository contains the backend source code for FreeCustom.Email, a powerful and privacy-focused temporary email service. The backend, codenamed Maildrop, is a multi-service application built with Node.js, TypeScript, and Docker. It's responsible for handling everything from receiving and storing emails to managing user accounts and subscriptions.
This project is the backend component of the FreeCustom.Email service. The frontend is also open-source and can be found at DishIs/temp-mail.
- Custom SMTP Server: A highly customized Haraka SMTP server for high-performance email processing.
- Microservices Architecture: A collection of services for different tasks, including a REST API, background workers, and more.
- Real-time Updates: WebSocket integration for real-time updates to the frontend.
- Secure and Scalable: Designed with security and scalability in mind, using technologies like MongoDB, Redis, and Docker.
- Docker
- Docker Compose
- Your own domain names for the API and SMTP server.
-
Clone the repository:
git clone https://github.com/DishIs/fce-backend.git cd fce-backend -
Update
docker-compose.yml: Before you can start the application, you need to replace all instances ofapi2.freecustom.emailandmx.freecustom.emailwith your own domain names. -
Create a
.envfile:cp .env.example .env
-
Fill in the environment variables in the
.envfile. -
Initial SSL Certificate Setup (Important): The
certbot-renewservice will not start without an initial SSL certificate. You need to run thecertbotservice once to generate the initial certificate.docker-compose up -d certbot
Once the
certbotservice has finished running, you can stop it. Thecertbot-renewservice will then be able to start and will handle renewing the certificate automatically. -
Start the application:
docker-compose up -d
This repository contains two different SMTP server configurations: smtp and smtp-fast.
smtp: This is an older, slower configuration that performs more email checks and has better spam detection. It is not actively maintained.smtp-fast: This is the configuration that FreeCustom.Email actually uses. It is a high-performance configuration that is designed for speed. It is actively maintained.
The docker-compose.yml file is configured to use the smtp-fast service by default.
The smtp-fast service uses Haraka, a highly extensible and customizable SMTP server written in Node.js. Our Haraka setup is heavily customized with a series of plugins to create a high-performance email processing pipeline.
The configuration for the Haraka server is located in the smtp-fast/src/config directory. Here are some of the most important files:
plugins: This file defines the order in which the Haraka plugins are executed.smtp.ini: This file contains the main configuration for the SMTP server.redis.ini: This file configures the connection to the Redis server.queue.redis.ini: This file configures the custom Redis queue plugin.
We use several custom plugins to add functionality to the Haraka server. These plugins are located in the smtp-fast/src/plugins directory.
rcpt_to_mongo.js: Checks if the recipient is a valid user by looking them up in the MongoDB database.data.blocklist.js: Blocks emails from muted senders.queue.redis.js: Queues emails in Redis for later processing by the API service.stats.redis.js: Records statistics to Redis.
This backend also hosts our public API v1, which can be accessed at https://www.freecustom.email/api. No manual setup is required to use this public API. You can also explore and test the API endpoints live at the /api/playground (e.g., https://www.freecustom.email/api/playground).
We welcome contributions from the community! Please read our Contributing Guide to learn how you can get involved.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
DishIs Technologies - @DishIs
Project Link: https://github.com/DishIs/fce-backend