> For the complete documentation index, see [llms.txt](https://docs.emaildelivery.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emaildelivery.com/docs/options-for-adding-https/transactional-smtp-relay-requirements-for-cloudflare.md).

# Transactional SMTP Relay requirements for Cloudflare

{% hint style="info" %}
If you've enabled the Cloudflare proxy for HTTPS://, incoming Transactional SMTP Relay is blocked by Cloudflare's firewall unless you pay for the spectrum service.
{% endhint %}

{% hint style="info" %}
To use Transactional SMTP Relay with Cloudflare, you'll need to make a secondary subdomain just for this purpose with the proxy switch flipped to the gray cloud (OFF).&#x20;
{% endhint %}

{% hint style="info" %}
You'll then need to create a TLS certificate using Let's Encrypt just for SMTP, in order to ensure compatibility with connecting applications.&#x20;
{% endhint %}

{% hint style="info" %}
Below are the instructions for enabling TLS for Transactional SMTP Relay on your VPS for compatibility with Cloudflare when using Cloudflare as your reverse proxy for HTTPS.&#x20;
{% endhint %}

Log into your VPS using SSH on macOS or PuTTY on Windows.

Change directory to your ESP installation:

```
cd edcom-install
```

Run this command and provide your secondary SMTP Relay subdomain and domain you created just for this purpose as an argument.

```
./generate_smtp_certificate.sh smtprelay.yourdomain.com
```

**\*\*\* Note:** Use the the real subdomain and domain you created for this purpose above, not smtprelay.yourdomain.com, this is just a placeholder.&#x20;

Restart your ESP:&#x20;

```
./restart.sh
```

{% hint style="info" %}
**Create an automated cron job that renews your Let's Encrypt certificate every 30 days.**&#x20;
{% endhint %}

Run the following command and when you're asked which editor to use, select nano:

```
crontab -e
```

<figure><img src="/files/3W8eZFLz8yQrW3Ay0fkR" alt=""><figcaption></figcaption></figure>

Copy and paste the following into the bottom of the editor, change the placeholder domain to  the real subdomain and domain you created for this purpose, and hit ctrl-x to save:

{% code overflow="wrap" %}

```
* * */30 * * cd /root/edcom-install && ./renew_smtp_certificate.sh smtprelay.domain.com > data/logs/certbot.log 2>&1
```

{% endcode %}

**\*\*\* Note:** Use the real subdomain and domain you created for this purpose above, not smtprelay.yourdomain.com, this is just a placeholder.&#x20;

<figure><img src="/files/xscQ7PoAj1u7owPv4z1o" alt=""><figcaption></figcaption></figure>

**\*\*\* Note:** If your ESP is installed somewhere else other than /root/edcom-install you will need to modify that as well.

{% hint style="success" %}
**You're done!**\
Make sure you use TLS for your Transactional SMTP Relay settings and not SSL in the configuration of your connecting applications.&#x20;
{% endhint %}
