Postfix3.3.1
match_parent_style.c
[詳解]
1 /*++
2 /* NAME
3 /* match_parent_style 3
4 /* SUMMARY
5 /* parent domain matching control
6 /* SYNOPSIS
7 /* #include <match_parent_style.h>
8 /*
9 /* int match_parent_style(name)
10 /* const char *name;
11 /* DESCRIPTION
12 /* This module queries configuration parameters for the policy that
13 /* controls how wild-card parent domain names are used by various
14 /* postfix lookup mechanisms.
15 /*
16 /* match_parent_style() looks up "name" in the
17 /* parent_domain_matches_subdomain configuration parameter
18 /* and returns either MATCH_FLAG_PARENT (parent domain matches
19 /* subdomains) or MATCH_FLAG_NONE.
20 /* DIAGNOSTICS
21 /* Fatal error: out of memory, name listed under both parent wild card
22 /* matching policies.
23 /* SEE ALSO
24 /* string_list(3) plain string matching
25 /* domain_list(3) match host name patterns
26 /* namadr_list(3) match host name/address patterns
27 /* LICENSE
28 /* .ad
29 /* .fi
30 /* The Secure Mailer license must be distributed with this software.
31 /* AUTHOR(S)
32 /* Wietse Venema
33 /* IBM T.J. Watson Research
34 /* P.O. Box 704
35 /* Yorktown Heights, NY 10598, USA
36 /*--*/
37 
38 /* System library. */
39 
40 #include <sys_defs.h>
41 
42 /* Utility library. */
43 
44 /* Global library. */
45 
46 #include <string_list.h>
47 #include <mail_params.h>
48 #include <match_parent_style.h>
49 
50 /* Application-specific. */
51 
52 static STRING_LIST *match_par_dom_list;
53 
54 int match_parent_style(const char *name)
55 {
56  int result;
57 
58  /*
59  * Initialize on the fly.
60  */
61  if (match_par_dom_list == 0)
62  match_par_dom_list =
65 
66  /*
67  * Look up the parent domain matching policy.
68  */
69  if (string_list_match(match_par_dom_list, name))
70  result = MATCH_FLAG_PARENT;
71  else
72  result = 0;
73  return (result);
74 }
int match_parent_style(const char *name)
#define STRING_LIST
Definition: string_list.h:22
#define string_list_init(o, f, p)
Definition: string_list.h:24
#define string_list_match
Definition: string_list.h:26
#define MATCH_FLAG_PARENT
Definition: match_list.h:39
#define VAR_PAR_DOM_MATCH
Definition: mail_params.h:2638
char * var_par_dom_match
Definition: mail_params.c:292
#define MATCH_FLAG_NONE
Definition: match_list.h:38