aboutsummaryrefslogtreecommitdiffstats
path: root/src/ragel/smtp_whitespace.rl
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-14 16:36:20 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-14 16:36:20 +0100
commit7e6126e0169e6397d1e9e989433f590398d20fd8 (patch)
tree691986e20bf64a560ce19be6ee77eca154c22189 /src/ragel/smtp_whitespace.rl
parente1955662ec5a6d1b3b6b3d939d7d9be9346aa87d (diff)
downloadrspamd-7e6126e0169e6397d1e9e989433f590398d20fd8.tar.gz
rspamd-7e6126e0169e6397d1e9e989433f590398d20fd8.zip
[Feature] Implement ragel parser for received headers
Diffstat (limited to 'src/ragel/smtp_whitespace.rl')
-rw-r--r--src/ragel/smtp_whitespace.rl30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ragel/smtp_whitespace.rl b/src/ragel/smtp_whitespace.rl
new file mode 100644
index 000000000..5bac17a4e
--- /dev/null
+++ b/src/ragel/smtp_whitespace.rl
@@ -0,0 +1,30 @@
+%%{
+ machine smtp_whitespace;
+
+ WSP = " ";
+ CRLF = "\r\n" | ("\r" [^\n]) | ([^\r] "\n");
+ DQUOTE = '"';
+
+ # Printable US-ASCII characters not including specials
+ atext = alpha | digit | "!" | "#" | "$" | "%" | "&" |
+ "'" | "*" | "+" | "_" | "/" | "=" | "?" | "^" |
+ "-" | "`" | "{" | "|" | "}" | "~";
+ # Printable US-ASCII characters not including "[", "]", or "\"
+ dtext = 33..90 | 94..126;
+ # Printable US-ASCII characters not including "(", ")", or "\"
+ ctext = 33..39 | 42..91 | 93..126;
+
+ dcontent = 33..90 | 94..126;
+ Let_dig = alpha | digit;
+ Ldh_str = ( alpha | digit | "_" | "-" )* Let_dig;
+
+ quoted_pairSMTP = "\\" 32..126;
+ qtextSMTP = 32..33 | 35..91 | 93..126;
+ Atom = atext+;
+ Dot_string = Atom ("." Atom)*;
+ dot_atom_text = atext+ ("." atext+)*;
+ FWS = ((WSP* CRLF)? WSP+);
+
+ comment = "(" (FWS? ctext)* FWS? ")";
+ CFWS = ((FWS? comment)+ FWS?) | FWS;
+}%% \ No newline at end of file