<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=Exim4Config</id>
	<title>Exim4Config - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=Exim4Config"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Exim4Config&amp;action=history"/>
	<updated>2026-08-21T23:30:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Exim4Config&amp;diff=27181&amp;oldid=prev</id>
		<title>Robl at 07:42, 23 August 2023</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Exim4Config&amp;diff=27181&amp;oldid=prev"/>
		<updated>2023-08-23T07:42:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:42, 23 August 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l136&quot;&gt;Line 136:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 136:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;    R: smarthost for bob@example.com&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;    R: smarthost for bob@example.com&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;    bob@example.com&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;    bob@example.com&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;    &amp;lt;-- bob@&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;support&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lonap&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;net&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;    &amp;lt;-- bob@&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rt&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;example&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;com&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;    router = smarthost, transport = remote_smtp_smarthost&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;    router = smarthost, transport = remote_smtp_smarthost&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;    host your-mail-server.example.com [x:x:x::x]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;    host your-mail-server.example.com [x:x:x::x]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key bestpractical_mediawiki1459887241:diff:1.41:old-27179:rev-27181:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Robl</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Exim4Config&amp;diff=27179&amp;oldid=prev</id>
		<title>Robl: Created page with &quot; Example for exim4 configs:  == Debian Exim ==  The following was tested on Exim 4.94.2 Debian split config.  # Install either exim4-daemon-light or exim4-daemon-heavy, depending on feature requirements.  exim4-daemon-light is sufficient unless you need database lookup features (MySQL etc.) or content/malware scanning etc.   apt-get install exim4-daemon-light  === Initial setup  ===  If RT is on a &#039;&#039;&#039;dedicated server or VM&#039;&#039;&#039;, you will probably want to configure Exim in...&quot;</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Exim4Config&amp;diff=27179&amp;oldid=prev"/>
		<updated>2023-08-23T02:51:13Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; Example for exim4 configs:  == Debian Exim ==  The following was tested on Exim 4.94.2 Debian split config.  # Install either exim4-daemon-light or exim4-daemon-heavy, depending on feature requirements.  exim4-daemon-light is sufficient unless you need database lookup features (MySQL etc.) or content/malware scanning etc.   apt-get install exim4-daemon-light  === Initial setup  ===  If RT is on a &amp;#039;&amp;#039;&amp;#039;dedicated server or VM&amp;#039;&amp;#039;&amp;#039;, you will probably want to configure Exim in...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
Example for exim4 configs:&lt;br /&gt;
&lt;br /&gt;
== Debian Exim ==&lt;br /&gt;
&lt;br /&gt;
The following was tested on Exim 4.94.2 Debian split config.&lt;br /&gt;
&lt;br /&gt;
# Install either exim4-daemon-light or exim4-daemon-heavy, depending on feature requirements.&lt;br /&gt;
&lt;br /&gt;
exim4-daemon-light is sufficient unless you need database lookup features (MySQL etc.) or content/malware scanning etc.&lt;br /&gt;
&lt;br /&gt;
 apt-get install exim4-daemon-light&lt;br /&gt;
&lt;br /&gt;
=== Initial setup  ===&lt;br /&gt;
&lt;br /&gt;
If RT is on a &amp;#039;&amp;#039;&amp;#039;dedicated server or VM&amp;#039;&amp;#039;&amp;#039;, you will probably want to configure Exim in smarthost mode. &lt;br /&gt;
&lt;br /&gt;
smarthost mode will send all outgoing email to your mail server. There are some exceptions which you may want to configure.&lt;br /&gt;
&lt;br /&gt;
/etc/exim4/update-exim4.conf.conf example below - set any domains for your RT box, and the mail server name,&lt;br /&gt;
and then &amp;#039;&amp;#039;&amp;#039;execute&amp;#039;&amp;#039;&amp;#039; update-exim4.conf&lt;br /&gt;
&lt;br /&gt;
 # /etc/exim4/update-exim4.conf.conf&lt;br /&gt;
 #&lt;br /&gt;
 # Edit this file and /etc/mailname by hand and execute update-exim4.conf&lt;br /&gt;
 # yourself or use &amp;#039;dpkg-reconfigure exim4-config&amp;#039;&lt;br /&gt;
 #&lt;br /&gt;
 # Please note that this is _not_ a dpkg-conffile and that automatic changes&lt;br /&gt;
 # to this file might happen. The code handling this will honor your local&lt;br /&gt;
 # changes, so this is usually fine, but will break local schemes that mess&lt;br /&gt;
 # around with multiple versions of the file.&lt;br /&gt;
 #&lt;br /&gt;
 # update-exim4.conf uses this file to determine variable values to generate&lt;br /&gt;
 # exim configuration macros for the configuration file.&lt;br /&gt;
 #&lt;br /&gt;
 # Most settings found in here do have corresponding questions in the&lt;br /&gt;
 # Debconf configuration, but not all of them.&lt;br /&gt;
 #&lt;br /&gt;
 # This is a Debian specific file&lt;br /&gt;
 &lt;br /&gt;
 dc_eximconfig_configtype=&amp;#039;smarthost&amp;#039;&lt;br /&gt;
 dc_other_hostnames=&amp;#039;rt.example.com:support.example.com&amp;#039;&lt;br /&gt;
 dc_local_interfaces=&amp;#039;&amp;#039;&lt;br /&gt;
 dc_readhost=&amp;#039;&amp;#039;&lt;br /&gt;
 dc_relay_domains=&amp;#039;&amp;#039;&lt;br /&gt;
 dc_minimaldns=&amp;#039;false&amp;#039;&lt;br /&gt;
 dc_relay_nets=&amp;#039;&amp;#039;&lt;br /&gt;
 dc_smarthost=&amp;#039;your-mail-server.example.com&amp;#039;&lt;br /&gt;
 CFILEMODE=&amp;#039;644&amp;#039;&lt;br /&gt;
 dc_use_split_config=&amp;#039;true&amp;#039;&lt;br /&gt;
 dc_hide_mailname=&amp;#039;false&amp;#039;&lt;br /&gt;
 dc_mailname_in_oh=&amp;#039;true&amp;#039;&lt;br /&gt;
 dc_localdelivery=&amp;#039;mail_spool&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== Macros (Defined in debian-exim config. Allows easy enabling or config of certain features.) ===&lt;br /&gt;
&lt;br /&gt;
/etc/exim4/conf.d/main/000_localmacros:&lt;br /&gt;
&lt;br /&gt;
 REWRITE_LOCAL_DOMAIN = example.com&lt;br /&gt;
 SYSTEM_ALIASES_PIPE_TRANSPORT = address_pipe&lt;br /&gt;
 IGNORE_SMTP_LINE_LENGTH_LIMIT = 1&lt;br /&gt;
 MAIN_TRUSTED_USERS = www-data&lt;br /&gt;
&lt;br /&gt;
=== Outgoing mail - extra tweaks ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Optional: Allow exceptions to sending everything to the smarthost, for example &amp;#039;&amp;#039;&amp;#039;some&amp;#039;&amp;#039;&amp;#039; local mailboxes. ====&lt;br /&gt;
&lt;br /&gt;
The following will deliver mail to bob@rt.example.com, but &amp;#039;&amp;#039;&amp;#039;only if&amp;#039;&amp;#039;&amp;#039; the user bob actually exists,&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; there is a mailbox file in /var/mail/bob&lt;br /&gt;
&lt;br /&gt;
/etc/exim4/conf.d/router/900_exim4-config_local_user&lt;br /&gt;
&lt;br /&gt;
 # /etc/exim4/conf.d/router/900_exim4-config_local_user&lt;br /&gt;
 #&lt;br /&gt;
 # This router matches local user mailboxes.&lt;br /&gt;
   &lt;br /&gt;
 local_user:&lt;br /&gt;
   debug_print = &amp;quot;R: local_user for $local_part@$domain&amp;quot;&lt;br /&gt;
   driver = accept&lt;br /&gt;
   domains = +local_domains&lt;br /&gt;
   require_files = /var/mail/${local_part}&lt;br /&gt;
   check_local_user&lt;br /&gt;
   # local_parts = ! root&lt;br /&gt;
   transport = LOCAL_DELIVERY&lt;br /&gt;
   cannot_route_message = Unknown user&lt;br /&gt;
&lt;br /&gt;
Everything else will get sent to the smarthost, (Even if the user exists, a mailbox file must also exist)&lt;br /&gt;
&lt;br /&gt;
Test with:&lt;br /&gt;
&lt;br /&gt;
  # touch /var/mail/bob &amp;amp;&amp;amp; chown bob:bob /var/mail/bob&lt;br /&gt;
  # service exim4 restart&lt;br /&gt;
  # id bob&lt;br /&gt;
  uid=1002(bob) gid=1002(bob) groups=1002(bob),27(sudo)&lt;br /&gt;
  # exim -bt bob@rt.example.com&lt;br /&gt;
  R: system_aliases for bob@rt.example.com&lt;br /&gt;
  R: userforward for bob@rt.example.com&lt;br /&gt;
  R: procmail for bob@rt.example.com&lt;br /&gt;
  R: maildrop for bob@rt.example.com&lt;br /&gt;
  R: lowuid_aliases for bob@rt.example.com (UID 1002)&lt;br /&gt;
  R: local_user for bob@rt.example.com&lt;br /&gt;
 bob@rt.example.com&lt;br /&gt;
  router = local_user, transport = mail_spool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2. Optional: Reroute *@rt.example.com to *@example.com ====&lt;br /&gt;
&lt;br /&gt;
Bear in mind that Exim will be the MTA for everything on the local machine, not just RT. It can be annoying if local processes,&lt;br /&gt;
(for example cron) send mail to local users where it will either bounce, or sit in /var/mail and never be seen.&lt;br /&gt;
&lt;br /&gt;
To ensure local mail gets delivered to a user&amp;#039;s actual mailbox (and save a bit of /etc/aliases hell), the following&lt;br /&gt;
will deliver any mail for local users to the main domain (and via the smarthost):&lt;br /&gt;
&lt;br /&gt;
 # /etc/exim4/conf.d/router/950_exim4-config_local_user_smarthost&lt;br /&gt;
 # force delivery of user@rt.example.com -&amp;gt; user@example.com:&lt;br /&gt;
 &lt;br /&gt;
 not_local_user:&lt;br /&gt;
   debug_print = &amp;quot;R: not_local_user for $local_part@$domain&amp;quot;&lt;br /&gt;
   driver = redirect&lt;br /&gt;
   domains = +local_domains&lt;br /&gt;
   data = ${local_part}@REWRITE_LOCAL_DOMAIN&lt;br /&gt;
   no_verify&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Test with:&lt;br /&gt;
&lt;br /&gt;
  # service exim4 restart&lt;br /&gt;
  # exim -bt bob@rt.example.com&lt;br /&gt;
   R: system_aliases for bob@rt.example.com&lt;br /&gt;
   R: userforward for bob@rt.example.com&lt;br /&gt;
   R: procmail for bob@rt.example.com&lt;br /&gt;
   R: maildrop for bob@rt.example.com&lt;br /&gt;
   R: lowuid_aliases for bob@rt.example.com (UID 1002)&lt;br /&gt;
   R: local_user for bob@rt.example.com&lt;br /&gt;
   R: not_local_user for bob@rt.example.com&lt;br /&gt;
   R: smarthost for bob@example.com&lt;br /&gt;
   bob@example.com&lt;br /&gt;
   &amp;lt;-- bob@support.lonap.net&lt;br /&gt;
   router = smarthost, transport = remote_smtp_smarthost&lt;br /&gt;
   host your-mail-server.example.com [x:x:x::x]&lt;br /&gt;
   host your-mail-server.example.com [x.x.x.x]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Incoming mail ===&lt;br /&gt;
&lt;br /&gt;
For incoming mail to RT, the simplest method is to add the queue aliases to /etc/aliases:&lt;br /&gt;
&lt;br /&gt;
On your mail server (if appropriate):&lt;br /&gt;
&lt;br /&gt;
 ### RT/Ticketer Addresses:&lt;br /&gt;
 sales:                  sales@rt.example.com&lt;br /&gt;
 sales-comment:          sales-comment@rt.example.com&lt;br /&gt;
 support:                support@rt.example.com&lt;br /&gt;
 support-comment:        support-comment@rt.example.com&lt;br /&gt;
 accounts:               accounts@rt.example.com&lt;br /&gt;
 accounts-comment:       accounts-comment@rt.example.com&lt;br /&gt;
&lt;br /&gt;
On the RT server:&lt;br /&gt;
&lt;br /&gt;
 # forwarders for RT queues:&lt;br /&gt;
 &lt;br /&gt;
 sales: &amp;quot;|/usr/bin/rt-mailgate --queue \&amp;quot;Sales\&amp;quot; --action correspond --url https://rt.example.com/rt&amp;quot;&lt;br /&gt;
 sales-comment: &amp;quot;|/usr/bin/rt-mailgate --queue \&amp;quot;Sales\&amp;quot; --action comment --url https://rt.example.com/rt&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 support: &amp;quot;|/usr/bin/rt-mailgate --queue \&amp;quot;Support\&amp;quot; --action correspond --url https://rt.example.com/rt&amp;quot;&lt;br /&gt;
 support-comment: &amp;quot;|/usr/bin/rt-mailgate --queue \&amp;quot;Support\&amp;quot; --action comment --url https://rt.example.com/rt&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 accounts: &amp;quot;|/usr/bin/rt-mailgate --queue \&amp;quot;Accounts\&amp;quot; --action correspond --url https://rt.example.com/rt&amp;quot;&lt;br /&gt;
 accounts-comment: &amp;quot;|/usr/bin/rt-mailgate --queue \&amp;quot;Accounts\&amp;quot; --action comment --url https://rt.example.com/rt&amp;quot;&lt;/div&gt;</summary>
		<author><name>Robl</name></author>
	</entry>
</feed>