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
+25
View File
@@ -51,4 +51,29 @@ class MailIdentityTest < ActiveSupport::TestCase
assert_not identity.valid?
assert_includes identity.errors[:smtp_port], "con SSL/TLS va usata la porta 465 (es. smtps.aruba.it)"
end
test "infers aruba imap host from smtp" do
identity = MailIdentity.new(
name: "Aruba",
from_name: "Info",
from_email: "info@example.com",
smtp_host: "smtps.aruba.it",
smtp_port: 465,
encryption: "tls",
smtp_authentication: "plain",
smtp_username: "info@example.com",
smtp_password: "secret",
active: true
)
assert identity.valid?
assert_equal "imaps.aruba.it", identity.effective_imap_host
assert_equal 993, identity.effective_imap_port
assert identity.imap_ready?
settings = identity.imap_settings
assert_equal "imaps.aruba.it", settings[:address]
assert_equal 993, settings[:port]
assert settings[:ssl]
assert_equal "info@example.com", settings[:user_name]
assert_equal "secret", settings[:password]
end
end