FEATURE: Better error message when incoming e-mail is missing a Date: header

This commit is contained in:
Matt Palmer 2017-01-13 11:05:00 +11:00
parent 499a83270a
commit 04ae3539d0
1 changed files with 4 additions and 0 deletions

View File

@ -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 ||