/*++ /* NAME /* mail_addr_find 3 /* SUMMARY /* generic address-based lookup /* SYNOPSIS /* #include <mail_addr_find.h> /* /* const char *mail_addr_find_int_to_ext(maps, address, extension) /* MAPS *maps; /* const char *address; /* char **extension; /* /* const char *mail_addr_find_opt(maps, address, extension, in_form, /* query_form, out_form, strategy) /* MAPS *maps; /* const char *address; /* char **extension; /* int in_form; /* int in_form; /* int out_form; /* int strategy; /* LEGACY SUPPORT /* const char *mail_addr_find(maps, address, extension) /* MAPS *maps; /* const char *address; /* char **extension; /* /* const char *mail_addr_find_to_internal(maps, address, extension) /* MAPS *maps; /* const char *address; /* char **extension; /* /* const char *mail_addr_find_strategy(maps, address, extension) /* MAPS *maps; /* const char *address; /* char **extension; /* int strategy; /* DESCRIPTION /* mail_addr_find*() searches the specified maps for an entry with as /* key the specified address, and derivations from that address. /* It is up to the caller to specify its case sensitivity /* preferences when it opens the maps. /* The result is overwritten upon each call. /* /* In the lookup table, the key is expected to be in external /* form (as produced with the postmap command) and the value is /* expected to be in external (quoted) form if it is an email /* address. Override these assumptions with the query_form /* and out_form arguments. /* /* With mail_addr_find_int_to_ext(), the specified address is in /* internal (unquoted) form, the query is made in external (quoted) /* form, and the result is in the form found in the table (it is /* not necessarily an email address). This version minimizes /* internal/external (unquoted/quoted) conversions of the input, /* query, extension, or result. /* /* mail_addr_find_opt() gives more control, at the cost of /* additional conversions between internal and external forms. /* In particular, output conversion to internal form assumes /* that the lookup result is an email address. /* /* mail_addr_find() is used by legacy code that historically searched /* with internal-form queries. The input is in internal form. It /* searches with external-form queries first, and falls back to /* internal-form queries if no result was found and the external /* and internal forms differ. The result is external form (i.e. no /* conversion). /* /* mail_addr_find_to_internal() is like mail_addr_find() but assumes /* that the lookup result is one external-form email address, /* and converts it to internal form. /* /* mail_addr_find_strategy() is like mail_addr_find() but overrides /* the default search strategy for full and partial addresses. /* /* Arguments: /* .IP maps /* Dictionary search path (see maps(3)). /* .IP address /* The address to be looked up. /* .IP extension /* A null pointer, or the address of a pointer that is set to /* the address of a dynamic memory copy of the address extension /* that had to be chopped off in order to match the lookup tables. /* The copy includes the recipient address delimiter. /* The copy is in internal (unquoted) form. /* The caller is expected to pass the copy to myfree(). /* .IP query_form /* The address form to use for database queries: one of /* MA_FORM_INTERNAL (unquoted form), MA_FORM_EXTERNAL (quoted form), /* MA_FORM_EXTERNAL_FIRST (external form, then internal form if the /* external and internal forms differ), or MA_FORM_INTERNAL_FIRST /* (internal form, then external form if the internal and external /* forms differ). /* .IP in_form /* .IP out_form /* Input and output address forms, one of MA_FORM_INTERNAL (unquoted /* form), or MA_FORM_EXTERNAL (quoted form). /* .IP strategy /* The lookup strategy for full and partial addresses, specified /* as the binary OR of one or more of the following. These lookups /* are implemented in the order as listed below. /* .RS /* .IP MA_FIND_DEFAULT /* A convenience alias for (MA_FIND_FULL | /* MA_FIND_NOEXT | MA_FIND_LOCALPART_IF_LOCAL | /* MA_FIND_AT_DOMAIN). /* .IP MA_FIND_FULL /* Look up the full email address. /* .IP MA_FIND_NOEXT /* If no match was found, and the address has a localpart extension, /* look up the address after removing the extension. /* .IP MA_FIND_LOCALPART_IF_LOCAL /* If no match was found, and the domain matches myorigin, /* mydestination, or any inet_interfaces or proxy_interfaces IP /* address, look up the localpart. If no match was found, and the /* address has a localpart extension, repeat the same query after /* removing the extension unless MA_FIND_NOEXT is specified. /* .IP MA_FIND_LOCALPART_AT_IF_LOCAL /* As above, but using the localpart@ instead. /* .IP MA_FIND_AT_DOMAIN /* If no match was found, look up the @domain without localpart. /* .IP MA_FIND_DOMAIN /* If no match was found, look up the domain without localpart. /* .IP MA_FIND_PDMS /* When used with MA_FIND_DOMAIN, the domain also matches subdomains. /* .IP MA_FIND_PDDMDS /* When used with MA_FIND_DOMAIN, dot-domain also matches /* dot-subdomains. /* .IP MA_FIND_LOCALPART_AT /* If no match was found, look up the localpart@, regardless of /* the domain content. /* .RE /* DIAGNOSTICS /* The maps->error value is non-zero when the lookup failed due to /* a non-permanent error. /* SEE ALSO /* maps(3), multi-dictionary search resolve_local(3), recognize /* local system /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /* /* Wietse Venema /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA
/*--*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.