Name

-T

Synopsis

When a resource is temporarily unavailable, it would be handy if sendmail indicated that unavailability when the database lookup fails. Consider NIS, for example. It can time out when a server is down briefly, but a failed lookup of a user’s login name need not cause a permanent failure under such a circumstance. Instead, something should be returned to show that it is only a temporary failure.

The -T database switch was added with V8.10 sendmail to solve this problem. You use it to define a suffix to add to the key for the returned failure value when the problem is temporary. You might use it like this:

Kmailservers nis -T.Defer -o mailservers
...
R $* <@ $+ > $*                 $: $1<@$2>$3 <$(mailservers $2 $: Fail $)>
R $* <@ $+ > $* <$* . Defer>    $# error $@ 4.2.2 $: "450 defer"    handle failure here
R $* <@ $+ > $* <Fail>          $# error $@ 5.7.1 $: "550 reject"   handle failure here
R $* <@ $+ > $* <$+>            $# smtp $@ $4 $: $1 < @ $2 > $3 OK, so send it...

Note that a permanent failure returns the failure alternative indicated by the $: operator (the Fail). But a temporary failure returns the suffix defined by the -T, appended to the original key (the $2), to form $2.Defer.

Note that this definition of temporary failure is different from that defined by the -D database switch. With -D, database lookups are not done at all if the DeliveryMode option (DeliveryMode) is set to defer. Also note that this -T database switch affects only the return value. It does not affect the outcome of mail ...

Get Sendmail, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.