[Exim] [PATCH] Callout caching/options, version 7

Top Page
Delete this message
Reply to this message
Author: Kevin P. Fleming
Date:  
To: Exim users list
New-Topics: Re: [Exim] [PATCH] Callout caching/options, version 8
Subject: [Exim] [PATCH] Callout caching/options, version 7
http://members.cox.net/kpfleming/exim/callout-cache-patch-v7

Patch is against exim-snapshot from the exim FTP site.

This version of the patch changes the way callout options are specified,
and incorporates Marc Merlin's "postmaster" callout option that is
already in exim-snapshot.

As before, a cache database is created in the normal location, called
callout. There are two sets of records in this database: those keyed
with a complete address (which are used to cache whether that address
will accept a bounce) and those keyed with only a domain name (which are
used to cache three bits of information about that domain).

The new callout syntax is as follows:

deny ...
      verify = sender/callout[=callout-option,callout-option,...]


where callout-option can be one of the following:
no_cache: do not cache any results from this callout
defer_ok: treat deferral as success
(time): use time value for callout timeout
postmaster: check postmaster @domain
random: check random local part @domain

NOTE: This patch removes the /callout_defer_ok syntax on the
sender/receiver verify option in preference to the new, combined syntax
above.

There are five new main configuration file options:

callout_positive_expire/callout_negative_expire: time values used to
expire full address cache records
callout_domain_positive_expire/callout_domain_negative_expire: time
values used to expire domain-only cache records
callout_random_local_part: string value used if random option is used on
a callout

The "postmaster" and "random" options are cached in the domain-level
cache record. In addition, if the domain refuses MAIL FROM:<> outright
(before any RCPT TO:), that is cached in the database and no further
callouts to that domain will be attempted until the record expires.

If the "postmaster" option is used, then an attempt is made to verify
postmaster@domain; if that fails, that result is cached, and the address
that was undergoing verification is _also_ failed. This is the behavior
currently present in exim-snapshot. No further callouts will be made to
that domain until the cache record expires.

If the "random" option is used, an attempt is made to verify the random
local part at the domain; if it succeeds, that result is cached, and no
further callouts will be made to that domain until the record expires.

If multiple verifications in a single SMTP session are requested, RSET
is issued between verifications, in case the target server has a problem
with multiple RCPT TO: after MAIL FROM:<> (thanks Marc for that bit of
knowledge).

exim_dumpdb/exim_tidydb/exim_fixdb have been updated to support the new
database as well, so you can peruse and modify the cache database to
your heart's content.