Skip to content

Commit 2a546d1

Browse files
committed
Land rapid7#6854, smtp header fix
Fixes an issue with duplicate headers when sending emails. Fixes MS-1476
2 parents c15403a + 2e460a8 commit 2a546d1

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/msf/core/exploit/smtp_deliver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ def send_message(data)
163163
print_error("Server refused our mail")
164164
else
165165
full_msg = ''
166-
full_msg << date
167-
full_msg << subject unless subject.nil?
166+
full_msg << date unless data =~ /date: /i
167+
full_msg << subject unless subject.nil? || data =~ /subject: /i
168168
full_msg << data
169169
send_status = raw_send_recv("#{full_msg}\r\n.\r\n", nsock)
170170
end

modules/auxiliary/client/smtp/emailer.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def run
119119
datastore['MAILFROM'] = from
120120

121121
msg = load_file(msg_file)
122-
email_sig = load_file(sig_file)
123122

124123
if (type !~ /text/i and type !~ /text\/html/i)
125124
print_error("YAML config: #{type}")

0 commit comments

Comments
 (0)