How to set up Exim for use with Freerelay

This is based on the exim4 package in Debian, if you have a receipe on how to do it using other exims, please tell me.

Put your generated key in /etc/exim4/key.pem, and the certificate you received by email in /etc/exim4/freerelay.crt.

Add the three lines

hosts_require_tls = freerelay.err.no
tls_certificate = /etc/exim4/freerelay.crt
tls_privatekey = /etc/exim4/key.pem

to /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost. Then, run update-exim4.conf and restart exim. Also, make sure you've set exim to use freerelay.err.no as your smarthost. Freerelay listens to port 25, 587 (submission), 6667 (irc) and 2525, so if any of those are blocked in your network, try another one.