From 61a69acf38f9efefa1d9b19918e4dbdaa96c0e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Neboj=C5=A1a=20Kamber?= Date: Sat, 26 May 2018 19:15:33 +0200 Subject: [PATCH 1/2] Add URL-encoding notice I've had trouble connecting to Amazon SES via recommended method. I kept getting: > Exception occurred while flushing email queue: Failed to authenticate on SMTP server with username "***" I've traced it to "+" sign in the password that Amazon SES automatically assigned to my SMTP credentials. I had a hunch that special characters might be a problem and was thinking along the lines of wrapping the whole MAILER_URL value in single quotes. Then I ran into https://stackoverflow.com/a/50498999/1419874 that solved the issue for me too. Since the OP lost 3hrs and myself almost an hour, I think URL encoding might not be so obvious. Hence I propose this change. I've intentionally put it at the top, since I think it applies to any method that has special characters in username/password, not just Amazon SES. --- email.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/email.rst b/email.rst index 50aba5da6ce..c351624be77 100644 --- a/email.rst +++ b/email.rst @@ -39,6 +39,7 @@ environment variable in the ``.env`` file: # use this to configure a traditional SMTP server MAILER_URL=smtp://localhost:25?encryption=ssl&auth_mode=login&username=&password= + # keep in mind that, since this is an URL, any special characters in username/password should be URL-encoded Refer to the :doc:`SwiftMailer configuration reference ` for the detailed explanation of all the available config options. From 7f72a6fe49c7f028ef327d4f5c381e2b89546673 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sun, 27 May 2018 12:25:27 +0200 Subject: [PATCH 2/2] Reword --- email.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/email.rst b/email.rst index c351624be77..b97b42190f4 100644 --- a/email.rst +++ b/email.rst @@ -37,9 +37,10 @@ environment variable in the ``.env`` file: # use this to disable email delivery MAILER_URL=null://localhost - # use this to configure a traditional SMTP server + # use this to configure a traditional SMTP server (make sure to URL-encode the + # values of the username and password if they contain non-alphanumeric characters + # such as '+', '@', ':' and '*', which are reserved in URLs) MAILER_URL=smtp://localhost:25?encryption=ssl&auth_mode=login&username=&password= - # keep in mind that, since this is an URL, any special characters in username/password should be URL-encoded Refer to the :doc:`SwiftMailer configuration reference ` for the detailed explanation of all the available config options.