Commit 6eb5f133 authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Rafael Monnerat

Do not play with smtp_url too early.

smtp_url can be None, so do not treat it as string, allow to take different
actions (like doing nothing).
parent 4e841896
......@@ -54,7 +54,6 @@
\n
portal = context.getPortalObject()\n
mailhost = portal.MailHost\n
promise_url = portal.getPromiseParameter(\'external_service\', \'smtp_url\').rstrip(\'/\')\n
if getattr(mailhost, \'getMessageList\', None) is not None:\n
context.newActiveProcess().postResult(ActiveResult(\n
severity=1,\n
......@@ -63,10 +62,12 @@ if getattr(mailhost, \'getMessageList\', None) is not None:\n
))\n
return\n
\n
promise_url = portal.getPromiseParameter(\'external_service\', \'smtp_url\')\n
\n
if promise_url is None:\n
return\n
\n
promise_url = promise_url.rstrip(\'/\')\n
if mailhost.force_tls:\n
protocol = \'smtps\'\n
else:\n
......
......@@ -57,6 +57,9 @@ if getattr(mailhost, \'getMessageList\', None) is not None:\n
return\n
promise_url = portal.getPromiseParameter(\'external_service\', \'smtp_url\')\n
\n
if promise_url is None:\n
return\n
\n
protocol, promise_url = promise_url.split(\'://\', 1)\n
\n
if protocol == \'smtps\':\n
......
25
\ No newline at end of file
26
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment