1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-12-01 05:43:04 +00:00

Suppression list improvements (#867)

هذا الالتزام موجود في:
Will Power
2019-11-22 17:28:11 +00:00
ملتزم من قبل Adam Cooke
الأصل 10f4808fbf
التزام dcb2919cc6
5 ملفات معدلة مع 9 إضافات و2 حذوفات

عرض الملف

@@ -23,6 +23,7 @@
.suppressionList__right {
flex: 0 0 auto;
text-align: right;
}
.suppressionList__timestamp {

عرض الملف

@@ -14,7 +14,7 @@
- else
%p.pageContent__intro.u-margin
When messages cannot be delivered, addresses are added to the suppression list which stops
future messages to the same recipient being sent through. Recipients are removed from the list after 30 days.
future messages to the same recipient being sent through. Recipients are removed from the list after #{Postal.config.general.suppression_list_removal_delay} days.
%ul.suppressionList
- for suppression in @suppressions[:records]
%li.suppressionList__item
@@ -23,4 +23,8 @@
%p.suppressionList__reason= suppression['reason'].capitalize
.suppressionList__right
%p.suppressionList__timestamp Added #{Time.zone.at(suppression['timestamp']).to_s(:long)}
%p.suppressionList__timestamp
Expires #{Time.zone.at(suppression['keep_until']).to_s(:long)}
- if suppression['keep_until'] > Time.now.to_f
%span.u-red expired
= render 'shared/message_db_pagination', :data => @suppressions, :name => "suppression"

عرض الملف

@@ -26,6 +26,7 @@ module Clockwork
every 1.day, 'every-day', :at => ['03:00'] do
ProcessMessageRetentionJob.queue(:main)
PruneSuppressionListsJob.queue(:main)
end
end

عرض الملف

@@ -13,6 +13,7 @@ general:
exception_url:
maximum_delivery_attempts: 18
maximum_hold_expiry_days: 7
suppression_list_removal_delay: 30
use_local_ns_for_domains: false
web_server:

عرض الملف

@@ -7,7 +7,7 @@ module Postal
end
def add(type, address, options = {})
keep_until = (options[:days] || 30).days.from_now.to_f
keep_until = (options[:days] || Postal.config.general.suppression_list_removal_delay).days.from_now.to_f
if existing = @database.select('suppressions', :where => {:type => type, :address => address}, :limit =>1).first
reason = options[:reason] || existing['reason']
@database.update('suppressions', {:reason => reason, :keep_until => keep_until}, :where => {:id => existing['id']})