Get started with Mail Agent by following these steps:
git clone https://github.com/frappe/mail_agent
cd mail_agent
virtualenv venv
source venv/bin/activate
pip install .
Follow these steps to set up Mail Agent for development:
-
Before setting up Mail Agent, ensure you have the following:
- Yarn: A package manager that simplifies working with JavaScript projects.
npm install --global yarn
- Yarn: A package manager that simplifies working with JavaScript projects.
-
This command will install Node packages, set up Haraka, and generate a Procfile to manage processes.
mail-agent setup
-
mail-agent start
For production deployment on Ubuntu, follow these steps:
-
Ensure you have the necessary tools and libraries installed:
sudo apt install curl build-essential -y
-
Set up Node.js and Yarn, which are required for running
Haraka
:curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install -y nodejs sudo npm install -g yarn
-
If you want to obtain TLS certificate for your Mail Agent from Let's Encrypt, follow these steps:
- Install Certbot:
sudo apt install certbot -y
- Generate a TLS certificate for your host:
sudo certbot certonly --standalone -d $(hostname -f)
- Install Certbot:
-
This command will install Node packages, set up Haraka, generate a Procfile and create systemd services:
mail-agent setup --prod # Use --inbound to setup agent for inbound
-
Ensure that all services are running correctly:
sudo systemctl status haraka # Outbound sudo systemctl status mail-agent