Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The error:
In the /admin/settings/smtp, if the SMTP server field has spaces before of after the value, the SMTP module will be unable to connect, throwing the following error:
SMTP -> ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Name or service not known (0)
SMTP Error: Could not connect to SMTP host.
The (temporary) solution
The error is easily solved: simply remove any whitespace in the field, and things work fine.
I'm not sure if the other fields suffer from the same problem.
I guess a simple trim() would fix things, but don't know where that should be.
Comment | File | Size | Author |
---|---|---|---|
#2 | 468568-trim.patch | 547 bytes | Simon Georges |
Comments
Comment #1
oadaeh CreditAttribution: oadaeh commentedThanks for the update. Probably the port number could benefit from a trim() function, as well. I'll include the fix in the near future, but for those playing at home, I changed this:
to this:
at around line 758 of smtp.module.
Comment #2
Simon Georges CreditAttribution: Simon Georges commentedPatch provided implementing the suggestion above.
Regards,
Comment #3
wundo CreditAttribution: wundo at Chuva Inc. commentedClosing very old (dead) issues, if you think this is still relevant please re-open.