Aggiunge IMAP bounce e flag email non valide nel CRM.
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user