Remove `bounce_score_threshold_deactivate` setting.
Removed `bounce_score_threshold_deactivate` setting as the deactivate threshold is not getting reached.
This commit is contained in:
parent
9f0e57b338
commit
62c21ba649
|
@ -1893,7 +1893,6 @@ en:
|
|||
soft_bounce_score: "Bounce score added to the user when a temporary bounce happens."
|
||||
hard_bounce_score: "Bounce score added to the user when a permanent bounce happens."
|
||||
bounce_score_threshold: "Max bounce score before we will stop emailing a user."
|
||||
bounce_score_threshold_deactivate: "Max bounce score before we will deactivate a user."
|
||||
reset_bounce_score_after_days: "Automatically reset bounce score after X days."
|
||||
|
||||
attachment_content_type_blacklist: "List of keywords used to blacklist attachments based on the content type."
|
||||
|
@ -2378,7 +2377,7 @@ en:
|
|||
user:
|
||||
deactivated: "Was deactivated due to too many bounced emails to '%{email}'."
|
||||
deactivated_by_staff: "Deactivated by staff"
|
||||
deactivated_by_inactivity:
|
||||
deactivated_by_inactivity:
|
||||
one: "Automatically deactivated after %{count} day of inactivity"
|
||||
other: "Automatically deactivated after %{count} days of inactivity"
|
||||
activated_by_staff: "Activated by staff"
|
||||
|
|
|
@ -1031,7 +1031,6 @@ email:
|
|||
client: true
|
||||
default: 4
|
||||
min: 1
|
||||
bounce_score_threshold_deactivate: 30
|
||||
bounce_score_erode_on_send:
|
||||
default: 0.1
|
||||
hidden: true
|
||||
|
|
|
@ -266,11 +266,7 @@ module Email
|
|||
user.user_stat.reset_bounce_score_after = SiteSetting.reset_bounce_score_after_days.days.from_now
|
||||
user.user_stat.save!
|
||||
|
||||
if user.active && range === SiteSetting.bounce_score_threshold_deactivate
|
||||
user.update!(active: false)
|
||||
reason = I18n.t("user.deactivated", email: user.email)
|
||||
StaffActionLogger.new(Discourse.system_user).log_user_deactivate(user, reason)
|
||||
elsif range === SiteSetting.bounce_score_threshold
|
||||
if range === SiteSetting.bounce_score_threshold
|
||||
# NOTE: we check bounce_score before sending emails
|
||||
# So log we revoked the email...
|
||||
reason = I18n.t("user.email.revoked", email: user.email, date: user.user_stat.reset_bounce_score_after)
|
||||
|
|
|
@ -230,22 +230,6 @@ describe Email::Receiver do
|
|||
|
||||
expect { process(:hard_bounce_via_verp) }.to raise_error(Email::Receiver::BouncedEmailError)
|
||||
end
|
||||
|
||||
it "automatically deactive users once they reach the 'bounce_score_threshold_deactivate' threshold" do
|
||||
expect(user.active).to eq(true)
|
||||
|
||||
user.user_stat.bounce_score = SiteSetting.bounce_score_threshold_deactivate - 1
|
||||
user.user_stat.save!
|
||||
|
||||
expect { process(:soft_bounce_via_verp) }.to raise_error(Email::Receiver::BouncedEmailError)
|
||||
|
||||
user.reload
|
||||
email_log.reload
|
||||
|
||||
expect(email_log.bounced).to eq(true)
|
||||
expect(user.active).to eq(false)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "reply" do
|
||||
|
|
Loading…
Reference in New Issue