mirror of
https://github.com/postalserver/postal.git
synced 2026-10-20 11:17:01 +00:00
fix(smtp_server): fixes issue with malformed rcpt to
closes #1299 closes #1019
This commit is contained in:
@@ -267,7 +267,17 @@ module Postal
|
||||
end
|
||||
|
||||
rcpt_to = data.gsub(/RCPT TO\s*:\s*/i, '').gsub(/.*</, '').gsub(/>.*/, '').strip
|
||||
|
||||
if rcpt_to.blank?
|
||||
return '501 RCPT TO should not be empty'
|
||||
end
|
||||
|
||||
uname, domain = rcpt_to.split('@', 2)
|
||||
|
||||
if domain.blank?
|
||||
return '501 Invalid RCPT TO'
|
||||
end
|
||||
|
||||
uname, tag = uname.split('+', 2)
|
||||
|
||||
if domain == Postal.config.dns.return_path || domain =~ /\A#{Regexp.escape(Postal.config.dns.custom_return_path_prefix)}\./
|
||||
|
||||
Reference in New Issue
Block a user