From 19a9aaf3deb0bcac14e3ef2c9a3960731da05bda Mon Sep 17 00:00:00 2001 From: Mauro Iazzi Date: Tue, 14 Apr 2009 10:33:22 +0200 Subject: [PATCH] fixed and finished section 3.6.4 + msg-id tests --- mime.lua | 5 +++-- test.lua | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mime.lua b/mime.lua index 136a1f4..cf50326 100644 --- a/mime.lua +++ b/mime.lua @@ -303,9 +303,10 @@ local fields = function () ["bcc"] = P"Bcc:" * (V"address-list" + V"CFWS") * V"CRLF", -- RFC 2822 Section 3.6.3 ["message-id"] = P"Message-Id:" * V"msg-id" * V"CRLF", -- RFC 2822 Section 3.6.4 ["in-reply-to"] = P"In-Reply-To:" * V"msg-id"^1 * V"CRLF", -- RFC 2822 Section 3.6.4 + ["references"] = P"References:" * V"msg-id"^1 * V"CRLF", -- RFC 2822 Section 3.6.4 ["msg-id"] = V"CFWS"^-1 * P"<" * V"id-left" * P"@" * V"id-right" * P">" * V"CFWS"^-1, -- RFC 2822 Section 3.6.4 - ["id-left"] = V"dot-atom-text" + V"no-fold-quote" * V"obs-id-left", -- RFC 2822 Section 3.6.4 - ["id-right"] = V"dot-atom-text" + V"no-fold-literal" * V"obs-id-right", -- RFC 2822 Section 3.6.4 + ["id-left"] = V"dot-atom-text" + V"no-fold-quote" + V"obs-id-left", -- RFC 2822 Section 3.6.4 + ["id-right"] = V"dot-atom-text" + V"no-fold-literal" + V"obs-id-right", -- RFC 2822 Section 3.6.4 ["no-fold-quote"] = P"\"" * (V"qtext" + V"quoted-pair")^0 * P"\"", -- RFC 2822 Section 3.6.4 ["no-fold-literal"] = P"[" * (V"dtext" + V"quoted-pair")^0 * P"]", -- RFC 2822 Section 3.6.4 } diff --git a/test.lua b/test.lua index 2bb6487..7d6257f 100644 --- a/test.lua +++ b/test.lua @@ -25,6 +25,8 @@ local tests = { { string = '(a CFWS) \r\n (that ends here)[ 127.0.0.1:8888 oooo]', rule ='domain-literal', match = true, }, { string = 'mauro.iazzi@gmail.com', rule ='address', match = true, }, { string = '"Mauro Iazzi" ', rule ='address', match = true, }, + { string = '', rule ='msg-id', match = true, }, + { string = '<"sent\\ by\\ \\"M.I.\\"mauro.iazzi"@[from\\ domain\\ gmail.com]>', rule ='msg-id', match = true, }, } local dee = function (...) -- 2.11.4.GIT