Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
a5be4691
...
a5be4691fe917aa6dba90d6dc95934950c4a43a0
authored
2002-11-14 14:50:12 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Implemented header test.
1 parent
3c6c04c6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
13 deletions
libsieve/tests.c
libsieve/tests.c
View file @
a5be469
...
...
@@ -25,17 +25,6 @@
#include <string.h>
#include <sieve.h>
#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
int
sieve_test_address
(
sieve_machine_t
mach
,
list_t
args
,
list_t
tags
)
{
...
...
@@ -43,9 +32,37 @@ sieve_test_address (sieve_machine_t mach, list_t args, list_t tags)
}
int
retrieve_header
(
void
*
item
,
void
*
data
,
char
**
pval
)
{
return
header_aget_value
((
header_t
)
data
,
(
char
*
)
item
,
pval
);
}
int
sieve_test_header
(
sieve_machine_t
mach
,
list_t
args
,
list_t
tags
)
{
return
0
;
sieve_value_t
*
h
,
*
v
;
header_t
header
=
NULL
;
sieve_comparator_t
comp
=
sieve_get_comparator
(
tags
);
if
(
mach
->
debug_level
&
MU_SIEVE_DEBUG_TRACE
)
sieve_debug
(
mach
,
"HEADER
\n
"
);
h
=
sieve_value_get
(
args
,
0
);
if
(
!
h
)
{
sieve_error
(
mach
,
"header: can't get argument 1"
);
sieve_abort
(
mach
);
}
v
=
sieve_value_get
(
args
,
1
);
if
(
!
v
)
{
sieve_error
(
mach
,
"header: can't get argument 2"
);
sieve_abort
(
mach
);
}
message_get_header
(
sieve_get_message
(
mach
),
&
header
);
return
sieve_vlist_compare
(
h
,
v
,
comp
,
retrieve_header
,
header
);
}
int
...
...
@@ -122,7 +139,7 @@ sieve_test_exists (sieve_machine_t mach, list_t args, list_t tags)
sieve_abort
(
mach
);
}
return
list_do
(
val
->
v
.
list
,
_test_exists
,
header
)
==
0
;
return
sieve_vlist_do
(
val
,
_test_exists
,
header
)
==
0
;
}
#define ADDRESS_PART \
...
...
Please
register
or
sign in
to post a comment