diff --git a/lib/rex/mime/message.rb b/lib/rex/mime/message.rb index cd10b832e1..70891071ec 100644 --- a/lib/rex/mime/message.rb +++ b/lib/rex/mime/message.rb @@ -125,7 +125,13 @@ class Message end def to_s - msg = force_crlf(self.header.to_s + "\r\n") + header_string = self.header.to_s + + if header_string.empty? + msg = '' + else + msg = force_crlf(self.header.to_s + "\r\n") + end unless self.content.blank? msg << force_crlf(self.content + "\r\n")