mautic / mautic

Mautic: Open Source Marketing Automation Software.
https://www.mautic.org
Other
6.87k stars 2.52k forks source link

Connection with Amazon SES API won't work (error403), when the defined password contains a "/" #12256

Open dsp76 opened 1 year ago

dsp76 commented 1 year ago

Mautic Version

4.4.x series

PHP version

8.0

What browsers are you seeing the problem on?

Not relevant

What happened?

Pretty simple, but hard to find: if Amazon AWS SES defines a secret / password that contains a "/" it will lead to an authorization error with the plattform. The error message:

Error executing "GetAccount" on "https://email.eu-central-1.amazonaws.com/v2/email/account"; AWS HTTP error: Client error:GET https://email.eu-central-1.amazonaws.com/v2/email/accountresulted in a403 Forbiddenresponse: {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access (truncated...) InvalidSignatureException (client): The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. - {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."}

The problem: AWS assigns the password randomly, often it contains a "/". You can only delete the just created key and create a new one - hoping this time its without the "special" character.

How can we reproduce this issue?

Step 1: Connect with Amazon SES API with a password, that contains a "/" Step 2: Save and test the connection - it will throw this error. Step 3: Back to AWS and get another key assigned. It it has no "/" it will work.

Relevant log output

`Error executing "GetAccount" on "https://email.eu-central-1.amazonaws.com/v2/email/account"; AWS HTTP error: Client error: `GET https://email.eu-central-1.amazonaws.com/v2/email/account` resulted in a `403 Forbidden` response: {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access (truncated...) InvalidSignatureException (client): The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. - {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."}`

Code of Conduct

--- Want to back this issue? **[Post a bounty on it!](https://app.bountysource.com/issues/121828581-connection-with-amazon-ses-api-won-t-work-error403-when-the-defined-password-contains-a?utm_campaign=plugin&utm_content=tracker%2F5355074&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://app.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F5355074&utm_medium=issues&utm_source=github).
thunderbird3 commented 1 year ago

The same applies in email settings where email / smtp password has with a / in it. Maybe you are sanitizing input? Not a big deal if you can change the password...

dsp76 commented 1 year ago

Password change is not easy, as it’s provided by AWS and you always need to delete the SMTP user to get new credentials ;)

eduardpoche commented 1 year ago

Hello team!

This issue still persists. The thing is that the passwords are arbritrarily generated by Amazon SES, so no options to circumvent it from the Amazon side. Any workarounds / suggestions? Tried url-encoding the password with no luck.

stale[bot] commented 9 months ago

This issue or PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you would like to keep it open please let us know by replying and confirming that this is still relevant to the latest version of Mautic and we will try to get to it as soon as we can. Thank you for your contributions.

putzwasser commented 6 months ago

This issue is not stale

mautibot commented 3 months ago

This issue has been mentioned on Mautic Forums. There might be relevant details there:

https://forum.mautic.org/t/mail-dsn-dont-let-me-connect-to-my-email-server/31209/16

dsp76 commented 3 months ago

Removed the API label, as its not an issue with Mautic API, but more with the implementation of the email integration.

mautibot commented 1 month ago

This issue has been mentioned on Mautic Forums. There might be relevant details there:

https://forum.mautic.org/t/error-while-using-emai-dsn-on-mautic/31870/3