Prerequisites
- Root access to your server
- Postfix mail server installed and running
- JetEmail SMTP credentials from your dashboard
Configuration Steps
Create an SMTP user
In your JetEmail dashboard, go to Outbound → SMTP and create an SMTP user (or use an existing one). Keep its username and password handy for the next step.
Configure SMTP Authentication
Create or edit Replace
/etc/postfix/sasl_passwd to include your JetEmail credentials:your_username and your_password with your actual JetEmail SMTP credentials.Secure the file. With texthash there is no separate database to build, so there is no postmap step:This guide uses the
texthash map type throughout. It reads the plaintext file directly, needs no postmap, and is built into every Postfix, so the same commands work on Debian / Ubuntu and on AlmaLinux / Rocky / RHEL. The indexed types are distro-specific (hash on Debian / Ubuntu, lmdb on RHEL 9+); if you prefer one for a large map, switch the type, run the matching postmap, and check postconf -m to confirm your build supports it.Update Postfix Main Configuration
Apply the relay settings with
postconf -e. It updates each key in place, so it never leaves a duplicate entry in /etc/postfix/main.cf:smtp_tls_security_level=encrypt makes TLS mandatory. On Debian and Ubuntu the default main.cf ships smtp_tls_security_level = may (opportunistic); because postconf -e overwrites that line in place rather than adding a second one, you won’t see an overriding earlier entry warning from postfix check.Authentication happens over SASL using the username and password from the previous step. JetEmail does not use any custom authentication headers, so do not add an
smtp_header_checks step for that purpose.smtp_tls_CAfile is intentionally omitted: at the encrypt level Postfix requires TLS but does not verify the relay’s certificate, so a CA bundle is never consulted. Only if you raise the level to verify do you need smtp_tls_CAfile, pointing at your distro’s CA bundle (/etc/ssl/certs/ca-certificates.crt on Debian / Ubuntu, /etc/pki/tls/certs/ca-bundle.crt on AlmaLinux / Rocky / RHEL).Optional: Configure Sender Canonical Maps
If you need to rewrite sender addresses, create Enable the map.
/etc/postfix/sender_canonical:texthash reads the file directly, so no postmap is needed:Alternative Ports
The relay listens on 587, 25, and 2525 for STARTTLS, and 465 for implicit TLS (SSL). Port 587, used above, is the recommended default. Port 25 outbound is blocked by most cloud providers and ISPs, so avoid it unless you know it is open. Ports 25 and 2525 use the same STARTTLS settings as 587; only the port number inrelayhost (and /etc/postfix/sasl_passwd) changes.
To use implicit TLS on port 465 instead, set:
relay.jetsmtp.net:465 key in /etc/postfix/sasl_passwd as well.
Additional Configuration
SPF Records
Don’t forget to update your SPF records to include JetEmail’s servers:Domain Authentication
For enhanced security and deliverability:- Configure Domain Lockdown to prevent domain spoofing
- Set up DMARC for email authentication
- Ensure proper DKIM signing is configured
Testing Your Configuration
After configuration, test your setup:-
Send a test message. Postfix provides its own
sendmail, so no extra mail client is needed (themailcommand is not installed by default):Use aFrom/-faddress on a domain you have verified in JetEmail, and a recipient mailbox you can check. -
Check the mail queue:
-
Monitor Postfix logs:
- Verify authentication in email headers
- Monitor delivery in your JetEmail dashboard
Troubleshooting
Authentication Failures
- Verify your SMTP credentials in
/etc/postfix/sasl_passwd - With
texthashthere is no separate database to build; confirm Postfix can read/etc/postfix/sasl_passwd(owned by root, mode 600) and that you reloaded Postfix after editing it - Check that your JetEmail account is active and in good standing
Connection Issues
- Verify the relay port is reachable from your server (587 by default):
- Check TLS configuration and certificate paths
- Ensure SASL authentication modules are installed:
Configuration Errors
- Check Postfix logs for detailed error messages:
- Test configuration syntax:
postfix check - Verify file permissions on configuration files
Common Error Messages
“SASL authentication failed”- Check username/password in
/etc/postfix/sasl_passwd - Verify the password database exists and is readable
- Ensure
smtp_tls_security_level = encryptis set (postconf smtp_tls_security_levelto check the active value) - Confirm your firewall and provider allow outbound on the relay port (587 by default)
- Verify network connectivity to JetEmail servers
- Check firewall settings
- Indexed map types are compiled in at build time and differ by distro:
hash(Berkeley DB) exists on Debian / Ubuntu but not RHEL 9+, whilelmdbis built in on RHEL 9+ but needs thepostfix-lmdbplugin on Debian / Ubuntu (and is absent on some releases). Runpostconf -mto list what your build supports. - This guide uses
texthash, which is built into every Postfix and avoids the split. If you copied ahash:orlmdb:map from elsewhere and hit this error, change it totexthash:and drop the matchingpostmapcommand, sincetexthashneeds none. - If you specifically want an indexed map, use
hashon Debian / Ubuntu orlmdbon RHEL 9+, run the matchingpostmap, thensystemctl reload postfix.
Advanced Configuration
Multiple Domains with Different Credentials
If you need different SMTP credentials for different domains:-
Create
/etc/postfix/sender_dependent_relayhost_maps: -
Create
/etc/postfix/sender_dependent_sasl_passwd_maps: -
Apply the settings.
texthashreads each file directly, so nopostmapstep is needed. This also repointssmtp_sasl_password_mapsat the per-sender map, replacing the value from the main configuration step in place:For a large number of per-sender entries, an indexed map performs better: switch these tohash(Debian / Ubuntu) orlmdb(RHEL 9+) and run the matchingpostmapon each file.
Security Considerations
- Keep your SMTP credentials secure with proper file permissions
- Regularly rotate your JetEmail SMTP passwords
- Monitor your email logs for suspicious activity
- Consider implementing rate limiting if needed