Merge pull request #4648 from mpalmer/date-header-check

FEATURE: Better error message when incoming e-mail is missing a Date: header
This commit is contained in:
Matt Palmer 2017-01-13 20:05:07 +11:00 committed by GitHub
commit ae560f343c
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 ||