Set local domain for swiftmailer #27306
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #14941
Fix #25716
SwiftMailer uses the local domain for the ehlo command.
By default the server_name (mostly for web requests) or 127.0.0.1 is used: https://github.com/nextcloud/3rdparty/blob/cdbf02e814d84b2186b9b1de7a36789d61e7e06a/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php#L4-L8
This patch uses
parse_url
to parseoverwrite.cli.url
and use the host value for the ehlo command. In addition we could use https://www.php.net/manual/en/function.gethostname as fallback if overwriteCliUrl is empty. That might be better than 127.0.0.1 or the server_name.