https://wiki.eddyn.net/index.php?title=Exim4_trickery&feed=atom&action=historyExim4 trickery - Revision history2024-03-29T04:45:55ZRevision history for this page on the wikiMediaWiki 1.40.0https://wiki.eddyn.net/index.php?title=Exim4_trickery&diff=58&oldid=prevEddynetweb: /* Solution */2017-04-15T04:30:05Z<p><span dir="auto"><span class="autocomment">Solution</span></span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 04:30, 15 April 2017</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l85">Line 85:</td>
<td colspan="2" class="diff-lineno">Line 85:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This will technically place it at the bottom of the sent mail, but you can shift it up using other sections, such as the ".ifdef SPAMASSASSIN" section. </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This will technically place it at the bottom of the sent mail, but you can shift it up using other sections, such as the ".ifdef SPAMASSASSIN" section. </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Make sure to restart exim4 for functionality<del style="font-weight: bold; text-decoration: none;">! </del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Make sure to restart exim4 for functionality!</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> </div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">Make sure to reset nginx</del>!</div></td><td colspan="2" class="diff-side-added"></td></tr>
<!-- diff cache key admin_wiki:diff::1.12:old-57:rev-58 -->
</table>Eddynetwebhttps://wiki.eddyn.net/index.php?title=Exim4_trickery&diff=57&oldid=prevEddynetweb: Exim4 trickery.2017-04-15T04:29:32Z<p>Exim4 trickery.</p>
<p><b>New page</b></p><div>Common things I deal with when setting up exim4. <br />
<br />
== Force TLS on all SMTP connections ==<br />
<br />
How should I force SMTP to use TLS exclusively? <br />
<br />
=== Issue ===<br />
<br />
----<br />
<br />
Traditionally, we've allowed SMTP to communicate over a variety of different ports, including port 25 (insecure). In this instance, we want to make sure that all the connections are made using TLS. <br />
<br />
=== Solution ===<br />
<br />
----<br />
<br />
Simply visit the below directory with your choice of text editor: <br />
<br />
'''/etc/exim4/exim4.conf.template''' <br />
<br />
Then simply look for the following block: <br />
<br />
<source lang="text"><br />
tls_advertise_hosts = * <br />
tls_certificate = /path/to/ssl/certificate.crt<br />
tls_privatekey = /path/to/ssl/certificate.key<br />
</source><br />
<br />
...and add the following block. You'll find we've added a new line called "auth_advertise_hosts" in this instance: <br />
<br />
<source lang="text"><br />
tls_advertise_hosts = * <br />
auth_advertise_hosts = ${if eq {$tls_cipher}{}{}{*}}<br />
tls_certificate = /path/to/ssl/certificate.crt<br />
tls_privatekey = /path/to/ssl/certificate.key<br />
</source><br />
<br />
This will force connections when authenticating towards TLS. <br />
<br />
Restart exim4 and done!<br />
<br />
== Adding custom headers to outgoing mail ==<br />
<br />
If you've ever wondered how to add custom headers...<br />
<br />
=== Issue ===<br />
<br />
----<br />
<br />
I want to be able to provide more information from within the headers as what to do misc. (such as reporting abuse for spam, etc.) <br />
<br />
=== Solution ===<br />
<br />
----<br />
<br />
Simply visit the below directory with your choice of text editor: <br />
<br />
'''/etc/exim4/exim4.conf.template''' <br />
<br />
Which you will search for the following instance: <br />
<br />
<source lang="text"><br />
dnslookup:<br />
driver = dnslookup<br />
domains = !+local_domains<br />
transport = remote_smtp<br />
no_more<br />
</source><br />
<br />
...and add your custom header using "headers_add": <br />
<br />
<source lang="text"><br />
dnslookup:<br />
driver = dnslookup<br />
domains = !+local_domains<br />
transport = remote_smtp<br />
headers_add = "X-AntiAbuse: Suspected Abuse? Forward this email (including headers) to abuse@eddyn.net\n\<br />
X-AntiAbuse: Primary Hostname - $primary_hostname\n\<br />
X-AntiAbuse: Original Domain - $original_domain\n\<br />
X-AntiAbuse: Originator/Caller UID/GID - [$originator_uid $originator_gid] / [$caller_uid $caller_gid]\n\<br />
X-AntiAbuse: Sender Address Domain - $sender_address_domain\n"<br />
no_more<br />
</source><br />
<br />
This will technically place it at the bottom of the sent mail, but you can shift it up using other sections, such as the ".ifdef SPAMASSASSIN" section. <br />
<br />
Make sure to restart exim4 for functionality! <br />
<br />
Make sure to reset nginx!</div>Eddynetweb