aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/action_mailbox/postfix_relayer.rb3
-rw-r--r--test/unit/postfix_relayer_test.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/action_mailbox/postfix_relayer.rb b/lib/action_mailbox/postfix_relayer.rb
index 5a0eb7dca3..eae6184fbb 100644
--- a/lib/action_mailbox/postfix_relayer.rb
+++ b/lib/action_mailbox/postfix_relayer.rb
@@ -1,5 +1,6 @@
# frozen_string_literal: true
+require "action_mailbox/version"
require "net/http"
require "uri"
@@ -16,7 +17,7 @@ module ActionMailbox
end
CONTENT_TYPE = "message/rfc822"
- USER_AGENT = "Action Mailbox Postfix relayer"
+ USER_AGENT = "Action Mailbox Postfix relayer v#{ActionMailbox::VERSION}"
attr_reader :uri, :username, :password
diff --git a/test/unit/postfix_relayer_test.rb b/test/unit/postfix_relayer_test.rb
index 550ed2ac7f..9d6e49dee3 100644
--- a/test/unit/postfix_relayer_test.rb
+++ b/test/unit/postfix_relayer_test.rb
@@ -21,7 +21,7 @@ module ActionMailbox
assert_requested :post, URL, body: file_fixture("welcome.eml").read,
basic_auth: [ "actionmailbox", INGRESS_PASSWORD ],
- headers: { "Content-Type" => "message/rfc822", "User-Agent" => "Action Mailbox Postfix relayer" }
+ headers: { "Content-Type" => "message/rfc822", "User-Agent" => /\AAction Mailbox Postfix relayer v\d+\./ }
end
test "unsuccessfully relaying with invalid credentials" do