25 |
#include <string.h> |
#include <string.h> |
26 |
#include <sieve.h> |
#include <sieve.h> |
27 |
|
|
|
#define TAG_LOCALPART 0 |
|
|
#define TAG_DOMAIN 1 |
|
|
#define TAG_ALL 2 |
|
|
#define TAG_COMPARATOR 3 |
|
|
#define TAG_IS 4 |
|
|
#define TAG_CONTAINS 5 |
|
|
#define TAG_MATCHES 6 |
|
|
#define TAG_REGEX 7 |
|
|
#define TAG_UNDER 8 |
|
|
#define TAG_OVER 9 |
|
|
|
|
28 |
int |
int |
29 |
sieve_test_address (sieve_machine_t mach, list_t args, list_t tags) |
sieve_test_address (sieve_machine_t mach, list_t args, list_t tags) |
30 |
{ |
{ |
32 |
} |
} |
33 |
|
|
34 |
int |
int |
35 |
|
retrieve_header (void *item, void *data, char **pval) |
36 |
|
{ |
37 |
|
return header_aget_value ((header_t) data, (char*)item, pval); |
38 |
|
} |
39 |
|
|
40 |
|
int |
41 |
sieve_test_header (sieve_machine_t mach, list_t args, list_t tags) |
sieve_test_header (sieve_machine_t mach, list_t args, list_t tags) |
42 |
{ |
{ |
43 |
return 0; |
sieve_value_t *h, *v; |
44 |
|
header_t header = NULL; |
45 |
|
sieve_comparator_t comp = sieve_get_comparator (tags); |
46 |
|
|
47 |
|
if (mach->debug_level & MU_SIEVE_DEBUG_TRACE) |
48 |
|
sieve_debug (mach, "HEADER\n"); |
49 |
|
|
50 |
|
h = sieve_value_get (args, 0); |
51 |
|
if (!h) |
52 |
|
{ |
53 |
|
sieve_error (mach, "header: can't get argument 1"); |
54 |
|
sieve_abort (mach); |
55 |
|
} |
56 |
|
v = sieve_value_get (args, 1); |
57 |
|
if (!v) |
58 |
|
{ |
59 |
|
sieve_error (mach, "header: can't get argument 2"); |
60 |
|
sieve_abort (mach); |
61 |
|
} |
62 |
|
|
63 |
|
message_get_header (sieve_get_message (mach), &header); |
64 |
|
|
65 |
|
return sieve_vlist_compare (h, v, comp, retrieve_header, header); |
66 |
} |
} |
67 |
|
|
68 |
int |
int |
139 |
sieve_abort (mach); |
sieve_abort (mach); |
140 |
} |
} |
141 |
|
|
142 |
return list_do (val->v.list, _test_exists, header) == 0; |
return sieve_vlist_do (val, _test_exists, header) == 0; |
143 |
} |
} |
144 |
|
|
145 |
#define ADDRESS_PART \ |
#define ADDRESS_PART \ |