Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 9adab841b2346eed28e146b23c25375c > files > 157

exim-doc-4.73-2.fc15.noarch.rpm

<!DOCTYPE html PUBLIC "XSLT-compat">
<html lang="en-GB">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../common.css">
<meta name="author" content="The Exim Project. &lt;http://www.exim.org/&gt;">
<meta name="copyright" content="Copyright ©2010 The Exim Project. All rights reserved">
<meta name="description" content="Exim is a message transfer agent (MTA) developed at the University of Cambridge for use on Unix systems connected to the Internet.">
<meta name="keywords" content="exim,smtp,mta,email">
<meta name="robots" content="noodp,noydir,index,follow">
<meta name="viewport" content="width=device-width">
<title>55. Adding new drivers or lookup types</title>
<link rel="stylesheet" type="text/css" href="../../../../doc/chapter.css">
<link rel="canonical" href="http://www.exim.org/exim-html-current/doc/html/spec_html/ch55.html">
</head>
<body>
<h1 id="header"><a href="../../../..">Exim Internet Mailer</a></h1>
<div id="outer">
<ul id="nav_flow" class="nav">
<li><a href="../../../../index.html">Home</a></li>
<li><a href="../../../../mirrors.html">Download</a></li>
<li><a href="../../../../docs.html">Documentation</a></li>
<li><a href="../../../../maillist.html">Mailing Lists</a></li>
<li><a href="http://wiki.exim.org/">Wiki</a></li>
<li><a href="http://www.exim.org/bugzilla/">Bugs</a></li>
<li><a href="../../../../credits.html">Credits</a></li>
<li class="search"><form action="http://www.google.com/search" method="get">
<span class="search_field_container"><input type="search" name="q" placeholder="Search Docs" class="search_field"></span><input type="hidden" name="hl" value="en"><input type="hidden" name="ie" value="UTF-8"><input type="hidden" name="as_qdr" value="all"><input type="hidden" name="q" value="site:www.exim.org"><input type="hidden" name="q" value="inurl:exim-html-current">
</form></li>
</ul>
<div id="inner"><div id="content">
<a class="previous_page" href="ch54.html">&lt;-previous</a><a class="next_page" href="ch56.html">next-&gt;</a><div id="chapter" class="chapter">
<h2 id="CHID13" class="">Chapter 55 - Adding new drivers or lookup types</h2>
<p>



The following actions have to be taken in order to add a new router, transport,
authenticator, or lookup type to Exim:
</p>
<ol>
<li>
<p>
Choose a name for the driver or lookup type that does not conflict with any
existing name; I will use “newdriver” in what follows.
</p>
</li>
<li>
<p>
Add to <span class="docbook_filename">src/EDITME</span> the line:
</p>
<div class="docbook_literallayout"><pre>
&lt;<span class="docbook_emphasis">type</span>&gt;<code class="docbook_literal">_NEWDRIVER=yes</code>
</pre></div>
<p>
where &lt;<span class="docbook_emphasis">type</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 <span class="docbook_filename">src/config.h.defaults</span> the line:
</p>
<div class="docbook_literallayout"><pre>
#define &lt;type&gt;_NEWDRIVER
</pre></div>
</li>
<li>
<p>
Edit <span class="docbook_filename">src/drtables.c</span>, 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 <span class="docbook_filename">Makefile</span> in the appropriate sub-directory (<span class="docbook_filename">src/routers</span>,
<span class="docbook_filename">src/transports</span>, <span class="docbook_filename">src/auths</span>, or <span class="docbook_filename">src/lookups</span>); add a line for the new
driver or lookup type and add it to the definition of OBJ.
</p>
</li>
<li>
<p>
Create <span class="docbook_filename">newdriver.h</span> and <span class="docbook_filename">newdriver.c</span> in the appropriate sub-directory of
<span class="docbook_filename">src</span>.
</p>
</li>
<li>
<p>
Edit <span class="docbook_filename">scripts/MakeLinks</span> and add commands to link the <span class="docbook_filename">.h</span> and <span class="docbook_filename">.c</span> files
as for other drivers and lookups.
</p>
</li>
</ol>
<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 <span class="docbook_filename">README</span> file in each of the sub-directories of <span class="docbook_filename">src</span> describing
the interface that is expected.
</p>
</div>
<a class="previous_page" href="ch54.html">&lt;-previous</a><a class="next_page" href="ch56.html">next-&gt;</a>
</div></div>
<iframe id="branding" name="branding" src="../../../../branding/branding.html" height="0" frameborder="no" scrolling="no"></iframe><div id="footer">Website design by <a href="https://secure.grepular.com/">Mike Cardwell</a>, of <a href="http://cardwellit.com/">Cardwell IT Ltd.</a>
</div>
<div class="left_bar"></div>
<div class="right_bar"></div>
<div id="toc">
<ul class="hidden"></ul>
<img src="../../../../doc/contents.png" width="16" height="155">
</div>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script><script type="text/javascript" src="../../../../common.js"></script><script type="text/javascript" src="../../../../doc/chapter.js"></script>
</body>
</html>