From 0f3b033f790636c0209a1def1fb45665289a8084 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= <%= notice %> <%= notice %>
+ Email:
+ <%= @bounced_mail_address.email %>
+
+ Bounce reason:
+ <%= @bounced_mail_address.bounce_reason %>
+
+ Incidents:
+ <%= @bounced_mail_address.incidents %>
+
+ Response json:
+ <%= @bounced_mail_address.response_json %>
+<%= pluralize(bounced_mail_address.errors.count, "error") %> prohibited this bounced_mail_address from being saved:
+
+
+ <% @bounced_mail_address.errors.full_messages.each do |message| %>
+
+ Editing Bounced Mail Address
+
+<%= render 'form', bounced_mail_address: @bounced_mail_address %>
+
+<%= link_to 'Show', admin_bounced_mail_address_path(@bounced_mail_address)%> |
+<%= link_to 'Back', admin_bounced_mail_addresses_path %>
diff --git a/app/views/admin/bounced_mail_addresses/index.html.erb b/app/views/admin/bounced_mail_addresses/index.html.erb
new file mode 100644
index 000000000..c2f95ca68
--- /dev/null
+++ b/app/views/admin/bounced_mail_addresses/index.html.erb
@@ -0,0 +1,33 @@
+Bounced Mail Addresses
+
+
+
+
+
+
+
+
+
+
+ <% @bounced_mail_addresses.each do |mail_addr| %>
+ Email
+ Bounce reason
+ Incidents
+ Response json
+
+
+
+ <% end %>
+
+<%= mail_addr.email %>
+ <%= mail_addr.bounce_reason %>
+ <%= mail_addr.incidents %>
+ <%= mail_addr.response_json %>
+ <%= link_to 'Show', admin_bounced_mail_address_path(mail_addr) %>
+ <%= link_to 'Edit', edit_admin_bounced_mail_address_path(mail_addr) %>
+ <%= link_to 'Destroy', admin_bounced_mail_address_path(mail_addr), method: :delete, data: { confirm: 'Are you sure?' } %>
+
+
+<%= link_to 'New Bounced Mail Address', new_admin_bounced_mail_address_path %>
diff --git a/app/views/admin/bounced_mail_addresses/new.html.erb b/app/views/admin/bounced_mail_addresses/new.html.erb
new file mode 100644
index 000000000..010ac79dc
--- /dev/null
+++ b/app/views/admin/bounced_mail_addresses/new.html.erb
@@ -0,0 +1,5 @@
+New Bounced Mail Address
+
+<%= render 'form', bounced_mail_address: @bounced_mail_address %>
+
+<%= link_to 'Back', admin_bounced_mail_addresses_path %>
diff --git a/app/views/admin/bounced_mail_addresses/show.html.erb b/app/views/admin/bounced_mail_addresses/show.html.erb
new file mode 100644
index 000000000..1f48ad5cf
--- /dev/null
+++ b/app/views/admin/bounced_mail_addresses/show.html.erb
@@ -0,0 +1,24 @@
+Bounced Mail Addresses
-
-
-
+
+
+
+
From 834b2c95bc7e56c2c4ba15a60d64f7cd9b89cbfa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?=
-
-
+Email
- Bounce reason
- Incidents
- Response json
-
-
+
+
-
-
+
+
-
- <% @bounced_mail_addresses.each do |mail_addr| %>
- Email
+ Action
+ Status
+ Diagnostic
+ Tracked
+ Actions
+
-
- <% end %>
-
-<%= mail_addr.email %>
- <%= mail_addr.bounce_reason %>
- <%= mail_addr.incidents %>
- <%= mail_addr.response_json %>
- <%= link_to 'Show', admin_bounced_mail_address_path(mail_addr) %>
- <%= link_to 'Edit', edit_admin_bounced_mail_address_path(mail_addr) %>
- <%= link_to 'Destroy', admin_bounced_mail_address_path(mail_addr), method: :delete, data: { confirm: 'Are you sure?' } %>
-
-
-<%= link_to 'New Bounced Mail Address', new_admin_bounced_mail_address_path %>
+
+ <% @bounced_mail_addresses.each do |mail_addr| %>
+
+
+ <% end %>
+
+ <%= mail_addr.email %>
+ <%= mail_addr.action %>
+ <%= mail_addr.status %>
+ <%= mail_addr.diagnostic %>
+ <%= mail_addr.created_at %>
+ <%= link_to 'Detailed', admin_bounced_mail_address_path(mail_addr) %>
+ <%= link_to 'Destroy', admin_bounced_mail_address_path(mail_addr), method: :delete, data: { confirm: 'Are you sure?' } %>
+ <%= pluralize(bounced_mail_address.errors.count, "error") %> prohibited this bounced_mail_address from being saved:
-
-
- <% @bounced_mail_address.errors.full_messages.each do |message| %>
-
- Editing Bounced Mail Address
-
-<%= render 'form', bounced_mail_address: @bounced_mail_address %>
-
-<%= link_to 'Show', admin_bounced_mail_address_path(@bounced_mail_address)%> |
-<%= link_to 'Back', admin_bounced_mail_addresses_path %>
diff --git a/app/views/admin/bounced_mail_addresses/new.html.erb b/app/views/admin/bounced_mail_addresses/new.html.erb
deleted file mode 100644
index 010ac79dc..000000000
--- a/app/views/admin/bounced_mail_addresses/new.html.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-New Bounced Mail Address
-
-<%= render 'form', bounced_mail_address: @bounced_mail_address %>
-
-<%= link_to 'Back', admin_bounced_mail_addresses_path %>
diff --git a/app/views/admin/bounced_mail_addresses/show.html.erb b/app/views/admin/bounced_mail_addresses/show.html.erb
index 1f48ad5cf..752bd7b0a 100644
--- a/app/views/admin/bounced_mail_addresses/show.html.erb
+++ b/app/views/admin/bounced_mail_addresses/show.html.erb
@@ -16,9 +16,13 @@
- Response json: - <%= @bounced_mail_address.response_json %> + Bounced recipient JSON: +
<%= JSON.pretty_generate(@bounced_mail_address.recipient_json) %>+ + +
+ Bounce payload: +
<%= JSON.pretty_generate(@bounced_mail_address.response_json) %>-<%= link_to 'Edit', edit_admin_bounced_mail_address_path(@bounced_mail_address) %> | <%= link_to 'Back', admin_bounced_mail_addresses_path %> diff --git a/config/locales/admin/menu.en.yml b/config/locales/admin/menu.en.yml index 617341c6a..cb1060e6f 100644 --- a/config/locales/admin/menu.en.yml +++ b/config/locales/admin/menu.en.yml @@ -14,6 +14,7 @@ en: blocked_domains: Blocked domains reserved_domains: Reserved domains disputed_domains: Disputed domains + bounced_email_addresses: Bounced emails epp_log: EPP log repp_log: REPP log que: Que diff --git a/db/migrate/20200917104213_add_recipient_json_to_bounced_mail_address.rb b/db/migrate/20200917104213_add_recipient_json_to_bounced_mail_address.rb new file mode 100644 index 000000000..bad3d846e --- /dev/null +++ b/db/migrate/20200917104213_add_recipient_json_to_bounced_mail_address.rb @@ -0,0 +1,5 @@ +class AddRecipientJsonToBouncedMailAddress < ActiveRecord::Migration[6.0] + def change + add_column :bounced_mail_addresses, :recipient_json, :jsonb, null: false + end +end diff --git a/db/structure.sql b/db/structure.sql index 3ec055386..23669c665 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -486,7 +486,8 @@ CREATE TABLE public.bounced_mail_addresses ( incidents integer DEFAULT 1 NOT NULL, response_json jsonb, created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL + updated_at timestamp(6) without time zone NOT NULL, + recipient_json jsonb NOT NULL ); @@ -4956,6 +4957,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200908131554'), ('20200910085157'), ('20200910102028'), -('20200916125326'); +('20200916125326'), +('20200917104213'); From b2c5a9a5ec69ac8b27e7fa7ab8fef96f292f1485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?=
<%= notice %>
-<%= notice %>
- -Email: <%= @bounced_mail_address.email %>
@@ -26,3 +23,4 @@ <%= link_to 'Back', admin_bounced_mail_addresses_path %> +<%= link_to 'Destroy', admin_bounced_mail_address_path(@bounced_mail_address), method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/test/fixtures/bounced_mail_addresses.yml b/test/fixtures/bounced_mail_addresses.yml new file mode 100644 index 000000000..1261f1429 --- /dev/null +++ b/test/fixtures/bounced_mail_addresses.yml @@ -0,0 +1,40 @@ +one: + email: bounced@registry.test + bounce_reason: failed (5.1.1 smtp; 550 5.1.1 user unknown) + incidents: 1 + recipient_json: { + "action": "failed", + "status": "5.1.1", + "emailAddress": "bounced@registry.test", + "diagnosticCode": "smtp; 550 5.1.1 user unknown" + } + response_json: { + "notificationType": "Bounce", + "mail": { + "source": "noreply@registry.test", + "sourceIp": "195.43.86.5", + "messageId": "010f0174a0c7d348-ea6e2fc1-0854-4073-b71f-5cecf9b0d0b2-000000", + "sourceArn": "arn:aws:ses:us-east-2:65026820000:identity/noreply@registry.test", + "timestamp": "2020-09-18T10:34:44.000Z", + "destination": [ "bounced@registry.test" ], + "sendingAccountId": "650268220000" + }, + "bounce": { + "timestamp": "2020-09-18T10:34:44.911Z", + "bounceType": "Permanent", + "feedbackId": "010f0174a0c7d4f9-27d59756-6111-4d5f-xxxx-26bee0d55fa2-000000", + "remoteMtaIp": "127.0.01", + "reportingMTA": "dsn; xxx.amazonses.com", + "bounceSubType": "General", + "bouncedRecipients": [ + { + "action": "failed", + "status": "5.1.1", + "emailAddress": "bounced@registry.test", + "diagnosticCode": "smtp; 550 5.1.1 user unknown" + } + ] + } + } + created_at: <%= Time.zone.parse('2010-07-05').to_s(:db) %> + updated_at: <%= Time.zone.parse('2010-07-05').to_s(:db) %> diff --git a/test/system/admin_area/bounced_mail_addresses_test.rb b/test/system/admin_area/bounced_mail_addresses_test.rb new file mode 100644 index 000000000..5500f4375 --- /dev/null +++ b/test/system/admin_area/bounced_mail_addresses_test.rb @@ -0,0 +1,41 @@ +require 'application_system_test_case' + +class AdminBouncedMailAddressesTest < ApplicationSystemTestCase + include ActionView::Helpers::NumberHelper + + def setup + @bounced_mail = bounced_mail_addresses(:one) + @original_default_language = Setting.default_language + sign_in users(:admin) + end + + def teardown + Setting.default_language = @original_default_language + end + + def test_shows_bounced_emails + visit admin_bounced_mail_addresses_path + assert_text @bounced_mail.status + assert_text @bounced_mail.action + assert_text @bounced_mail.diagnostic + assert_text @bounced_mail.email + end + + def test_shows_detailed_bounced_email + visit admin_bounced_mail_address_path(@bounced_mail) + assert_text @bounced_mail.status + assert_text @bounced_mail.action + assert_text @bounced_mail.diagnostic + assert_text @bounced_mail.email + + assert_text 'bouncedRecipients' + assert_text '010f0174a0c7d4f9-27d59756-6111-4d5f-xxxx-26bee0d55fa2-000000' + end + + def test_deletes_registrar + visit admin_bounced_mail_address_path(@bounced_mail) + click_on 'Destroy' + + assert_text 'Bounced mail address was successfully destroyed.' + end +end From 6a93395fa493252f5f717799a0f5943257e1ddb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?=- Incidents: - <%= @bounced_mail_address.incidents %> -
-Bounced recipient JSON:
<%= JSON.pretty_generate(@bounced_mail_address.recipient_json) %>diff --git a/db/migrate/20200921084356_remove_incidents_from_bounced_mail_addresses.rb b/db/migrate/20200921084356_remove_incidents_from_bounced_mail_addresses.rb new file mode 100644 index 000000000..0704795df --- /dev/null +++ b/db/migrate/20200921084356_remove_incidents_from_bounced_mail_addresses.rb @@ -0,0 +1,9 @@ +class RemoveIncidentsFromBouncedMailAddresses < ActiveRecord::Migration[6.0] + def up + remove_column :bounced_mail_addresses, :incidents + end + + def down + add_column :bounced_mail_addresses, :incidents, :integer, null: false, default: 1 + end +end diff --git a/db/structure.sql b/db/structure.sql index 23669c665..74e784408 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -483,7 +483,6 @@ CREATE TABLE public.bounced_mail_addresses ( id bigint NOT NULL, email character varying NOT NULL, bounce_reason character varying NOT NULL, - incidents integer DEFAULT 1 NOT NULL, response_json jsonb, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, @@ -4958,6 +4957,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200910085157'), ('20200910102028'), ('20200916125326'), -('20200917104213'); +('20200917104213'), +('20200921084356'); diff --git a/test/fixtures/bounced_mail_addresses.yml b/test/fixtures/bounced_mail_addresses.yml index 1261f1429..345b2ef22 100644 --- a/test/fixtures/bounced_mail_addresses.yml +++ b/test/fixtures/bounced_mail_addresses.yml @@ -1,7 +1,6 @@ one: email: bounced@registry.test bounce_reason: failed (5.1.1 smtp; 550 5.1.1 user unknown) - incidents: 1 recipient_json: { "action": "failed", "status": "5.1.1", From fae620c19d87fc4df9710be88e3608a4192b29a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?=
Email: <%= @bounced_mail_address.email %>
- Bounce reason: - <%= @bounced_mail_address.bounce_reason %> + Bounced message ID: + <%= @bounced_mail_address.message_id %>
- Bounced recipient JSON: -
<%= JSON.pretty_generate(@bounced_mail_address.recipient_json) %>+ Overall bounce type: + <%= @bounced_mail_address.bounce_type %> (<%= @bounced_mail_address.bounce_subtype %> )
- Bounce payload: -
<%= JSON.pretty_generate(@bounced_mail_address.response_json) %>+ Bounced recipient status: + <%= @bounced_mail_address.action %> (<%= @bounced_mail_address.status %>) + + +
+ Bounced recipient diagnostic: +
<%= @bounced_mail_address.diagnostic %><%= link_to 'Back', admin_bounced_mail_addresses_path %> From 3222a8b9a79b80444a41b8b348c98d8d260aeb4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?=
Lugupeetud .ee domeeni registreerija/halduskontakt
-Domeeninimi <%= @domain.name %> on aegunud ja ei ole alates <%= @domain.on_hold_date %> internetis kättesaadav. Domeeniga on seotud puudulike kontakti objekte, milles tulenevalt on Eesti Interneti SA blokeerinud domeeni pikendamise ja registripidaja vahetuse, kuniks kontaktandmed korrastatakse. Andmete korrastamiseks ja registreeringu pikendamiseks pöörduge palun oma registripidaja poole.
+Domeeninimi <%= @domain.name %> on aegunud ja ei ole alates <%= @domain.on_hold_date %> internetis kättesaadav. Domeeniga on seotud puudulikke kontakti objekte, millest tulenevalt on Eesti Interneti SA blokeerinud domeeni pikendamise ja registripidaja vahetuse, kuniks kontaktandmed korrastatakse. Andmete korrastamiseks ja registreeringu pikendamiseks pöörduge palun oma registripidaja poole.
<%= @domain.name %> pikendamata jätmisel domeen kustub ja läheb <%= @domain.delete_date %> oksjonile .ee oksjonikeskkonda. Domeenioksjonite kohta loe lähemalt siit.
From 6a6265e3a5b97918558ae4218119061ce665679c Mon Sep 17 00:00:00 2001 From: Alex Sherman