Prev | Current Page 1661 | Next

Bryan Costales, Claus Assmann, George Jansen, Gregory Shapiro

"sendmail, 4th Edition"

All rights reserved.
946 | Chapter 23: The K (Database-Map) Configuration Command
Here, there are seven fields, each separated from the others by colon characters. The key is
always compared to the first field. The value returned is (by default) the first field unless
you specify another field with a -v switch:
Kname user -vfield
Here, field can be either a number 1 through 7, or one of the names name, passwd, uid, gid,
gecos, dir, or shell, which correspond to the numbers. For example, to look up usernames
and get the full name (GECOS) field returned, you could use something such as this:
Kgetgecos user -vgecos
...
R$- $: $( getgecos $1 $)
Note that this returns the full GECOS field in its rawest form. It is not cleaned up to
provide a reliable full name, as is the $x macro (?§21.9.103 on page 851).
The user database-map type can be used in conjunction withth e Local_check_rcpt rule set
(?§7.1.3 on page 257). In the following, for example, we check to see whether a recipient is a
local user and, if so, reject the user if that user??™s home directory is /home/retired/tars:
Kislocal user -vdir
SLocal_check_rcpt
R$* $: $>canonify $1 focus on host
R$* <@ $+ > $* $: $1 discard host
R$+ $: $1 $(islocal $1 $)
R$- /home/retired/tars $#error $@ 5.1.3 $: 553 Sorry, $1 is retired, no
forwarding
Here, we focus on the host part with the canonify rule set 3, and then discard all but the
user part in the second rule.


Pages:
1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673
przeszycia łódź tłumacz niemieckiego opony przemysłowe Apartamenty Novalja Wczasy nad morzem