1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) University of Cambridge 1995 - 2015 */
6 /* See the file NOTICE for conditions of use and distribution. */
8 /* Support functions for calling from local_scan(). These are mostly just
9 wrappers for various internal functions. */
15 /*************************************************
16 * Match a domain in a list *
17 *************************************************/
21 domain the domain we are testing
24 Returns: OK/FAIL/DEFER
28 lss_match_domain(uschar *domain, uschar *list)
30 return match_isinlist(CUS domain, CUSS &list, 0, &domainlist_anchor, NULL, MCL_DOMAIN,
36 /*************************************************
37 * Match a local part in a list *
38 *************************************************/
42 local_part the local part we are testing
43 list the local part list
44 caseless TRUE for caseless matching
46 Returns: OK/FAIL/DEFER
50 lss_match_local_part(uschar *local_part, uschar *list, BOOL caseless)
52 return match_isinlist(CUS local_part, CUSS &list, 0, &localpartlist_anchor, NULL,
53 MCL_LOCALPART, caseless, NULL);
58 /*************************************************
59 * Match an address in a list *
60 *************************************************/
64 address the address we are testing
66 caseless TRUE for caseless matching
68 Returns: OK/FAIL/DEFER
72 lss_match_address(uschar *address, uschar *list, BOOL caseless)
74 return match_address_list(CUS address, caseless, TRUE, CUSS &list, NULL, -1, 0, NULL);
79 /*************************************************
80 * Match a host in a list *
81 *************************************************/
85 host name the name of the host we are testing, or NULL if this is the
86 sender host and its name hasn't yet been looked up
87 host address the IP address of the host, or an empty string for a local
91 Returns: OK/FAIL/DEFER
92 ERROR if failed to find host name when needed
96 lss_match_host(uschar *host_name, uschar *host_address, uschar *list)
98 return verify_check_this_host(CUSS &list, NULL, host_name, host_address, NULL);
103 /*************************************************
104 * Base 64 encode/decode *
105 *************************************************/
107 /* These functions just give less "internal" names to the functions.
110 clear points to the clear text bytes
111 len the number of bytes to encode
113 Returns: a pointer to the zero-terminated base 64 string, which
118 lss_b64encode(uschar *clear, int len)
120 return b64encode(clear, len);
125 code points to the coded string, zero-terminated
126 ptr where to put the pointer to the result, which is in
129 Returns: the number of bytes in the result,
130 or -1 if the input was malformed
132 A zero is added on to the end to make it easy in cases where the result is to
133 be interpreted as text. This is not included in the count. */
136 lss_b64decode(uschar *code, uschar **ptr)
138 return b64decode(code, ptr);