From 4106ac6c7e319ebe1fd4a2f3f1204283bc7d6d52 Mon Sep 17 00:00:00 2001 From: Adam Cooke Date: Tue, 16 May 2017 14:49:56 +0100 Subject: [PATCH] fixes bug with receiving messages to the return path treats all messages sent to the return path and any domain with the return path prefix the same --- lib/postal/smtp_server/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/postal/smtp_server/client.rb b/lib/postal/smtp_server/client.rb index bc395fa..10e54f8 100644 --- a/lib/postal/smtp_server/client.rb +++ b/lib/postal/smtp_server/client.rb @@ -256,7 +256,7 @@ module Postal uname, domain = rcpt_to.split('@', 2) uname, tag = uname.split('+', 2) - if domain =~ /\A#{Regexp.escape(Postal.config.dns.custom_return_path_prefix)}\./ + if domain == Postal.config.dns.return_path || domain =~ /\A#{Regexp.escape(Postal.config.dns.custom_return_path_prefix)}\./ # This is a return path @state = :rcpt_to_received if server = ::Server.where(:token => uname).first