Postfix
Configure Postfix mail server to use JetEmail as a smarthost
This guide will walk you through configuring Postfix to use JetEmail as your smarthost for improved email deliverability and authentication.
Prerequisites
- Root access to your server
- Postfix mail server installed and running
- JetEmail SMTP credentials from your dashboard
Configuration Steps
Generate SMTP Credentials
Create a smarthost (or use an existing one) in your JetEmail dashboard.
Configure SMTP Authentication
Create or edit /etc/postfix/sasl_passwd
to include your JetEmail credentials:
Replace your_username
and your_password
with your actual JetEmail SMTP credentials.
Secure the file and create the hash database:
Update Postfix Main Configuration
Add the following lines to /etc/postfix/main.cf
:
Configure Header Authentication
Create /etc/postfix/smtp_header_checks
to add authentication headers:
Replace your_username
with your actual JetEmail SMTP username.
Create the hash database:
Optional: Configure Sender Canonical Maps
If you need to rewrite sender addresses, create /etc/postfix/sender_canonical
:
Add to /etc/postfix/main.cf
:
Create the hash database:
Test Configuration and Restart Postfix
Test your configuration and restart Postfix:
Alternative Port Configuration
If port 25 is blocked, you can use port 587:
Additional Configuration
SPF Records
Don’t forget to update your SPF records to include JetEmail’s servers:
Learn more about SPF configuration.
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 email to an external address:
-
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
- Ensure the password database was created:
postmap /etc/postfix/sasl_passwd
- Check that your JetEmail account is active and in good standing
Connection Issues
- Verify ports 25 or 587 are open in your firewall:
- 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
“TLS is required”
- Ensure
smtp_use_tls = yes
is set - Check TLS certificate configuration
“Connection refused”
- Verify network connectivity to JetEmail servers
- Check firewall settings
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
: -
Add to
/etc/postfix/main.cf
: -
Create hash databases:
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
For additional support, contact our team or visit our Discord community.