Skip to content
Snippets Groups Projects
Commit d59421e5 authored by Stephan Bosch's avatar Stephan Bosch
Browse files

Added support for header verification.

parent 979b0e8e
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,7 @@ libsieve_la_DEPENDENCIES = $(plugins)
libsieve_la_LIBADD = $(plugins)
libsieve_la_SOURCES = \
rfc2822.c \
sieve-limits.c \
sieve-message.c \
sieve-lexer.c \
......@@ -95,6 +96,7 @@ libsieve_la_SOURCES = \
sieve.c
noinst_HEADERS = \
rfc2822.h \
sieve-config.h \
sieve-types.h \
sieve-common.h \
......
/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file
*/
#include "lib.h"
#include "rfc2822.h"
/* NOTE: much of the functionality implemented here should eventually appear
* somewhere in Dovecot itself.
*/
bool rfc2822_header_field_name_verify
(const char *field_name, unsigned int len)
{
const char *p = field_name;
const char *pend = p + len;
/* field-name = 1*ftext
* ftext = %d33-57 / ; Any character except
* %d59-126 ; controls, SP, and
* ; ":".
*/
while ( p < pend ) {
if ( *p < 33 || *p == ':' )
return FALSE;
}
return TRUE;
}
/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file
*/
#ifndef __RFC2822_H
#define __RFC2822_H
bool rfc2822_header_field_name_verify
(const char *field_name, unsigned int len);
#endif /* __RFC2822_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.