aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-23 11:33:48 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-23 14:45:27 +0100
commit6d57fbfa112799366447775d5a52974e29bf887d (patch)
treeb022cdecf9cb27a39508cb9d6db43a016e8912ac /src
parent6832271dbc2771c7e3b2512fef2dcc054ab55c49 (diff)
downloadrspamd-6d57fbfa112799366447775d5a52974e29bf887d.tar.gz
rspamd-6d57fbfa112799366447775d5a52974e29bf887d.zip
[Feature] Add new representation of email address
Diffstat (limited to 'src')
-rw-r--r--src/libmime/email_addr.c64
-rw-r--r--src/libmime/email_addr.h64
-rw-r--r--src/libmime/parsers/smtp_addr_parser.c813
3 files changed, 941 insertions, 0 deletions
diff --git a/src/libmime/email_addr.c b/src/libmime/email_addr.c
new file mode 100644
index 000000000..afb92b183
--- /dev/null
+++ b/src/libmime/email_addr.c
@@ -0,0 +1,64 @@
+/*-
+ * Copyright 2016 Vsevolod Stakhov
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "config.h"
+#include "email_addr.h"
+#include "message.h"
+
+#include "./parsers/smtp_addr_parser.c"
+
+static void
+rspamd_email_addr_dtor (struct rspamd_email_address *addr)
+{
+ g_slice_free1 (sizeof (*addr), addr);
+}
+
+struct rspamd_email_address *
+rspamd_email_address_from_smtp (const gchar *str, guint len)
+{
+ struct rspamd_email_address addr, *ret;
+
+ if (str == NULL || len == 0) {
+ return NULL;
+ }
+
+ rspamd_smtp_addr_parse (str, len, &addr);
+
+ if (addr.flags & RSPAMD_EMAIL_ADDR_VALID) {
+ ret = g_slice_alloc (sizeof (*ret));
+ memcpy (ret, &addr, sizeof (addr));
+
+ REF_INIT_RETAIN (ret, rspamd_email_addr_dtor);
+
+ return ret;
+ }
+
+ return NULL;
+}
+
+struct rspamd_email_address *
+rspamd_email_address_ref (struct rspamd_email_address *addr)
+{
+ REF_RETAIN (addr);
+
+ return addr;
+}
+
+void
+rspamd_email_address_unref (struct rspamd_email_address *addr)
+{
+ REF_RELEASE (addr);
+}
diff --git a/src/libmime/email_addr.h b/src/libmime/email_addr.h
new file mode 100644
index 000000000..353692ff5
--- /dev/null
+++ b/src/libmime/email_addr.h
@@ -0,0 +1,64 @@
+/*-
+ * Copyright 2016 Vsevolod Stakhov
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef SRC_LIBMIME_EMAIL_ADDR_H_
+#define SRC_LIBMIME_EMAIL_ADDR_H_
+
+#include "config.h"
+#include "ref.h"
+
+struct raw_header;
+
+enum rspamd_email_address_flags {
+ RSPAMD_EMAIL_ADDR_VALID = (1 << 0),
+ RSPAMD_EMAIL_ADDR_IP = (1 << 1),
+ RSPAMD_EMAIL_ADDR_BRACED = (1 << 2),
+ RSPAMD_EMAIL_ADDR_QUOTED = (1 << 3),
+ RSPAMD_EMAIL_ADDR_EMPTY = (1 << 4),
+};
+
+/*
+ * Structure that represents email address in a convenient way
+ */
+struct rspamd_email_address {
+ const gchar *raw;
+ const gchar *addr;
+ const gchar *user;
+ const gchar *domain;
+
+ guint raw_len;
+ guint addr_len;
+ guint user_len;
+ guint domain_len;
+ enum rspamd_email_address_flags flags;
+
+ ref_entry_t ref;
+};
+
+/**
+ * Create email address from a single rfc822 address (e.g. from mail from:)
+ * @param str string to use
+ * @param len length of string
+ * @return
+ */
+struct rspamd_email_address * rspamd_email_address_from_smtp (
+ const gchar *str, guint len);
+
+struct rspamd_email_address * rspamd_email_address_ref (
+ struct rspamd_email_address *addr);
+
+void rspamd_email_address_unref (struct rspamd_email_address *addr);
+
+#endif /* SRC_LIBMIME_EMAIL_ADDR_H_ */
diff --git a/src/libmime/parsers/smtp_addr_parser.c b/src/libmime/parsers/smtp_addr_parser.c
new file mode 100644
index 000000000..df6239332
--- /dev/null
+++ b/src/libmime/parsers/smtp_addr_parser.c
@@ -0,0 +1,813 @@
+
+#line 1 "src/ragel/smtp_addr_parser.rl"
+
+#line 57 "src/ragel/smtp_addr_parser.rl"
+
+
+
+#line 9 "src/libmime/parsers/smtp_addr_parser.c"
+static const char _smtp_addr_parser_trans_keys[] = {
+ 0, 0, 9, 126, 33, 126, 33, 126, 48, 122, 48, 122, 48, 122, 48, 122,
+ 46, 122, 48, 57, 46, 57, 48, 57, 46, 57, 48, 57, 48, 93, 48, 93,
+ 93, 93, 46, 57, 46, 46, 46, 57, 46, 46, 46, 122, 46, 122, 48, 122,
+ 33, 126, 33, 126, 48, 122, 32, 126, 64, 64, 32, 126, 33, 126, 33, 126,
+ 33, 126, 48, 122, 46, 122, 48, 122, 48, 122, 48, 122, 46, 122, 48, 57,
+ 46, 57, 48, 57, 46, 57, 48, 57, 48, 93, 48, 93, 93, 93, 62, 62,
+ 46, 57, 46, 46, 46, 57, 46, 46, 46, 122, 46, 122, 48, 122, 33, 126,
+ 33, 126, 48, 122, 32, 126, 64, 64, 32, 126, 48, 122, 44, 122, 64, 64,
+ 33, 126, 48, 122, 48, 122, 44, 122, 64, 64, 33, 126, 48, 122, 9, 122,
+ 9, 32, 9, 32, 9, 32, 9, 32, 0
+};
+
+static const char _smtp_addr_parser_key_spans[] = {
+ 0, 118, 94, 94, 75, 75, 75, 75,
+ 77, 10, 12, 10, 12, 10, 46, 46,
+ 1, 12, 1, 12, 1, 77, 77, 75,
+ 94, 94, 75, 95, 1, 95, 94, 94,
+ 94, 75, 77, 75, 75, 75, 77, 10,
+ 12, 10, 12, 10, 46, 46, 1, 1,
+ 12, 1, 12, 1, 77, 77, 75, 94,
+ 94, 75, 95, 1, 95, 75, 79, 1,
+ 94, 75, 75, 79, 1, 94, 75, 114,
+ 24, 24, 24, 24
+};
+
+static const short _smtp_addr_parser_index_offsets[] = {
+ 0, 0, 119, 214, 309, 385, 461, 537,
+ 613, 691, 702, 715, 726, 739, 750, 797,
+ 844, 846, 859, 861, 874, 876, 954, 1032,
+ 1108, 1203, 1298, 1374, 1470, 1472, 1568, 1663,
+ 1758, 1853, 1929, 2007, 2083, 2159, 2235, 2313,
+ 2324, 2337, 2348, 2361, 2372, 2419, 2466, 2468,
+ 2470, 2483, 2485, 2498, 2500, 2578, 2656, 2732,
+ 2827, 2922, 2998, 3094, 3096, 3192, 3268, 3348,
+ 3350, 3445, 3521, 3597, 3677, 3679, 3774, 3850,
+ 3965, 3990, 4015, 4040
+};
+
+static const char _smtp_addr_parser_indicies[] = {
+ 0, 0, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 2, 3, 2, 2, 2, 2, 2,
+ 1, 1, 2, 2, 1, 1, 1, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 1, 1, 4, 2, 1, 2,
+ 5, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 1, 1, 1, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 1,
+ 6, 1, 6, 6, 6, 6, 6, 1,
+ 1, 6, 6, 1, 1, 7, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 1, 1, 1, 6, 1, 6, 8,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 1, 1, 1, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 1, 6,
+ 1, 6, 6, 6, 6, 6, 1, 1,
+ 6, 6, 1, 1, 1, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 1, 1, 1, 6, 1, 6, 1, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 1, 1, 1, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 1, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 1, 1, 1, 1, 1, 1, 1, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 10, 1, 1, 1, 1, 1, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 1, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 1, 1, 1, 1,
+ 1, 1, 1, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 1, 1, 1,
+ 1, 1, 1, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 1, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 1, 1, 1, 1, 1, 1, 1, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 1, 1, 1, 1, 12, 1, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 1, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 1, 1, 1, 1,
+ 1, 1, 1, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 1, 1, 1,
+ 1, 15, 1, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 1, 16, 1,
+ 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 18, 1, 1, 1, 1, 1,
+ 1, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 1, 1, 1, 1, 20,
+ 1, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 1, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 1, 22,
+ 1, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 1, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 1, 25,
+ 1, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 1, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 1, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 29, 1, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 29, 1, 29, 1, 25,
+ 1, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 1, 25, 1, 22, 1,
+ 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 1, 22, 1, 16, 1, 33,
+ 33, 33, 33, 33, 33, 33, 33, 33,
+ 33, 18, 1, 1, 1, 1, 1, 1,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 1, 1, 1, 1, 20, 1,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 1, 16, 1, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 18,
+ 1, 1, 1, 1, 1, 1, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 1, 1, 1, 1, 20, 1, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 1, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 18, 1, 1, 1, 1,
+ 1, 1, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 1, 1, 1, 1,
+ 20, 1, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 1, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 1,
+ 1, 1, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 1, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 1, 1,
+ 29, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 1, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 1, 1, 1,
+ 1, 1, 1, 1, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 1, 1,
+ 1, 1, 20, 1, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 1, 35,
+ 35, 36, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 37, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 1, 38,
+ 1, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
+ 1, 39, 40, 39, 39, 39, 39, 39,
+ 1, 1, 39, 39, 1, 1, 1, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 1, 1, 1, 39, 41, 39,
+ 42, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 1, 1, 1, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 1,
+ 43, 1, 43, 43, 43, 43, 43, 1,
+ 1, 43, 43, 1, 1, 44, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 1, 1, 1, 43, 1, 43, 45,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 1, 1, 1, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 1, 43,
+ 1, 43, 43, 43, 43, 43, 1, 1,
+ 43, 43, 1, 1, 1, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 1, 1, 1, 43, 1, 43, 1, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 1, 1, 1, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 1, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46,
+ 1, 1, 1, 1, 1, 1, 1, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 47, 1, 1, 1, 1, 1, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 1, 48, 1, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 1, 1,
+ 1, 1, 50, 1, 1, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 1,
+ 1, 1, 1, 51, 1, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 1,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 1, 1, 1, 1, 1, 1,
+ 1, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 1, 1, 1, 1, 1,
+ 1, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 1, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 1, 1,
+ 1, 1, 1, 1, 1, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 1,
+ 1, 1, 1, 51, 1, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 1,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 1, 1, 1, 1, 1, 1,
+ 1, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 1, 1, 1, 1, 54,
+ 1, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 1, 55, 1, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56,
+ 57, 1, 1, 1, 1, 1, 1, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 1, 1, 1, 1, 59, 1, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 1, 60, 60, 60, 60, 60, 60,
+ 60, 60, 60, 60, 1, 61, 1, 62,
+ 62, 62, 62, 62, 62, 62, 62, 62,
+ 62, 1, 63, 63, 63, 63, 63, 63,
+ 63, 63, 63, 63, 1, 64, 1, 65,
+ 65, 65, 65, 65, 65, 65, 65, 65,
+ 65, 1, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 1, 67, 67, 67,
+ 67, 67, 67, 67, 67, 67, 67, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 68, 1, 69, 69, 69, 69,
+ 69, 69, 69, 69, 69, 69, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 68, 1, 68, 1, 70, 1, 64,
+ 1, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 1, 64, 1, 61, 1,
+ 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 1, 61, 1, 55, 1, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 57, 1, 1, 1, 1, 1, 1,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 1, 1, 1, 1, 59, 1,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 1, 55, 1, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 57,
+ 1, 1, 1, 1, 1, 1, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 1, 1, 1, 1, 59, 1, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 1, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 57, 1, 1, 1, 1,
+ 1, 1, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 1, 1, 1, 1,
+ 59, 1, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 1, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 1,
+ 1, 1, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 1, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 1, 1,
+ 68, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 1, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 1, 1, 1,
+ 1, 1, 1, 1, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 1, 1,
+ 1, 1, 59, 1, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 1, 75,
+ 75, 76, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 77, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 1, 78,
+ 1, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 1, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 1, 1, 1, 1, 1,
+ 1, 1, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 1, 1, 1, 1,
+ 1, 1, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 1, 80, 1, 42,
+ 1, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 81, 1, 1, 1, 1,
+ 1, 1, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 1, 1, 1, 1,
+ 82, 1, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 1, 42, 1, 39,
+ 40, 39, 39, 39, 39, 39, 1, 1,
+ 39, 39, 1, 1, 1, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 1, 1, 1, 39, 1, 39, 1, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 1, 1, 1, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 1, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 1, 1, 1, 1, 1, 1, 1, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 1, 1, 1, 1, 82, 1, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 1, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 1, 1, 1, 1,
+ 1, 1, 1, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 1, 1, 1,
+ 1, 1, 1, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 1, 84, 1,
+ 5, 1, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 85, 1, 1, 1,
+ 1, 1, 1, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 1, 1, 1,
+ 1, 86, 1, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 1, 5, 1,
+ 2, 3, 2, 2, 2, 2, 2, 1,
+ 1, 2, 2, 1, 1, 1, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 1, 1, 1, 2, 1, 2, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 1, 1, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 1, 1, 1, 1, 1, 1, 1,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 1, 1, 1, 1, 86, 1,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 1, 87, 87, 87, 87, 87,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 87, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 88, 1, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 1, 1, 1, 1,
+ 1, 1, 1, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 1, 1, 1,
+ 1, 12, 1, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 1, 89, 89,
+ 89, 89, 89, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 89, 1, 90,
+ 90, 90, 90, 90, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 90, 1,
+ 91, 91, 91, 91, 91, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 91,
+ 1, 92, 92, 92, 92, 92, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 92, 1, 0
+};
+
+static const char _smtp_addr_parser_trans_targs[] = {
+ 1, 0, 2, 27, 30, 66, 2, 3,
+ 4, 71, 7, 71, 6, 8, 23, 26,
+ 9, 21, 24, 23, 26, 10, 11, 19,
+ 12, 13, 17, 14, 15, 73, 16, 18,
+ 20, 22, 25, 27, 28, 29, 4, 31,
+ 58, 75, 61, 31, 32, 33, 34, 37,
+ 35, 34, 74, 36, 38, 54, 57, 39,
+ 52, 55, 54, 57, 40, 41, 50, 42,
+ 43, 48, 44, 45, 47, 46, 74, 49,
+ 51, 53, 56, 58, 59, 60, 33, 62,
+ 63, 64, 65, 67, 68, 69, 70, 72,
+ 5, 72, 72, 72, 72
+};
+
+static const char _smtp_addr_parser_trans_actions[] = {
+ 0, 0, 1, 1, 0, 0, 0, 0,
+ 2, 3, 0, 0, 0, 4, 4, 4,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 5, 0, 0,
+ 0, 0, 0, 0, 0, 0, 6, 1,
+ 1, 0, 0, 0, 0, 2, 3, 0,
+ 0, 0, 7, 0, 4, 4, 4, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 6, 0,
+ 0, 0, 0, 0, 0, 0, 0, 8,
+ 0, 0, 9, 10, 11
+};
+
+static const char _smtp_addr_parser_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 8,
+ 0, 9, 10, 11
+};
+
+static const int smtp_addr_parser_start = 1;
+static const int smtp_addr_parser_first_final = 71;
+static const int smtp_addr_parser_error = 0;
+
+static const int smtp_addr_parser_en_main = 1;
+
+
+#line 60 "src/ragel/smtp_addr_parser.rl"
+
+static int
+rspamd_smtp_addr_parse (const char *data, size_t len, struct rspamd_email_address *addr)
+{
+ const char *p = data, *pe = data + len, *eof;
+ int cs;
+
+ g_assert (addr != NULL);
+ memset (addr, 0, sizeof (*addr));
+ addr->raw = data;
+ addr->raw_len = len;
+ eof = pe;
+
+
+#line 626 "src/libmime/parsers/smtp_addr_parser.c"
+ {
+ cs = smtp_addr_parser_start;
+ }
+
+#line 74 "src/ragel/smtp_addr_parser.rl"
+
+#line 633 "src/libmime/parsers/smtp_addr_parser.c"
+ {
+ int _slen;
+ int _trans;
+ const char *_keys;
+ const char *_inds;
+ if ( p == pe )
+ goto _test_eof;
+ if ( cs == 0 )
+ goto _out;
+_resume:
+ _keys = _smtp_addr_parser_trans_keys + (cs<<1);
+ _inds = _smtp_addr_parser_indicies + _smtp_addr_parser_index_offsets[cs];
+
+ _slen = _smtp_addr_parser_key_spans[cs];
+ _trans = _inds[ _slen > 0 && _keys[0] <=(*p) &&
+ (*p) <= _keys[1] ?
+ (*p) - _keys[0] : _slen ];
+
+ cs = _smtp_addr_parser_trans_targs[_trans];
+
+ if ( _smtp_addr_parser_trans_actions[_trans] == 0 )
+ goto _again;
+
+ switch ( _smtp_addr_parser_trans_actions[_trans] ) {
+ case 1:
+#line 5 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->user = p;
+ addr->addr = p;
+ }
+ break;
+ case 2:
+#line 10 "src/ragel/smtp_addr_parser.rl"
+ {
+ if (addr->user) {
+ addr->user_len = p - addr->user;
+ }
+ }
+ break;
+ case 3:
+#line 16 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->domain = p;
+ }
+ break;
+ case 7:
+#line 20 "src/ragel/smtp_addr_parser.rl"
+ {
+ if (addr->domain) {
+ addr->domain_len = p - addr->domain;
+ }
+ }
+ break;
+ case 4:
+#line 26 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->domain = p;
+ addr->flags |= RSPAMD_EMAIL_ADDR_IP;
+ }
+ break;
+ case 5:
+#line 31 "src/ragel/smtp_addr_parser.rl"
+ {
+ if (addr->domain) {
+ addr->domain_len = p - addr->domain;
+ }
+ }
+ break;
+ case 9:
+#line 46 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_VALID;
+ }
+ break;
+ case 8:
+#line 20 "src/ragel/smtp_addr_parser.rl"
+ {
+ if (addr->domain) {
+ addr->domain_len = p - addr->domain;
+ }
+ }
+#line 46 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_VALID;
+ }
+ break;
+ case 6:
+#line 37 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_QUOTED;
+ }
+#line 10 "src/ragel/smtp_addr_parser.rl"
+ {
+ if (addr->user) {
+ addr->user_len = p - addr->user;
+ }
+ }
+ break;
+ case 11:
+#line 41 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_EMPTY;
+ addr->addr = "";
+ }
+#line 46 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_VALID;
+ }
+ break;
+ case 10:
+#line 50 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_BRACED;
+ }
+#line 46 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_VALID;
+ }
+ break;
+#line 753 "src/libmime/parsers/smtp_addr_parser.c"
+ }
+
+_again:
+ if ( cs == 0 )
+ goto _out;
+ if ( ++p != pe )
+ goto _resume;
+ _test_eof: {}
+ if ( p == eof )
+ {
+ switch ( _smtp_addr_parser_eof_actions[cs] ) {
+ case 9:
+#line 46 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_VALID;
+ }
+ break;
+ case 8:
+#line 20 "src/ragel/smtp_addr_parser.rl"
+ {
+ if (addr->domain) {
+ addr->domain_len = p - addr->domain;
+ }
+ }
+#line 46 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_VALID;
+ }
+ break;
+ case 11:
+#line 41 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_EMPTY;
+ addr->addr = "";
+ }
+#line 46 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_VALID;
+ }
+ break;
+ case 10:
+#line 50 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_BRACED;
+ }
+#line 46 "src/ragel/smtp_addr_parser.rl"
+ {
+ addr->flags |= RSPAMD_EMAIL_ADDR_VALID;
+ }
+ break;
+#line 804 "src/libmime/parsers/smtp_addr_parser.c"
+ }
+ }
+
+ _out: {}
+ }
+
+#line 75 "src/ragel/smtp_addr_parser.rl"
+
+ return cs;
+}