Throw a SMTP exception when the body is blank in a received message
This commit is contained in:
parent
7f375baf49
commit
42e0ce86a8
1 changed files with 4 additions and 0 deletions
|
@ -35,6 +35,10 @@ class MessagesMailReceiver
|
||||||
body.encode!(Encoding::default_internal)
|
body.encode!(Encoding::default_internal)
|
||||||
body = EmailReplyTrimmer.trim(body)
|
body = EmailReplyTrimmer.trim(body)
|
||||||
|
|
||||||
|
if body.empty?
|
||||||
|
raise MidiSmtpServer::SmtpdException(nil, 541, "The recipient address rejected your message because of a blank plain body")
|
||||||
|
end
|
||||||
|
|
||||||
message = @user.send_messages.new body: body,
|
message = @user.send_messages.new body: body,
|
||||||
group: @message.group,
|
group: @message.group,
|
||||||
private: @message.private,
|
private: @message.private,
|
||||||
|
|
Loading…
Reference in a new issue