Issue with external SMTP server configuration in Galaxy installation via Ansible

I am currently installing Galaxy using Ansible and trying to configure an external SMTP mail server for sending emails. Below is the relevant part of my configuration:

smtp_server: [...]
smtp_port: 587
smtp_username: [...]
smtp_password: [...]
smtp_ssl: false
smtp_starttls: true
smtp_from: [...]
activation_email: [...]
error_email_to: [...]
user_activation_on: true
track_jobs_in_database: true

When I test the email sending function within Galaxy—for example, by using the password recovery system—I get the following error:

Failed to submit email. Please contact the administrator: (535, b’5.7.3 Authentication unsuccessful’)

To verify the SMTP credentials and connection, I ran the following command from the same server where Galaxy is installed, and it successfully sends an email:

swaks --to […] --from [redacted] --server […] --port 587 --auth LOGIN --auth-user [redacted] --auth-password ‘[redacted]’ --tls --data “Subject: Test Swaks\n\nThis is a test email sent via Swaks”

Given that the direct SMTP test with swaks works properly, I suspect the issue is related to how Galaxy or its Ansible role is handling the SMTP authentication or connection.

Could you please advise on what might be causing this authentication error in Galaxy’s email sending? Are there specific Galaxy configuration settings or known issues related to SMTP authentication that I should check or adjust?

Thank you very much for your help.