#1624: How to Configure an SMTP Email Channel in Swarmica
Отредактирована: сегодняBy default, only the IMAP channel for email is available in Swarmica.
This documentation contains instructions for setting up an SMTP channel for email.
Instructions
Before setting up the SMTP channel, make sure that the MX record is set up for the Swarmica hostname in DNS.
- Connect to the Swarmica server via SSH as the root user.
- Go to the
/root/swarmicafolder:
cd ~/swarmica
- Create a backup of the
docker-compose.ymland.envfiles:
mkdir backup; cp -a .env docker-compose.yml ./backup
- Add the following postfix section for the corresponding service in docker-compose.yml:
postfix:
<<: *django
restart: always
depends_on:
- postgres
- redis
volumes:
- swarmica_logs:/swarmica/swarmica/logs:z
- swarmica_ugc:/swarmica/swarmica/attachments/:z
env_file:
- .env
ports:
- "25:25"
command: /start-postfix
labels:
- "traefik.enable=false"
- Add SMTP settings to the
.envfile:
EMAIL_SERVER_HOSTNAME=<SWARMICA_HOSTNAME>
SMTP_SERVER=<SMTP_RELAY>
SMTP_PORT=<SMTP_RELAY_PORT>
SMTP_USERNAME=<SMTP_RELAY_USER>
SMTP_PASSWORD=<SMTP_RELAY_USER_PASSWORD>
SMTP_NETWORKS=<ALLOWED_NETWORKS_CIDR>
SMTP_USE_TLS=<YES|NO>
You can use the same SMTP settings here as for the already configured SMTP Relay in Swarmica - Settings - SMTP Relay.
- Add the feature flag
__smtp_email_channelto the.envfile using this instruction. - Restart Swarmica:
docker compose down; docker compose up -d
- Log in to the Swarmica UI as Administrator.
- Add the SMTP channel in Settings - Channels - Email - Create - Redirect (SMTP):

- In the window that appears, specify the channel name, recipient email, and sender email (for example, support@example.tld) and click Save:

- On the SMTP channel settings page that opens, specify the Sender's name (for example, swarmica support), enable the channel, fill in the Outgoing server settings, or enable the system SMTP server (SMTP Relay) and click Save.
