This guide will walk you through configuring Sendmail to use JetEmail as your smarthost for improved email deliverability and authentication.

Prerequisites

  • Root access to your server
  • Sendmail mail server installed and running
  • JetEmail SMTP credentials from your dashboard

Configuration Steps

1

Generate SMTP Credentials

Create a smarthost (or use an existing one) in your JetEmail dashboard.
2

Configure Authentication

Add the following to your Sendmail configuration file (typically /etc/mail/sendmail.mc):
# JetEmail Authentication
define(`SMART_HOST', `relay.jetsmtp.net')
define(`RELAY_MAILER_ARGS', `TCP $h 25')
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')
define(`confDEF_AUTH_INFO', `your_username:your_password')
Replace your_username and your_password with your JetEmail SMTP credentials.
3

Configure DKIM Support

Add DKIM configuration for email authentication:
# DKIM Configuration
define(`confDKIM_SIGNING_KEY', `/path/to/dkim/private/${domain}')
define(`confDKIM_SELECTOR', `default')
define(`confDKIM_DOMAIN', `${domain}')
Update the confDKIM_SIGNING_KEY path to match your DKIM key location.
DKIM configuration is only needed if you haven’t configured the domain in the JetEmail dashboard. If you’ve already set up DKIM in the dashboard, you can skip this step.
4

Configure Access Control

Add access control to allow authentication:
# Access Control
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')
FEATURE(`relay_entire_domain')
FEATURE(`relay_hosts_only')
FEATURE(`relay_based_on_MX')
Create or update /etc/mail/access:
relay.jetsmtp.net RELAY
your_domain.com RELAY
5

Configure Mailer

Add the SMTP mailer configuration:
# SMTP Mailer Configuration
MAILER(`smtp')
MAILER(`local')
The MAILER definitions should be at the end of your sendmail.mc file.
6

Generate Configuration and Restart

Generate the Sendmail configuration and restart the service:
# Generate sendmail.cf from sendmail.mc
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

# Test configuration syntax
sendmail -bt -C /etc/mail/sendmail.cf

# Restart Sendmail
systemctl restart sendmail  # Systemd
# OR
service sendmail restart    # SysV init

Alternative Configuration Method

If you prefer to edit the sendmail.cf file directly, add these lines:
# JetEmail SMTP Configuration
DSrelay.jetsmtp.net
# Authentication
DAyour_username:your_password

Testing Your Configuration

After configuration, test your setup:
  1. Send a test email to an external address:
    echo "Test message" | mail -s "Test Subject" [email protected]
    
  2. Check email headers for authentication details:
    sendmail -bv [email protected]
    
  3. Monitor delivery in your JetEmail dashboard

Troubleshooting

Authentication Failures

  • Verify your SMTP credentials are correct
  • Ensure your account is active and in good standing
  • Check that authentication is properly configured in sendmail.mc

Connection Issues

  • Verify ports 25 or 587 are open in your firewall
  • Test connectivity to relay.jetsmtp.net:
    telnet relay.jetsmtp.net 25
    

Configuration Errors

  • Check Sendmail logs for error messages:
    tail -f /var/log/maillog
    
  • Verify configuration syntax:
    sendmail -bt -C /etc/mail/sendmail.cf
    
  • Check for syntax errors in sendmail.mc:
    m4 /etc/mail/sendmail.mc > /dev/null
    
For additional support, contact our team or visit our Discord community.