trim leading and trailing whitespace in mail addresses

bug/bundler_fix
Brent Cook 2017-05-14 11:22:46 -05:00
parent f39e378496
commit 544ea6926c
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
1 changed files with 6 additions and 3 deletions

View File

@ -166,8 +166,11 @@ module Exploit::Remote::SMTPDeliver
nsock = connect_login(false)
end
raw_send_recv("MAIL FROM: <#{datastore['MAILFROM']}>\r\n", nsock)
res = raw_send_recv("RCPT TO: <#{datastore['MAILTO']}>\r\n", nsock)
mailto = datastore['MAILTO'].strip
mailfrom = datastore['MAILFROM'].strip
raw_send_recv("MAIL FROM: <#{mailfrom}>\r\n", nsock)
res = raw_send_recv("RCPT TO: <#{mailto}>\r\n", nsock)
if res[0..2] == '250'
resp = raw_send_recv("DATA\r\n", nsock)
@ -199,7 +202,7 @@ module Exploit::Remote::SMTPDeliver
send_status = raw_send_recv("#{full_msg}\r\n.\r\n", nsock)
end
else
print_error "Server refused to send to <#{datastore['MAILTO']}>"
print_error "Server refused to send to <#{mailto}>"
end
if not already_connected