Aggiunge IMAP bounce e flag email non valide nel CRM.
CI / scan_ruby (push) Failing after 13m27s
CI / scan_js (push) Successful in 11m45s
CI / lint (push) Failing after 12m4s

Permette di leggere i bounce dalla stessa MailIdentity SMTP, aggiornare le email in anagrafica e saltare gli indirizzi invalidi nei mailing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-08 19:46:04 +02:00
co-authored by Cursor
parent 353ace4d99
commit 36b3ffe507
26 changed files with 922 additions and 12 deletions
+17
View File
@@ -42,7 +42,24 @@
<div>
<label class="mb-1 block text-sm font-medium">Password SMTP<%= " (lascia vuoto per non cambiare)" unless mail_identity.new_record? %></label>
<%= f.password_field :smtp_password, autocomplete: "new-password", class: input_class %>
<p class="mt-1 text-xs text-zinc-500">Stessa password usata anche per IMAP (lettura bounce).</p>
</div>
<div class="md:col-span-2 border-t border-zinc-100 pt-4 dark:border-zinc-800">
<h2 class="text-sm font-semibold">IMAP (lettura casella / bounce)</h2>
<p class="mt-1 text-xs text-zinc-500">Di solito host e porta si compilano da soli in base allSMTP (es. Aruba → imaps.aruba.it:993).</p>
</div>
<div>
<label class="mb-1 block text-sm font-medium">Host IMAP</label>
<%= f.text_field :imap_host, placeholder: mail_identity.inferred_imap_host || "imaps.aruba.it", class: input_class %>
</div>
<div>
<label class="mb-1 block text-sm font-medium">Porta IMAP</label>
<%= f.number_field :imap_port, min: 1, max: 65535, class: input_class %>
</div>
<label class="flex min-h-11 items-center gap-3 rounded-lg border border-zinc-200 px-3 py-2 text-sm dark:border-zinc-700 md:col-span-2">
<%= f.check_box :imap_enabled, class: "size-5" %>
Abilita lettura IMAP (bounce) con le stesse credenziali SMTP
</label>
<label class="flex min-h-11 items-center gap-3 rounded-lg border border-zinc-200 px-3 py-2 text-sm dark:border-zinc-700">
<%= f.check_box :verify_ssl, class: "size-5" %>
Verifica il certificato SSL del server
+18 -2
View File
@@ -1,10 +1,10 @@
<div class="space-y-6">
<div class="flex flex-wrap items-end justify-between gap-3">
<div>
<h1 class="text-xl font-semibold tracking-tight md:text-2xl">Account email / SMTP</h1>
<h1 class="text-xl font-semibold tracking-tight md:text-2xl">Account email / SMTP + IMAP</h1>
<p class="mt-1 text-sm text-zinc-500">
<%= link_to "Impostazioni", admin_path, class: "hover:underline" %>
· da questi indirizzi partono le campagne. Le password SMTP sono cifrate.
· SMTP per gli invii, IMAP (stesse credenziali) per leggere i bounce. Password cifrate.
</p>
</div>
<%= link_to "Nuovo account", new_mail_identity_path, class: "#{btn_primary} w-full sm:w-auto" %>
@@ -26,6 +26,14 @@
<%= link_to "Modifica", edit_mail_identity_path(identity), class: "text-sm text-zinc-700 hover:underline dark:text-zinc-300" %>
</div>
<div class="mt-2 text-sm text-zinc-600 dark:text-zinc-300"><%= identity.smtp_host %>:<%= identity.smtp_port %> · <%= Catalog.label_for(Catalog::MAIL_ENCRYPTIONS, identity.encryption) %></div>
<div class="mt-1 text-sm text-zinc-600 dark:text-zinc-300">
IMAP:
<% if identity.imap_ready? %>
<%= identity.effective_imap_host %>:<%= identity.effective_imap_port %>
<% else %>
off
<% end %>
</div>
<div class="mt-1 text-sm text-zinc-500"><%= identity.active? ? "Attivo" : "Disattivo" %></div>
</div>
<% end %>
@@ -38,6 +46,7 @@
<th class="px-4 py-3">Nome</th>
<th class="px-4 py-3">Mittente</th>
<th class="px-4 py-3">SMTP</th>
<th class="px-4 py-3">IMAP</th>
<th class="px-4 py-3">Stato</th>
<th class="px-4 py-3"></th>
</tr>
@@ -54,6 +63,13 @@
<%= identity.smtp_host %>:<%= identity.smtp_port %>
<div class="text-xs text-zinc-500"><%= Catalog.label_for(Catalog::MAIL_ENCRYPTIONS, identity.encryption) %></div>
</td>
<td class="px-4 py-3 text-zinc-600 dark:text-zinc-300">
<% if identity.imap_ready? %>
<%= identity.effective_imap_host %>:<%= identity.effective_imap_port %>
<% else %>
<span class="text-zinc-400">off</span>
<% end %>
</td>
<td class="px-4 py-3"><%= identity.active? ? "Attivo" : "Disattivo" %></td>
<td class="px-4 py-3 text-right">
<%= link_to "Modifica", edit_mail_identity_path(identity), class: "text-zinc-700 hover:underline dark:text-zinc-300" %>