<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.ledhed.net/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.ledhed.net/index.php?action=history&amp;feed=atom&amp;title=DSpam_EXIM_INTEGRATION</id>
		<title>DSpam EXIM INTEGRATION - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.ledhed.net/index.php?action=history&amp;feed=atom&amp;title=DSpam_EXIM_INTEGRATION"/>
		<link rel="alternate" type="text/html" href="https://wiki.ledhed.net/index.php?title=DSpam_EXIM_INTEGRATION&amp;action=history"/>
		<updated>2026-04-18T00:11:54Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.2</generator>

	<entry>
		<id>//wiki.ledhed.net/index.php?title=DSpam_EXIM_INTEGRATION&amp;diff=2113&amp;oldid=prev</id>
		<title>Ledhed at 19:23, 12 June 2009</title>
		<link rel="alternate" type="text/html" href="https://wiki.ledhed.net/index.php?title=DSpam_EXIM_INTEGRATION&amp;diff=2113&amp;oldid=prev"/>
				<updated>2009-06-12T19:23:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 19:23, 12 June 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== CREATING A NEW DIRECTOR ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== CREATING A NEW DIRECTOR ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;To integrate DSPAM with exim 4, you'll need to create a new director in the exim configuration.&amp;#160; First, add the following code to the directors:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;To integrate DSPAM with &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[http://www.exim.org/ &lt;/ins&gt;exim 4&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/ins&gt;, you'll need to create a new director in the exim configuration.&amp;#160; First, add the following code to the directors:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; spamscan:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; spamscan:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  no_verify&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  no_verify&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ledhed</name></author>	</entry>

	<entry>
		<id>//wiki.ledhed.net/index.php?title=DSpam_EXIM_INTEGRATION&amp;diff=2098&amp;oldid=prev</id>
		<title>Ledhed: Created page with '== CREATING A NEW DIRECTOR ==  To integrate DSPAM with exim 4, you'll need to create a new director in the exim configuration.  First, add the following code to the directors:  s...'</title>
		<link rel="alternate" type="text/html" href="https://wiki.ledhed.net/index.php?title=DSpam_EXIM_INTEGRATION&amp;diff=2098&amp;oldid=prev"/>
				<updated>2009-06-12T18:51:31Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;== CREATING A NEW DIRECTOR ==  To integrate DSPAM with exim 4, you&amp;#039;ll need to create a new director in the exim configuration.  First, add the following code to the directors:  s...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== CREATING A NEW DIRECTOR ==&lt;br /&gt;
&lt;br /&gt;
To integrate DSPAM with exim 4, you'll need to create a new director in the exim configuration.  First, add the following code to the directors:&lt;br /&gt;
 spamscan:&lt;br /&gt;
   no_verify&lt;br /&gt;
   condition = &amp;quot;${if and {{!eq {$received_protocol}{spam-scanned}} {!eq {$received_protocol}{local}} } {1}{0}}&amp;quot;&lt;br /&gt;
   driver = accept&lt;br /&gt;
   transport = spamcheck&lt;br /&gt;
   require_files = /usr/local/var/dspam:\&lt;br /&gt;
     +/usr/local/bin&lt;br /&gt;
This code tells exim to run spamcheck unless the message was marked by the agent with the spam-scanned protocol, or if it is local mail (to prevent loops). If you're using an alternative prefix, adjust the pathnames to match.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then add the following code to the transports section. This code defines how dspam is called by exim for scanning email:&lt;br /&gt;
 spamcheck:&lt;br /&gt;
   driver = pipe&lt;br /&gt;
   command = /usr/local/bin/dspam --deliver=innocent --user $local_part -- %u&lt;br /&gt;
   user = mail&lt;br /&gt;
   group = mail&lt;br /&gt;
   return_path_add = false&lt;br /&gt;
   log_output = true&lt;br /&gt;
   return_fail_output = true&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you're using virtual users on the system, you may wish to include the domain as part of the username: &lt;br /&gt;
  command = /usr/local/bin/dspam --deliver=innocent --user &amp;quot;$local_part@$domain&amp;quot; -- %u&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, you will need to configure and compile DSPAM. DSPAM will most likely end up calling exim again for delivery, using the spam-scanned protocol to identify scanned messages. The most common example is:&lt;br /&gt;
 ./configure --with-delivery-agent=&amp;quot;/usr/sbin/exim -oMr spam-scanned&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RUNNING WITHOUT PRIVILEGED EXIM USERS ==&lt;br /&gt;
&lt;br /&gt;
The problem with setting the $received_protocol in the transport is that only privileged Exim users are allowed to do so. With the setup below, DSPAM can run as a nonprivileged user. The problem, however, is that this header could be easily spoofed:&lt;br /&gt;
 condition = &amp;quot;${if and {\&lt;br /&gt;
                       {!def:h_X-DSPAM-Check:}\&lt;br /&gt;
               }{1}{0}}&amp;quot;&lt;br /&gt;
 headers_add = &amp;quot;X-DSPAM-Check: by $primary_hostname on $tod_full&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DIRECTORY SETTINGS ==&lt;br /&gt;
&lt;br /&gt;
When changing the user/group it is highly advisable to set &amp;quot;home_directory&amp;quot; and &amp;quot;current_directory&amp;quot; to match the DSPAM home:&lt;br /&gt;
 home_directory = &amp;quot;/usr/local/var/dspam&amp;quot; # or /tmp&lt;br /&gt;
 current_directory = &amp;quot;/usr/local/var/dspam&amp;quot; # or /tmp&lt;br /&gt;
&lt;br /&gt;
Otherwise, the transport might try to run DSPAM in something like /home/bob under certain circumstances. This will most likely fail if DSPAM runs as &amp;quot;mail&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== PASS-THROUGH ==&lt;br /&gt;
&lt;br /&gt;
For a pass-through setup where DSPAM feeds all processed messages back to Exim it is also a good idea to set &amp;quot;prefix&amp;quot; and &amp;quot;suffix&amp;quot; to an empty string:&lt;br /&gt;
 prefix = &amp;quot;&amp;quot;&lt;br /&gt;
 suffix = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ALIASES ==&lt;br /&gt;
&lt;br /&gt;
There is no need to create aliases for every user on the system in order to handle spam reports and false positives. They can be handled by directors and transports, using the following directors:&lt;br /&gt;
 dspam_addspam:&lt;br /&gt;
   prefix = spam-&lt;br /&gt;
   driver = localuser&lt;br /&gt;
   transport = addspam&lt;br /&gt;
 &lt;br /&gt;
 dspam_falsepositive:&lt;br /&gt;
   prefix = falsepos-&lt;br /&gt;
   driver = localuser&lt;br /&gt;
   transport = falsepositive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For every $user on the system, these directors will handle messages addressed to &amp;quot;spam-$user@localhost&amp;quot; and &amp;quot;falsepos-$user@localhost&amp;quot;, strip the prefix from the address, and pass the message to the respective transport. This requires two additional transports:&lt;br /&gt;
 addspam:&lt;br /&gt;
   driver = pipe&lt;br /&gt;
   command = &amp;quot;/path/to/dspam --user $local_part --class=spam --source=error&amp;quot;&lt;br /&gt;
   return_path_add = false&lt;br /&gt;
   return_fail_output = true&lt;br /&gt;
   log_output = true&lt;br /&gt;
   home_directory = &amp;quot;/path/to/dspam/dspam-home&amp;quot; # or &amp;quot;/tmp&amp;quot;&lt;br /&gt;
   current_directory = &amp;quot;/path/to/dspam/dspam-home&amp;quot; # or &amp;quot;/tmp&amp;quot;&lt;br /&gt;
   user = mail&lt;br /&gt;
   group = mail&lt;br /&gt;
   prefix = &amp;quot;&amp;quot;&lt;br /&gt;
   suffix = &amp;quot;&amp;quot;&lt;br /&gt;
 falsepositive:&lt;br /&gt;
   driver = pipe&lt;br /&gt;
   command = &amp;quot;/path/to/dspam --user $local_part --class=innocent --source=error --deliver=innocent %u&amp;quot;&lt;br /&gt;
   return_path_add = false&lt;br /&gt;
   return_fail_output = true&lt;br /&gt;
   log_output = true&lt;br /&gt;
   home_directory = &amp;quot;/path/to/dspam-home&amp;quot; # or &amp;quot;/tmp&amp;quot;&lt;br /&gt;
   current_directory = &amp;quot;/path/to/dspam-home&amp;quot; # or &amp;quot;/tmp&amp;quot;&lt;br /&gt;
   user = mail&lt;br /&gt;
   group = mail&lt;br /&gt;
   prefix = &amp;quot;&amp;quot;&lt;br /&gt;
   suffix = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This way, all users are handled transparently. No fiddling with aliases is required as you add or remove users.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:DSpam]]&lt;/div&gt;</summary>
		<author><name>Ledhed</name></author>	</entry>

	</feed>