Closed
Description
Symfony version(s) affected: 4.4
Description
With 4.3, I could send emails using Amazon SES SMTP service.
With 4.4, this is impossible out of the box.
How to reproduce
- Configure your project to use Amazon SES mailer. MAILER_DSN should start with ses+smtp:
MAILER_DSN=ses+smtp://$AWS_SES_ACCESS_KEY:$AWS_SES_SECRET_KEY@default?region=eu-west-1
- Try sending an email.
- Observe how the action fails with an error like this:
[error] Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Dispatching for retry #1 using 1000 ms delay. Error: "Connection could not be established with host "ssl://email-smtp.eu-west-1.amazonaws.com:587": stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number."
Possible Solution
I see two ways to fix this:
- (Super simple) change the port in https://github.com/symfony/amazon-mailer/blob/5aeef4385c6f3dddc4dd341702c293e0f9579fd7/Transport/SesSmtpTransport.php#L28 to 465
- fix (revert?) the changes introduced in [Mailer] Simplify the way TLS/SSL/STARTTLS work #33233. It seems like STARTTLS doesn't quite work, at least with SES.