From 04ae3539d05432b83c6e1a233a39605e83b223cf Mon Sep 17 00:00:00 2001 From: Matt Palmer Date: Fri, 13 Jan 2017 11:05:00 +1100 Subject: [PATCH] FEATURE: Better error message when incoming e-mail is missing a Date: header --- lib/email/receiver.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/email/receiver.rb b/lib/email/receiver.rb index 3acdafe96fd..843a64d55ea 100644 --- a/lib/email/receiver.rb +++ b/lib/email/receiver.rb @@ -573,6 +573,10 @@ module Email # ensure posts aren't created in the future options[:created_at] ||= @mail.date + if options[:created_at].nil? + raise InvalidPost, "No post creation date found. Is the e-mail missing a Date: header?" + end + options[:created_at] = DateTime.now if options[:created_at] > DateTime.now is_private_message = options[:archetype] == Archetype.private_message ||