Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3d4d9cc28af00be9852b4cb3055b122e > files > 160

exim-doc-4.69-4.fc12.noarch.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style xmlns="" type="text/css">
div.added    { background-color: #ffff99; }
div.deleted  { text-decoration: line-through;
               background-color: #FF7F7F; }
div.changed  { background-color: #99ff99; }
div.off      {  }

span.added   { background-color: #ffff99; }
span.deleted { text-decoration: line-through;
               background-color: #FF7F7F; }
span.changed { background-color: #99ff99; }
span.off     {  }



pre.literallayout {
  background-color: #E8E8D0;
  padding-left: 0.5cm;
  padding-top:  5px;
  padding-bottom: 5px;
}

div[class=changed] pre.literallayout {
  background-color: #99ff99;
  padding-left: 0.5cm;
  padding-top:  5px;
  padding-bottom: 5px;
}

div.literallayout {
  background-color: #E8E8D0;
  padding-left: 0.5cm;
  padding-top:  5px;
  padding-bottom: 5px;
}

div[class=changed] div.literallayout {
  background-color: #99ff99;
  padding-left: 0.5cm;
  padding-top:  5px;
  padding-bottom: 5px;
}

</style><title>54. Adding new drivers or lookup types</title><meta name="generator" content="DocBook XSL Stylesheets V1.72.0" /><link rel="start" href="index.html" title="Specification of the Exim Mail Transfer Agent" /><link rel="up" href="index.html" title="Specification of the Exim Mail Transfer Agent" /><link rel="prev" href="ch53.html" title="53. Format of spool files" /><link rel="next" href="ix01.html" title="Index" /></head><body><div class="navheader">
<table width="100%" summary="Navigation header"><tr><td width="20%" align="left"><a accesskey="p" href="ch53.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ix01.html">Next</a></td></tr></table></div>
<div class="chapter" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title"><a href="index.html#toc0492" id="CHID12">54. Adding new drivers or lookup types</a></h2></div></div>
</div>
<p>
<a id="id660248" class="indexterm"></a>
<a id="id660258" class="indexterm"></a>
<a id="id660269" class="indexterm"></a>
The following actions have to be taken in order to add a new router, transport,
authenticator, or lookup type to Exim:
</p>
<div class="orderedlist">
<ol type="1"><li><p>
Choose a name for the driver or lookup type that does not conflict with any
existing name; I will use “<span class="quote">newdriver</span>” in what follows.
</p>
</li><li><p>
Add to <em class="filename">src/EDITME</em> the line:
</p>
<div class="literallayout">
&lt;<span class="emphasis"><em>type</em></span>&gt;<code class="literal">_NEWDRIVER=yes</code><br />
</div>
<p>
where &lt;<span class="emphasis"><em>type</em></span>&gt; is ROUTER, TRANSPORT, AUTH, or LOOKUP. If the
code is not to be included in the binary by default, comment this line out. You
should also add any relevant comments about the driver or lookup type.
</p>
</li><li><p>
Add to <em class="filename">src/config.h.defaults</em> the line:
</p>
<pre class="literallayout">#define &lt;type&gt;_NEWDRIVER
</pre></li><li><p>
Edit <em class="filename">src/drtables.c</em>, adding conditional code to pull in the private header
and create a table entry as is done for all the other drivers and lookup types.
</p>
</li><li><p>
Edit <em class="filename">Makefile</em> in the appropriate sub-directory (<em class="filename">src/routers</em>,
<em class="filename">src/transports</em>, <em class="filename">src/auths</em>, or <em class="filename">src/lookups</em>); add a line for the new
driver or lookup type and add it to the definition of OBJ.
</p>
</li><li><p>
Create <em class="filename">newdriver.h</em> and <em class="filename">newdriver.c</em> in the appropriate sub-directory of
<em class="filename">src</em>.
</p>
</li><li><p>
Edit <em class="filename">scripts/MakeLinks</em> and add commands to link the <em class="filename">.h</em> and <em class="filename">.c</em> files
as for other drivers and lookups.
</p>
</li></ol></div>
<p>
Then all you need to do is write the code! A good way to start is to make a
proforma by copying an existing module of the same type, globally changing all
occurrences of the name, and cutting out most of the code. Note that any
options you create must be listed in alphabetical order, because the tables are
searched using a binary chop procedure.
</p>
<p>
There is a <em class="filename">README</em> file in each of the sub-directories of <em class="filename">src</em> describing
the interface that is expected.
</p>
</div>
<div class="navfooter">
<table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch53.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ix01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div>
</body></html>