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
|
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
from spec on 25 November 2000 -->
<TITLE>Exim Specification - 31. The lookuphost 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_30.html">previous</A>, <A HREF="spec_32.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="SEC720" HREF="spec_toc.html#TOC720">31. The lookuphost router</A></H1>
<P>
<A NAME="IDX1634"></A>
The <EM>lookuphost</EM> router looks up the hosts that handle mail for the given
domain either via the <EM>gethostbyname()</EM> function, or by using the DNS directly.
A transport must always be set for this router, unless <EM>verify_only</EM> is set.
</P>
<P>
<font color=green>
When the DNS is used, MX records are looked up first, followed by address
records if no MX records are found, unless the domain matches <EM>mx_domains</EM>. MX
records of equal priority are sorted by Exim into a random order.
</font>
Unless they have the highest priority (lowest MX value), MX records that point
to the local host, or to any host name that matches <EM>hosts_treat_as_local</EM>,
are discarded, together with any other MX records of equal or lower priority.
</P>
<P>
<A NAME="IDX1635"></A>
<A NAME="IDX1636"></A>
If the host pointed to by the highest priority MX record or the host looked up
by <EM>gethostbyname()</EM> is the local host, or matches <EM>hosts_treat_as_local</EM>,
then what happens is controlled by the generic <EM>self</EM> option.
</P>
<P>
<P>
<A NAME="IDX1637"></A>
<A NAME="IDX1638"></A>
<H3><A NAME="SEC721" HREF="spec_toc.html#TOC721">check_secondary_mx (lookuphost)</A></H3>
<P>
Type: boolean<BR>
Default: false
</P>
<P>
If this option is set, the router declines unless the local host is found in (and
removed from) the list of hosts obtained by MX lookup. This can be used to
process domains for which the local host is a secondary mail exchanger
differently to other domains.
</P>
<P>
<A NAME="IDX1639"></A>
<H3><A NAME="SEC722" HREF="spec_toc.html#TOC722">gethostbyname (lookuphost)</A></H3>
<P>
Type: boolean<BR>
Default: false
</P>
<P>
If this is true, the <EM>gethostbyname()</EM> function is used and the options
relating to the DNS are ignored. Otherwise, the name is looked up directly in
the DNS. Of course, <EM>gethostbyname()</EM> may do its own DNS lookup
for an A record (no MX processing is involved),
but it may also access other sources of information such as <EM>/etc/hosts</EM>.
</P>
<P>
<A NAME="IDX1640"></A>
When Exim is compiled with IPv6 support, if a host that is looked up in the DNS
has both A and AAAA
<font color=green>
or A6
</font>
records, all the addresses are used.
</P>
<P>
<A NAME="IDX1641"></A>
<H3><A NAME="SEC723" HREF="spec_toc.html#TOC723">mx_domains (lookuphost)</A></H3>
<P>
Type: domain list<BR>
Default: unset
</P>
<P>
This option applies to domains that are looked up directly in the DNS
(<EM>gethostbyname</EM> is not set). A domain which matches <EM>mx_domains</EM> is required
to have an MX record in order to be recognised. For example, if all the mail
hosts in <EM>fict.book</EM> are known to have MX records, except for those in
<EM>discworld.fict.book</EM>, options of the form
<PRE>
mx_domains = ! *.discworld.fict.book : *.fict.book
</PRE>
<P>
could be used. This would cause messages addressed to a machine that matched
the option but had only an A record to be bounced immediately instead of
sitting on the queue until the delivery timed out.
</P>
<P>
<A NAME="IDX1642"></A>
<H3><A NAME="SEC724" HREF="spec_toc.html#TOC724">qualify_single (lookuphost)</A></H3>
<P>
Type: boolean<BR>
Default: true
</P>
<P>
If domains are being looked up in the DNS (<EM>gethostbyname</EM> is false), the
resolver option that causes it to qualify single-component names with the
default domain (RES_DEFNAMES) is set. For example, on a machine called
<EM>dictionary.ref.book</EM>, looking up the domain <EM>thesaurus</EM> would cause the name
<EM>thesaurus.ref.book</EM> to be looked up
internally in the resolver. Exim itself still looks up the single name.
</P>
<P>
<A NAME="IDX1643"></A>
<H3><A NAME="SEC725" HREF="spec_toc.html#TOC725">rewrite_headers (lookuphost)</A></H3>
<P>
Type: boolean<BR>
Default: true
</P>
<P>
<A NAME="IDX1644"></A>
An abbreviated name may be expanded to its full form by both <EM>gethostbyname()</EM>
or by DNS lookup, or as a result of the <EM>widen_domains</EM> option. For example,
if an address is specified as <EM>dormouse@teaparty</EM>, the domain might get
expanded to <EM>teaparty.wonderland.fict.book</EM>. If this option is true, all
occurrences of the abbreviated name in the headers of the message are rewritten
with the full name. This option should be turned off only when it is known that
no message is ever going to be sent outside an environment where the
abbreviation makes sense.
</P>
<P>
When an MX record is looked up in the DNS and matches a wildcard record,
nameservers normally return a record containing the name that has been looked
up, making it impossible to detect whether a wildcard was present or not.
However, some nameservers have recently been seen to return the wildcard entry.
If the name returned by a DNS lookup begins with an asterisk, it is not used
for header rewriting.
</P>
<P>
<A NAME="IDX1645"></A>
<H3><A NAME="SEC726" HREF="spec_toc.html#TOC726">search_parents (lookuphost)</A></H3>
<P>
Type: boolean<BR>
Default: false
</P>
<P>
If domains are being looked up in the DNS (<EM>gethostbyname</EM> is false), the
resolver option that causes it to search parent domains (RES_DNSRCH) is
set if this option is true. This is different from the <EM>qualify_single</EM> option
in that it applies to domains containing dots. For example, on a machine in the
<EM>fict.book</EM> domain, when looking up <EM>teaparty.wonderland</EM> initially fails, the
resolver automatically tries <EM>teaparty.wonderland.fict.book</EM> if this option is
set. The default setting of this option used to be true, but this causes
problems in domains that have a wildcard MX record, because any domain that
does not have its own MX record then matches the local wildcard. The default
was changed to false in Exim 1.80.
</P>
<P>
<A NAME="IDX1646"></A>
<H3><A NAME="SEC727" HREF="spec_toc.html#TOC727">widen_domains (lookuphost)</A></H3>
<P>
Type: string list<BR>
Default: unset
</P>
<P>
If a lookup fails and this option is set, each of its strings in turn is added
onto the end of the domain, and the lookup is tried again. For example, if
<PRE>
widen_domains = fict.book:ref.book
</PRE>
<P>
is set and a lookup of <EM>klingon.dictionary</EM> fails,
<EM>klingon.dictionary.fict.book</EM> is looked up, and if this fails,
<EM>klingon.dictionary.ref.book</EM> is tried. This option applies to lookups using
<EM>gethostbyname()</EM> as well as to DNS lookups. Note that when the DNS is being
used for lookups, the <EM>qualify_single</EM> and <EM>search_parents</EM> options cause
some widening to be undertaken inside the DNS resolver.
</P>
<P><HR><P>
Go to the <A HREF="spec_1.html">first</A>, <A HREF="spec_30.html">previous</A>, <A HREF="spec_32.html">next</A>, <A HREF="spec_59.html">last</A> section, <A HREF="spec_toc.html">table of contents</A>.
</BODY>
</HTML>
|