Files
plane/email
Manish Gupta ee6e7596bb [INFRA-77] feat: add email service and SMTP configuration to docker-compose (#3098)
* feat: add email service and SMTP configuration to docker-compose

- Introduced a new email service in docker-compose with environment variables for SMTP configuration.
- Updated Caddyfile to route SMTP traffic for email service.
- Added necessary SMTP ports and health checks for the email service.
- Updated variables.env to include email-related configurations and replicas.

* refactor: clean up Caddyfile SMTP routing configuration

- Simplified the indentation and formatting of the SMTP routing sections in the Caddyfile.
- Ensured consistent structure for the proxy routes for email services on specified ports.

* fix: update SMTP domain binding in Caddyfile

- Changed the SMTP domain binding in the Caddyfile to use '0.0.0.0' for specified ports (10025, 10465, 10587) to allow connections from all network interfaces.
- This adjustment enhances the accessibility of the email service routing configuration.

* fix: update mail server testing instructions in README

- Changed placeholder from `<mail-domain>` to `<host-domain>` for clarity in SMTP connection testing instructions.
- This update improves the accuracy of the documentation for users testing their mail server setup.

* feat: enhance email service configuration in docker-compose and Caddyfile

- Added SMTP environment variables to coolify-compose.yml for better email service configuration.
- Updated docker-compose-caddy.yml to remove redundant SMTP_DOMAIN variable.
- Modified Caddyfile to simplify SMTP domain binding for email service routes.
- Ensured proper permissions for TLS directory in email Dockerfile.

* refactor: remove email service environment variables in coolify-compose.yml

---------

Co-authored-by: akshat5302 <akshatjain9782@gmail.com>
2025-05-21 13:29:28 +05:30
..
2025-02-14 17:47:09 +05:30
2025-02-14 17:47:09 +05:30
2025-02-14 17:47:09 +05:30
2025-02-14 17:47:09 +05:30
2025-02-14 17:47:09 +05:30
2025-02-14 17:47:09 +05:30

Required DNS Records for Receiving Mail Server

1. A Record

HOST-DOMAIN points to the server running the email service (e.g plane.example.com).
This can also be replaced with CNAME record of cloud load balancer.

Type: A
Host: <host-domain>
Value: <public-ip-address>
TTL: Auto | 3600

2. MX Record

MAIL-DOMAIN refers to incoming email domain e.g. intake.example.com

Type: MX
Host: <mail-domain>
Value: <host-domain>
Priority: 10
TTL: Auto | 3600

3. SPF Record

Type: TXT
Host: <mail-domain>
Value: "v=spf1 ip4:<A-record-ip-host-domain> -all"
TTL: Auto | 3600

4. DMARC Record

Type: TXT
Host: _dmarc.<mail-domain>
Value: "v=DMARC1; p=reject; rua=mailto:<valid-email-addr>"
TTL: Auto | 3600

Verification Commands

# Verify A record
dig A <mail-domain>

# Verify MX record
dig MX <mail-domain>

# Verify SPF record
dig TXT <mail-domain>

# Verify DMARC record
dig TXT _dmarc.<mail-domain>

You can also visit https://mxtoolbox.com/ to know the issues with your DNS records configuration.

Common Issues and Solutions

  1. MX Record Issues:

    • Ensure proper dot at end of domain
    • Check priority number (lower = higher priority)
    • Allow 24-48 hours for propagation
  2. A Record Issues:

    • Verify IP address is correct
    • Ensure mail subdomain matches MX record

Testing Mail Server Setup:

# Test SMTP connection
telnet <host-domain> 25
telnet <host-domain> 465
telnet <host-domain> 587