fixes bug with smtp header order
SMTP servers that support pipelining will not accept any commands other than MAILFROM and RCPTTO before the DATA command. We were sending Date and Subject before Data which would cause some mailservers to suddenly drop the connection refusing to send the mail. MSP-12133bug/bundler_fix
parent
309159d876
commit
72878e0c14
|
@ -141,6 +141,8 @@ module Exploit::Remote::SMTPDeliver
|
|||
raw_send_recv("MAIL FROM: <#{datastore['MAILFROM']}>\r\n", nsock)
|
||||
raw_send_recv("RCPT TO: <#{datastore['MAILTO']}>\r\n", nsock)
|
||||
|
||||
resp = raw_send_recv("DATA\r\n", nsock)
|
||||
|
||||
# If the user supplied a Date field, use that, else use the current
|
||||
# DateTime in the proper RFC2822 format.
|
||||
if datastore['DATE'].present?
|
||||
|
@ -154,8 +156,6 @@ module Exploit::Remote::SMTPDeliver
|
|||
raw_send_recv("Subject: #{datastore['SUBJECT']}\r\n", nsock)
|
||||
end
|
||||
|
||||
resp = raw_send_recv("DATA\r\n", nsock)
|
||||
|
||||
# Avoid sending tons of data and killing the connection if the server
|
||||
# didn't like us.
|
||||
if not resp or not resp[0,3] == '354'
|
||||
|
|
Loading…
Reference in New Issue