Allow omission of EMAIL_GATEWAY_BOT and stream emails

(imported from commit 51412d2a46bbacd6537ef892e7b6bdf33ac94079)
This commit is contained in:
Leo Franchi
2013-11-12 10:19:38 -05:00
parent ab874ddc84
commit cc2d17d7c0
4 changed files with 30 additions and 2 deletions

View File

@@ -1518,6 +1518,10 @@ def encode_email_address(stream):
return encode_email_address_helper(stream.name, stream.email_token)
def encode_email_address_helper(name, email_token):
# Some deployments may not use the email gateway
if settings.EMAIL_GATEWAY_PATTERN == '':
return ''
# Given the fact that we have almost no restrictions on stream names and
# that what characters are allowed in e-mail addresses is complicated and
# dependent on context in the address, we opt for a very simple scheme: