summaryrefslogtreecommitdiffstats
path: root/src/ragel/smtp_address.rl
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-02-05 16:00:06 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-02-05 16:00:06 +0000
commitb8ccacc1744d1c0385449c3c9996f2fcfecfb8d8 (patch)
tree197fc36c95113b693c429df7b96c986fb17247ff /src/ragel/smtp_address.rl
parented7ecf0d80246dc047676cfeb5f1726c678eb01b (diff)
downloadrspamd-b8ccacc1744d1c0385449c3c9996f2fcfecfb8d8.tar.gz
rspamd-b8ccacc1744d1c0385449c3c9996f2fcfecfb8d8.zip
[Project] Rework ragel machines
Diffstat (limited to 'src/ragel/smtp_address.rl')
-rw-r--r--src/ragel/smtp_address.rl37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/ragel/smtp_address.rl b/src/ragel/smtp_address.rl
index f5d04f620..3f03d405b 100644
--- a/src/ragel/smtp_address.rl
+++ b/src/ragel/smtp_address.rl
@@ -2,6 +2,27 @@
machine smtp_address;
# SMTP address spec
+ # Source: https://tools.ietf.org/html/rfc5321#section-4.1.2
+ # Dependencies: smtp_base + smtp_ip
+ # Required actions:
+ # - User_has_backslash
+ # - User_end
+ # - Quoted_addr
+ # - Domain_start
+ # - Domain_end
+ # - Addr_end
+ # - Addr_has_angle
+ # - Valid_addr
+ # - Empty_addr
+ # + from deps:
+ # - IP4_start
+ # - IP4_end
+ # - IP6_start
+ # - IP6_end
+ # - Domain_addr_start
+ # - Domain_addr_end
+
+ # SMTP address spec
# Obtained from: https://tools.ietf.org/html/rfc5321#section-4.1.2
QcontentSMTP = qtextSMTP | quoted_pairSMTP %User_has_backslash;
@@ -9,23 +30,9 @@
Local_part = Dot_string >User_start %User_end | Quoted_string;
String = Atom | Quoted_string;
- Standardized_tag = Ldh_str;
- General_address_literal = Standardized_tag ":" dcontent+;
- address_literal = "[" ( IPv4_address_literal |
- IPv6_address_literal |
- General_address_literal ) >Domain_addr_start %Domain_addr_end "]";
- non_conformant_address_literal = IPv4_address_literal >Domain_addr_start %Domain_addr_end;
-
-
- sub_domain = Let_dig Ldh_str?;
- Domain = sub_domain ("." sub_domain)*;
- Atdomain = "@" Domain;
- Adl = Atdomain ( "," Atdomain )*;
-
Mailbox = Local_part "@" (address_literal | Domain >Domain_start %Domain_end);
- UnangledPath = ( Adl ":" )? Mailbox >Addr_start %Addr_end "."?;
+ UnangledPath = ( Adl ":" )? Mailbox >Domain_start %Addr_end "."?;
AngledPath = "<" UnangledPath ">" %Addr_has_angle;
Path = AngledPath | UnangledPath;
SMTPAddr = space* (Path | "<>" %Empty_addr ) %Valid_addr space*;
-
}%%