fix(mailing): patch repozesendmail to properly use CRLF for newlines. Fixes RFC5322 Issues with mailing
This commit is contained in:
parent
091bc11334
commit
81595dcae2
5 changed files with 16 additions and 7 deletions
|
|
@ -40,6 +40,7 @@ from rhodecode.lib import ext_json
|
|||
from rhodecode.lib.utils2 import safe_str
|
||||
from rhodecode.lib.plugins.utils import get_plugin_settings
|
||||
from rhodecode.model.db import User, UserApiKeys
|
||||
from rhodecode.config.patches import inspect_getargspec
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -186,7 +187,6 @@ def request_view(request):
|
|||
exposed method
|
||||
"""
|
||||
# cython compatible inspect
|
||||
from rhodecode.config.patches import inspect_getargspec
|
||||
inspect = inspect_getargspec()
|
||||
|
||||
# check if we can find this session using api_key, get_by_auth_token
|
||||
|
|
|
|||
|
|
@ -328,8 +328,8 @@ def get_method(request, apiuser, pattern=Optional('*')):
|
|||
]
|
||||
error : null
|
||||
"""
|
||||
from rhodecode.config.patches import inspect_getargspec
|
||||
inspect = inspect_getargspec()
|
||||
from rhodecode.config import patches
|
||||
inspect = patches.inspect_getargspec()
|
||||
|
||||
if not has_superadmin_permission(apiuser):
|
||||
raise JSONRPCForbidden()
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ from pyramid.renderers import render_to_response
|
|||
from rhodecode.model import meta
|
||||
from rhodecode.config import patches
|
||||
|
||||
from rhodecode.config.environment import load_pyramid_environment
|
||||
from rhodecode.config.environment import load_pyramid_environment, propagate_rhodecode_config
|
||||
|
||||
import rhodecode.events
|
||||
from rhodecode.config.config_maker import sanitize_settings_and_apply_defaults
|
||||
|
|
@ -99,6 +99,7 @@ def make_pyramid_app(global_config, **settings):
|
|||
|
||||
# Apply compatibility patches
|
||||
patches.inspect_getargspec()
|
||||
patches.repoze_sendmail_lf_fix()
|
||||
|
||||
load_pyramid_environment(global_config, settings)
|
||||
|
||||
|
|
|
|||
|
|
@ -158,3 +158,10 @@ def inspect_getargspec():
|
|||
inspect.getargspec = inspect.getfullargspec
|
||||
|
||||
return inspect
|
||||
|
||||
|
||||
def repoze_sendmail_lf_fix():
|
||||
from repoze.sendmail import encoding
|
||||
from email.policy import SMTP
|
||||
|
||||
encoding.encode_message = lambda message, *args, **kwargs: message.as_bytes(policy=SMTP)
|
||||
|
|
|
|||
|
|
@ -27,10 +27,11 @@ Celery loader, run with::
|
|||
--scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
|
||||
--loglevel DEBUG --ini=.dev/dev.ini
|
||||
"""
|
||||
from rhodecode.config.patches import inspect_getargspec, inspect_formatargspec
|
||||
inspect_getargspec()
|
||||
inspect_formatargspec()
|
||||
from rhodecode.config import patches
|
||||
patches.inspect_getargspec()
|
||||
patches.inspect_formatargspec()
|
||||
# python3.11 inspect patches for backward compat on `paste` code
|
||||
patches.repoze_sendmail_lf_fix()
|
||||
|
||||
import sys
|
||||
import logging
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue