PowerMTA (PMTA) is an advanced mail transfer agent (MTA) designed for high-volume email delivery. If you are using DigitalOcean and need to send bulk emails efficiently, integrating PowerMTA with your DigitalOcean SMTP setup is crucial.
Prerequisites
Before configuring PowerMTA on DigitalOcean, ensure:
- You have an active DigitalOcean droplet with Port 25 enabled.
- A domain with SPF, DKIM, and DMARC records.
- PowerMTA installed on your server.
Step-by-Step Guide to Connecting PowerMTA with DigitalOcean SMTP
1. Install PowerMTA on Your DigitalOcean Droplet
wget https://download.port25.com/PowerMTA-Install.tar.gz
tar -xvf PowerMTA-Install.tar.gz
cd PowerMTA-Install
sudo ./install.sh
Follow the on-screen instructions to complete the installation.
2. Configure PowerMTA with DigitalOcean SMTP
Edit the PowerMTA configuration file:
sudo nano /etc/pmta/config
Add the following settings:
<source 0.0.0.0/0>
allow-mail-relay yes
</source>
<domain *>
max-smtp-out 50
smtp-source-host yourserver.com
dkim-sign yes
</domain>
<queue>
max-messages-per-connection 100
</queue>
Save and exit the file.
3. Setup SPF, DKIM, and DMARC Records
To improve email deliverability, add these DNS records:
- SPF Record:
v=spf1 ip4:YOUR_SERVER_IP include:_spf.yourdomain.com ~all - DKIM Record: (Generate DKIM keys using PowerMTA) :
pmta gen-dkim-key -d yourdomain.com
(Add the public key to your DNS records) - DMARC Record:
v=DMARC1; p=none; rua=mailto:[email protected];
4. Start PowerMTA Service
sudo systemctl start pmta
sudo systemctl enable pmta
5. Test Email Sending
To check if PowerMTA is working correctly, send a test email:
telnet smtp.yourdomain.com 25
EHLO yourdomain.com
MAIL FROM: <[email protected]>
RCPT TO: <[email protected]>
DATA
Subject: Test Email
Hello, this is a test email.
.
QUIT
Conclusion
Integrating PowerMTA with DigitalOcean SMTP enhances bulk email delivery while ensuring compliance with authentication protocols. Always monitor email logs and improve IP reputation for better deliverability.
Ref Link: DigitalOcean SMTP Documentation
1 comment
Great breakdown of the process! DigitalOcean’s Port 25 restrictions can be frustrating, but your guide provides a clear and structured way to request access. The mention of third-party email services like SendGrid and Mailgun as alternatives is a smart addition. Thanks for making email configuration easier for DigitalOcean users!