> ## Documentation Index
> Fetch the complete documentation index at: https://jetemail.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# DirectAdmin

> Configuring a smarthost for DirectAdmin

<Warning>We recommend using our [DirectAdmin plugin](/outbound/plugins/directadmin) for best results</Warning>

This guide will walk you through the process of setting up JetEmail as a smarthost in DirectAdmin. By integrating JetEmail's advanced features, you'll enhance your email performance, improve deliverability, and benefit from robust security and streamlined email management.

### Setting up DirectAdmin

<Steps>
  <Step title="Edit Exim Configuration">
    Edit the `/etc/exim.authenticators.post.conf` file to include the following configuration:

    ```plaintext theme={null}
    jetemail_login:
      driver = plaintext
      public_name = LOGIN
      client_send = : Your JetEmail SMTP username : Your JetEmail SMTP password
    ```

    Replace `Your JetEmail SMTP username` and `Your JetEmail SMTP password` with your actual JetEmail credentials.
  </Step>

  <Step title="Edit Exim Transports Configuration">
    Edit the `/etc/exim.transports.pre.conf` file to include the following configuration:

    ```auth_relay: theme={null}
    driver = smtp
    port = 25
    hosts_require_auth = <; $host_address
    hosts_require_tls = $host_address
    headers_add = "${if def:authenticated_id{X-AuthUser: ${authenticated_id}}}"
    interface = <; ${if exists{/etc/virtual/domainips}{${lookup{$sender_address_domain}lsearch*{/etc/virtual/domainips}}}}
    helo_data = ${if exists{/etc/virtual/helo_data}{${lookup{$sending_ip_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}}
    hosts_try_chunking =
    hosts_try_fastopen =
    .include_if_exists /etc/exim.dkim.conf

    auth_relay_forward:
    driver = smtp
    port = 25
    hosts_require_auth = <; $host_address
    hosts_require_tls = $host_address
    headers_add = "${if def:authenticated_id{X-AuthUser: ${authenticated_id}}}"
    interface = <; ${if exists{/etc/virtual/domainips}{${lookup{$sender_address_domain}lsearch*{/etc/virtual/domainips}}}}
    helo_data = ${if exists{/etc/virtual/helo_data}{${lookup{$sending_ip_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}}
    hosts_try_chunking =
    hosts_try_fastopen =
    max_rcpt = 1
    return_path = ${srs_encode {SRS_SECRET} {$return_path} {$original_domain}}
    .include_if_exists /etc/exim.dkim.conf
    ```
  </Step>

  <Step title="Edit Exim Routers Configuration">
    Edit the `/etc/exim.routers.pre.conf` file to include the following configuration:

    ```smart_route_forward: theme={null}
    driver = manualroute
    domains = ! +local_domains
    ignore_target_hosts = 127.0.0.0/8
    condition = ${if !eq{$original_domain}{$domain}}
    condition = ${if !eq{$original_domain}{}}
    condition = "${perl{check_limits}}"

    transport = auth_relay_forward

    route_list = * relay.jetsmtp.net
    no_more

    smart_route:
    driver = manualroute
    domains = ! +local_domains
    ignore_target_hosts = 127.0.0.0/8
    condition = "${perl{check_limits}}"

    transport = auth_relay

    route_list = * relay.jetsmtp.net
    no_more
    ```
  </Step>

  <Step title="Restart Services">
    After saving, you may need to restart the email services. Go to:

    Server Manager -> Service Monitor

    Find and restart the following services:

    * Exim
    * Dovecot
  </Step>

  <Step title="Test Configuration">
    Send a test email to ensure the new configuration is working correctly.
  </Step>
</Steps>

### Additional Configuration (Optional)

For improved deliverability and authentication, consider setting up SPF, DKIM, and DMARC records for your domains.

### Troubleshooting

If you encounter any issues:

1. Double-check your SMTP credentials
2. Verify that port 587 is open in your firewall
3. Check the Exim logs for any error messages
4. Ensure your account is active and in good standing

For further assistance, contact support.
