mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FEATURE: Better error message when incoming e-mail is missing a Date: header
This commit is contained in:
parent
499a83270a
commit
04ae3539d0
1 changed files with 4 additions and 0 deletions
|
@ -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 ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue