FEATURE: Better error message when incoming e-mail is missing a Date: header
This commit is contained in:
parent
499a83270a
commit
04ae3539d0
|
@ -573,6 +573,10 @@ module Email
|
||||||
|
|
||||||
# ensure posts aren't created in the future
|
# ensure posts aren't created in the future
|
||||||
options[:created_at] ||= @mail.date
|
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
|
options[:created_at] = DateTime.now if options[:created_at] > DateTime.now
|
||||||
|
|
||||||
is_private_message = options[:archetype] == Archetype.private_message ||
|
is_private_message = options[:archetype] == Archetype.private_message ||
|
||||||
|
|
Loading…
Reference in New Issue