File: spec_30.html

package info (click to toggle)
exim-html 3.20-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge, woody
  • size: 2,868 kB
  • ctags: 4,188
  • sloc: makefile: 40; sh: 19
file content (234 lines) | stat: -rw-r--r-- 6,277 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
     from spec on 25 November 2000 -->

<TITLE>Exim Specification - 30. The iplookup router</TITLE>
</HEAD>
<body bgcolor="#FFFFFF" text="#00005A" link="#FF6600" alink="#FF9933" vlink="#990000">
Go to the <A HREF="spec_1.html">first</A>, <A HREF="spec_29.html">previous</A>, <A HREF="spec_31.html">next</A>, <A HREF="spec_59.html">last</A> section, <A HREF="spec_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC710" HREF="spec_toc.html#TOC710">30. The iplookup router</A></H1>
<P>
<A NAME="IDX1622"></A>
The <EM>iplookup</EM> router was written to fulfil a specific requirement in
Cambridge. For this reason, it is not included in the binary of Exim by
default. If you want to include it, you must set

<PRE>
ROUTER_IPLOOKUP=yes
</PRE>

<P>
in your <TT>`Local/Makefile'</TT> configuration file.

</P>
<P>
The <EM>iplookup</EM> router routes an address by sending it over a TCP or UDP
connection to one or more specific hosts. The host can then return the same or
a different address -- in effect rewriting the recipient address in the
message's envelope. If this process fails, the address can be passed on to
other routers, or delivery can be deferred.

</P>
<P>
Background, for those that are interested: We have an Oracle database of all
Cambridge users, and one of the bits of data it maintains for each user is
where to send mail addressed to <EM>&#60;<EM>user</EM>&#62;@cam.ac.uk</EM>. The MX records for
<EM>cam.ac.uk</EM> point to a central machine that has a large alias list that is
abstracted from the database. Mail from outside is switched by this system, and
originally internal mail was also done this way. However, this resulted in a
fair number of messages travelling from some of our larger systems to the
switch and back again. The Oracle machine now runs a UDP service that can be
called by the <EM>iplookup</EM> router in Exim to find out where <EM>&#60;<EM>user</EM>&#62;@cam.ac.uk</EM>
addresses really have to go; this saves passing through the central switch, and
in many cases saves doing any remote delivery at all.

</P>
<P>
Since <EM>iplookup</EM> is just a rewriting router, a transport must <EM>not</EM> be
specified for it.

</P>

<P>

<P>
<A NAME="IDX1623"></A>

</P>
<P>
<A NAME="IDX1624"></A>


<H3><A NAME="SEC711" HREF="spec_toc.html#TOC711">hosts (iplookup)</A></H3>

<P>
Type: string<BR>
Default: unset

</P>
<P>
This option must be supplied. Its value is a colon-separated list of host
names. The hosts are looked up using <EM>gethostbyname()</EM> and are tried in order
until one responds to the query.

</P>
<P>
<A NAME="IDX1625"></A>


<H3><A NAME="SEC712" HREF="spec_toc.html#TOC712">optional (iplookup)</A></H3>

<P>
Type: boolean<BR>
Default: false

</P>
<P>
If <EM>optional</EM> is true, if no response is obtained from any host, the
address is passed on to the next router,
<font color=green>
overriding <EM>no_more</EM>.
</font>
If <EM>optional</EM> is false, delivery to this address is deferred.

</P>
<P>
<A NAME="IDX1626"></A>


<H3><A NAME="SEC713" HREF="spec_toc.html#TOC713">port (iplookup)</A></H3>

<P>
Type: integer<BR>
Default: 0

</P>
<P>
<A NAME="IDX1627"></A>
This option must be supplied. It specifies the port number for the TCP or UDP
call.

</P>
<P>
<A NAME="IDX1628"></A>


<H3><A NAME="SEC714" HREF="spec_toc.html#TOC714">protocol (iplookup)</A></H3>

<P>
Type: string<BR>
Default: "udp"

</P>
<P>
This option can be set to `udp' or `tcp' to specify which of the two protocols
is to be used.

</P>
<P>
<A NAME="IDX1629"></A>


<H3><A NAME="SEC715" HREF="spec_toc.html#TOC715">query (iplookup)</A></H3>

<P>
Type: string, expanded<BR>
Default: "${local_part}@${domain} ${local_part}@${domain}"

</P>
<P>
This defines the content of the query that is sent to the remote hosts. The
repetition serves as a way of checking that a response is to the correct query
in the default case (see <EM>response_pattern</EM> below).

</P>
<P>
<A NAME="IDX1630"></A>


<H3><A NAME="SEC716" HREF="spec_toc.html#TOC716">reroute (iplookup)</A></H3>

<P>
Type: string, expanded<BR>
Default: unset

</P>
<P>
If this option is not set, the rerouted address is precisely the byte string
returned by the remote host, up to the first white space, if any. If set, the
string is expanded to form the rerouted address. It can include parts matched
in the response by <EM>response_pattern</EM> by means of numeric variables such as
$<EM>1</EM>, $<EM>2</EM>, etc. The variable $<EM>0</EM> refers to the entire input string,
whether or not a pattern is in use. In all cases, the rerouted address must end
up in the form &#60;<EM>local_part</EM>&#62;@&#60;<EM>domain</EM>&#62;.

</P>
<P>
<A NAME="IDX1631"></A>


<H3><A NAME="SEC717" HREF="spec_toc.html#TOC717">response_pattern (iplookup)</A></H3>

<P>
Type: string<BR>
Default: unset

</P>
<P>
This option can be set to a regular expression that is applied to the string
returned from the remote host. If the pattern does not match the response, the
router declines. If <EM>response_pattern</EM> is not set, no checking of the response is
done,
unless the query was defaulted, in which case there is a check that the text
returned after the first white space is the original address. This checks
that the answer that has been received is in response to the correct question.
For example, if the response is just a new domain, the following could be
used:

<PRE>
response_pattern = ^([^@]+)$
reroute = $local_part@$1
</PRE>

<P>
<A NAME="IDX1632"></A>


<H3><A NAME="SEC718" HREF="spec_toc.html#TOC718">service (iplookup)</A></H3>

<P>
Type: integer<BR>
Default: 0

</P>
<P>
This is an alternative name for the <EM>port</EM> option.

</P>
<P>
<A NAME="IDX1633"></A>


<H3><A NAME="SEC719" HREF="spec_toc.html#TOC719">timeout (iplookup)</A></H3>

<P>
Type: time<BR>
Default: 5s

</P>
<P>
This specifies the amount of time to wait for a response from the remote
machine.
The same timeout is used for the <EM>connect()</EM> function for a TCP call. It does
not apply to UDP.

</P>

<P><HR><P>
Go to the <A HREF="spec_1.html">first</A>, <A HREF="spec_29.html">previous</A>, <A HREF="spec_31.html">next</A>, <A HREF="spec_59.html">last</A> section, <A HREF="spec_toc.html">table of contents</A>.
</BODY>
</HTML>