Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openenig quarantine page results in internal error - KeyError '?' #127

Open
BigMichi1 opened this issue Aug 6, 2020 · 2 comments
Open
Labels

Comments

@BigMichi1
Copy link

when the page is shown and a where normally the list with the emails is displayed an internal error appears

enabling debug shows this

KeyError at /quarantine/listing/
'?'

Request Method: GET
Request URL: https://myhost/quarantine/listing/?sort_order=-date&reset_page=true&_=1596699465583
Django Version: 2.2.15
Python Executable: /usr/bin/uwsgi-core
Python Version: 3.6.9
Python Path: ['.', '', '/srv/modoboa/env/lib/python36.zip', '/srv/modoboa/env/lib/python3.6', '/srv/modoboa/env/lib/python3.6/lib-dynload', '/usr/lib/python3.6', '/srv/modoboa/env/lib/python3.6/site-packages']
Server time: Do, 6 Aug 2020 09:37:46 +0200
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'reversion',
 'ckeditor',
 'ckeditor_uploader',
 'rest_framework',
 'rest_framework.authtoken',
 'modoboa',
 'modoboa.core',
 'modoboa.lib',
 'modoboa.admin',
 'modoboa.transport',
 'modoboa.relaydomains',
 'modoboa.limits',
 'modoboa.parameters',
 'modoboa.dnstools',
 'modoboa_amavis',
 'modoboa_contacts',
 'modoboa_dmarc',
 'modoboa_pdfcredentials',
 'modoboa_postfix_autoreply',
 'modoboa_sievefilters',
 'modoboa_stats',
 'modoboa_webmail',
 'webpack_loader')
Installed Middleware:
('x_forwarded_for.middleware.XForwardedForMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'modoboa.core.middleware.LocalConfigMiddleware',
 'modoboa.lib.middleware.AjaxLoginRedirect',
 'modoboa.lib.middleware.CommonExceptionCatcher',
 'modoboa.lib.middleware.RequestCatcherMiddleware')


Traceback:

File "/srv/modoboa/env/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python3.6/contextlib.py" in inner
  52.                 return func(*args, **kwds)

File "/usr/lib/python3.6/contextlib.py" in inner
  52.                 return func(*args, **kwds)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  21.                 return view_func(request, *args, **kwargs)

File "/srv/modoboa/env/lib/python3.6/site-packages/modoboa_amavis/views.py" in _listing
  107.         }, request

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/loader.py" in render_to_string
  62.     return template.render(context, request)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/backends/django.py" in render
  61.             return self.template.render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render
  171.                     return self._render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render
  150.             return compiled_parent._render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render
  62.                 result = block.nodelist.render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render
  188.             return template.render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render
  173.                 return self._render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/defaulttags.py" in render
  209.                     nodelist.append(node.render_annotated(context))

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in render
  987.             output = self.filter_expression.resolve(context)

File "/srv/modoboa/env/lib/python3.6/site-packages/django/template/base.py" in resolve
  698.                 new_obj = func(obj, *arg_vals)

File "/srv/modoboa/env/lib/python3.6/site-packages/modoboa_amavis/templatetags/amavis_tags.py" in msgtype_to_html
  140.             color, constants.MESSAGE_TYPES[msgtype], msgtype))

Exception Type: KeyError at /quarantine/listing/
Exception Value: '?'
Request information:
USER: root@myhost

GET:
sort_order = '-date'
reset_page = 'true'
_ = '1596699465583'

POST: No POST data

FILES: No FILES data

COOKIES:
experimentation_subject_id = 'Ijk3NTkxNmQ1LWJiNjYtNGE4Ni1hZTQzLTYyNjNjN2QwMzY0NiI%3D--89c5beb075786790f5bf63e019b11781178c6cce'
csrftoken = 'sTV9r72yvvxeWIrWg4V6QCXGSs4XynnaEdloEw5VA1lgAVdlIVUedv0IVaR8lJRo'
sessionid = '7ae4h6e3grxne4s5chhpzkou5s0wi8uw'

META:
CONTENT_LENGTH = ''
CONTENT_TYPE = ''
CSRF_COOKIE = 'sTV9r72yvvxeWIrWg4V6QCXGSs4XynnaEdloEw5VA1lgAVdlIVUedv0IVaR8lJRo'
DOCUMENT_ROOT = '/srv/modoboa/instance'
HTTPS = 'on'
HTTP_ACCEPT = 'application/json, text/javascript, */*; q=0.01'
HTTP_ACCEPT_ENCODING = 'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE = 'de,en-US;q=0.9,en;q=0.8'
HTTP_CACHE_CONTROL = 'no-cache'
HTTP_COOKIE = 'experimentation_subject_id=Ijk3NTkxNmQ1LWJiNjYtNGE4Ni1hZTQzLTYyNjNjN2QwMzY0NiI%3D--89c5beb075786790f5bf63e019b11781178c6cce; csrftoken=sTV9r72yvvxeWIrWg4V6QCXGSs4XynnaEdloEw5VA1lgAVdlIVUedv0IVaR8lJRo; sessionid=7ae4h6e3grxne4s5chhpzkou5s0wi8uw'
HTTP_HOST = 'myhost'
HTTP_PRAGMA = 'no-cache'
HTTP_REFERER = 'https://myhost/quarantine/'
HTTP_SEC_FETCH_DEST = 'empty'
HTTP_SEC_FETCH_MODE = 'cors'
HTTP_SEC_FETCH_SITE = 'same-origin'
HTTP_USER_AGENT = 'Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36'
HTTP_X_REQUESTED_WITH = 'XMLHttpRequest'
PATH_INFO = '/quarantine/listing/'
QUERY_STRING = 'sort_order=-date&reset_page=true&_=1596699465583'
REMOTE_ADDR = '213.95.133.22'
REMOTE_PORT = '41816'
REQUEST_METHOD = 'GET'
REQUEST_SCHEME = 'https'
REQUEST_URI = '/quarantine/listing/?sort_order=-date&reset_page=true&_=1596699465583'
SCRIPT_NAME = ''
SERVER_NAME = 'myhost'
SERVER_PORT = '443'
SERVER_PROTOCOL = 'HTTP/2.0'
UWSGI_APPID = 'myhost|'
UWSGI_SCRIPT = 'instance.wsgi:application'
uwsgi.node = b'i7-4770'
uwsgi.version = b'2.0.15-debian'
wsgi.errors = <_io.TextIOWrapper name=2 mode='w' encoding='UTF-8'>
wsgi.file_wrapper = ''
wsgi.input = <uwsgi._Input object at 0x7ff314915c48>
wsgi.multiprocess = True
wsgi.multithread = False
wsgi.run_once = False
wsgi.url_scheme = 'https'
wsgi.version = '(1, 0)'

Settings:
Using settings module instance.settings
ABSOLUTE_URL_OVERRIDES = {}
ADMINS = [('Administrator', 'root@myhost')]
ALLOWED_HOSTS = ['myhost']
AMAVIS_DEFAULT_DATABASE_ENCODING = 'utf8'
APPEND_SLASH = True
AUTHENTICATION_BACKENDS = "('django.contrib.auth.backends.ModelBackend',)"
AUTH_PASSWORD_VALIDATORS = '********************'
AUTH_USER_MODEL = 'core.User'
BASE_DIR = '/srv/modoboa/instance'
BYTEA2BYTES = <psycopg2._psycopg.type 'BYTEA2BYTES' at 0x7ff31b72c3b8>
CACHES = {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS = 'default'
CACHE_MIDDLEWARE_KEY_PREFIX = '********************'
CACHE_MIDDLEWARE_SECONDS = 600
CKEDITOR_ALLOW_NONIMAGE_FILES = False
CKEDITOR_BROWSE_SHOW_DIRS = True
CKEDITOR_CONFIGS = {'default': {'allowedContent': True, 'toolbar': 'Modoboa', 'width': None, 'toolbar_Modoboa': [['Bold', 'Italic', 'Underline'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['BidiLtr', 'BidiRtl', 'Language'], ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'], ['Undo', 'Redo'], ['Link', 'Unlink', 'Anchor', '-', 'Smiley'], ['TextColor', 'BGColor', '-', 'Source'], ['Font', 'FontSize'], ['Image'], ['SpellChecker']]}}
CKEDITOR_IMAGE_BACKEND = 'pillow'
CKEDITOR_RESTRICT_BY_USER = True
CKEDITOR_UPLOAD_PATH = 'uploads/'
CSRF_COOKIE_AGE = 31449600
CSRF_COOKIE_DOMAIN = None
CSRF_COOKIE_HTTPONLY = False
CSRF_COOKIE_NAME = 'csrftoken'
CSRF_COOKIE_PATH = '/'
CSRF_COOKIE_SAMESITE = 'Lax'
CSRF_COOKIE_SECURE = True
CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME = 'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS = []
CSRF_USE_SESSIONS = False
DATABASES = {'default': {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'modoboa', 'USER': 'modoboa', 'PASSWORD': '********************', 'HOST': '127.0.0.1', 'PORT': '', 'ATOMIC_REQUESTS': True, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'OPTIONS': {}, 'TIME_ZONE': None, 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}}, 'amavis': {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'amavis', 'USER': 'amavis', 'PASSWORD': '********************', 'HOST': '127.0.0.1', 'PORT': '', 'ATOMIC_REQUESTS': True, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'OPTIONS': {}, 'TIME_ZONE': None, 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}}}
DATABASE_ROUTERS = ['modoboa_amavis.dbrouter.AmavisRouter']
DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS = 1000
DATETIME_FORMAT = 'N j, Y, P'
DATETIME_INPUT_FORMATS = ['%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M', '%Y-%m-%d', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/%d/%Y %H:%M', '%m/%d/%Y', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M', '%m/%d/%y']
DATE_FORMAT = 'N j, Y'
DATE_INPUT_FORMATS = ['%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', '%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y', '%B %d, %Y', '%d %B %Y', '%d %B, %Y']
DEBUG = True
DEBUG_PROPAGATE_EXCEPTIONS = False
DECIMAL_SEPARATOR = '.'
DEFAULT_CHARSET = 'utf-8'
DEFAULT_CONTENT_TYPE = 'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER = 'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL = 'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE = ''
DEFAULT_TABLESPACE = ''
DISABLE_DASHBOARD_EXTERNAL_QUERIES = False
DISALLOWED_USER_AGENTS = []
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_HOST_PASSWORD = '********************'
EMAIL_HOST_USER = ''
EMAIL_PORT = 25
EMAIL_SSL_CERTFILE = None
EMAIL_SSL_KEYFILE = '********************'
EMAIL_SUBJECT_PREFIX = '[Django] '
EMAIL_TIMEOUT = None
EMAIL_USE_LOCALTIME = False
EMAIL_USE_SSL = False
EMAIL_USE_TLS = False
FILE_CHARSET = 'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS = None
FILE_UPLOAD_HANDLERS = ['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440
FILE_UPLOAD_PERMISSIONS = None
FILE_UPLOAD_TEMP_DIR = None
FIRST_DAY_OF_WEEK = 0
FIXTURE_DIRS = []
FORCE_SCRIPT_NAME = None
FORMAT_MODULE_PATH = None
FORM_RENDERER = 'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS = []
INSTALLED_APPS = "('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.sites', 'django.contrib.staticfiles', 'reversion', 'ckeditor', 'ckeditor_uploader', 'rest_framework', 'rest_framework.authtoken', 'modoboa', 'modoboa.core', 'modoboa.lib', 'modoboa.admin', 'modoboa.transport', 'modoboa.relaydomains', 'modoboa.limits', 'modoboa.parameters', 'modoboa.dnstools', 'modoboa_amavis', 'modoboa_contacts', 'modoboa_dmarc', 'modoboa_pdfcredentials', 'modoboa_postfix_autoreply', 'modoboa_sievefilters', 'modoboa_stats', 'modoboa_webmail', 'webpack_loader')"
INTERNAL_IPS = []
LANGUAGES = [('af', 'Afrikaans'), ('ar', 'Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'), ('en', 'English'), ('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-co', 'Colombian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'), ('hy', 'Armenian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian Bokmål'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'), ('pa', 'Punjabi'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sq', 'Albanian'), ('sr', 'Serbian'), ('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'), ('sw', 'Swahili'), ('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr', 'Turkish'), ('tt', 'Tatar'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')]
LANGUAGES_BIDI = ['he', 'ar', 'fa', 'ur']
LANGUAGE_CODE = 'de'
LANGUAGE_COOKIE_AGE = None
LANGUAGE_COOKIE_DOMAIN = None
LANGUAGE_COOKIE_NAME = 'django_language'
LANGUAGE_COOKIE_PATH = '/'
LOCALE_PATHS = []
LOGGING = {'version': 1, 'formatters': {'syslog': {'format': '%(name)s: %(levelname)s %(message)s'}}, 'handlers': {'mail-admins': {'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler', 'include_html': True}, 'syslog-auth': {'class': 'logging.handlers.SysLogHandler', 'facility': 4, 'address': '/dev/log', 'formatter': 'syslog'}, 'modoboa': {'class': 'modoboa.core.loggers.SQLHandler'}}, 'loggers': {'django': {'handlers': ['mail-admins'], 'level': 'ERROR', 'propagate': False}, 'modoboa.auth': {'handlers': ['syslog-auth', 'modoboa'], 'level': 'INFO', 'propagate': False}, 'modoboa.admin': {'handlers': ['modoboa'], 'level': 'INFO', 'propagate': False}}}
LOGGING_CONFIG = 'logging.config.dictConfig'
LOGIN_REDIRECT_URL = '/accounts/profile/'
LOGIN_URL = '/accounts/login/'
LOGOUT_REDIRECT_URL = None
MANAGERS = []
MEDIA_ROOT = '/srv/modoboa/instance/media'
MEDIA_URL = '/media/'
MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE = "('x_forwarded_for.middleware.XForwardedForMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'modoboa.core.middleware.LocalConfigMiddleware', 'modoboa.lib.middleware.AjaxLoginRedirect', 'modoboa.lib.middleware.CommonExceptionCatcher', 'modoboa.lib.middleware.RequestCatcherMiddleware')"
MIGRATION_MODULES = {}
MODOBOA_API_URL = '********************'
MODOBOA_APPS = "('modoboa', 'modoboa.core', 'modoboa.lib', 'modoboa.admin', 'modoboa.transport', 'modoboa.relaydomains', 'modoboa.limits', 'modoboa.parameters', 'modoboa.dnstools', 'modoboa_amavis', 'modoboa_contacts', 'modoboa_dmarc', 'modoboa_pdfcredentials', 'modoboa_postfix_autoreply', 'modoboa_sievefilters', 'modoboa_stats', 'modoboa_webmail')"
MONTH_DAY_FORMAT = 'F j'
NUMBER_GROUPING = 0
PASSWORD_HASHERS = '********************'
PASSWORD_RESET_TIMEOUT_DAYS = '********************'
PREPEND_WWW = False
REST_FRAMEWORK = {'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework.authentication.TokenAuthentication', 'rest_framework.authentication.SessionAuthentication')}
ROOT_URLCONF = 'instance.urls'
SECRET_KEY = '********************'
SECURE_BROWSER_XSS_FILTER = False
SECURE_CONTENT_TYPE_NOSNIFF = False
SECURE_HSTS_INCLUDE_SUBDOMAINS = False
SECURE_HSTS_PRELOAD = False
SECURE_HSTS_SECONDS = 0
SECURE_PROXY_SSL_HEADER = None
SECURE_REDIRECT_EXEMPT = []
SECURE_SSL_HOST = None
SECURE_SSL_REDIRECT = False
SERVER_EMAIL = 'postmaster@myhost'
SESSION_CACHE_ALIAS = 'default'
SESSION_COOKIE_AGE = 1209600
SESSION_COOKIE_DOMAIN = None
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_NAME = 'sessionid'
SESSION_COOKIE_PATH = '/'
SESSION_COOKIE_SAMESITE = 'Lax'
SESSION_COOKIE_SECURE = True
SESSION_ENGINE = 'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
SESSION_FILE_PATH = None
SESSION_SAVE_EVERY_REQUEST = False
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE = 'instance.settings'
SHORT_DATETIME_FORMAT = 'm/d/Y P'
SHORT_DATE_FORMAT = 'm/d/Y'
SIGNING_BACKEND = 'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS = ['security.W019', 'fields.W342']
SITE_ID = 1
STATICFILES_DIRS = "('/srv/modoboa/env/lib/python3.6/site-packages/modoboa/bower_components',)"
STATICFILES_FINDERS = ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder']
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT = '/srv/modoboa/instance/sitestatic'
STATIC_URL = '/sitestatic/'
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.contrib.messages.context_processors.messages', 'modoboa.core.context_processors.top_notifications'], 'debug': False}}]
TEST_NON_SERIALIZED_APPS = []
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR = ','
TIME_FORMAT = 'P'
TIME_INPUT_FORMATS = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
TIME_ZONE = 'Europe/Berlin'
USE_I18N = True
USE_L10N = True
USE_THOUSAND_SEPARATOR = False
USE_TZ = True
USE_X_FORWARDED_HOST = False
USE_X_FORWARDED_PORT = False
WEBPACK_LOADER = {'CONTACTS': {'CACHE': False, 'BUNDLE_DIR_NAME': 'modoboa_contacts/', 'STATS_FILE': '/srv/modoboa/env/lib/python3.6/site-packages/modoboa_contacts/static/modoboa_contacts/webpack-stats.json', 'IGNORE': ['.+\\.hot-update.js', '.+\\.map']}, 'CALENDAR': {'CACHE': False, 'BUNDLE_DIR_NAME': 'modoboa_radicale/', 'STATS_FILE': '/srv/modoboa/env/lib/python3.6/site-packages/modoboa_radicale/static/modoboa_radicale/webpack-stats.json', 'IGNORE': ['.+\\.hot-update.js', '.+\\.map']}}
WSGI_APPLICATION = 'instance.wsgi.application'
X_FRAME_OPTIONS = 'SAMEORIGIN'
YEAR_MONTH_FORMAT = 'F Y'


You're seeing this error because you have DEBUG = True in your
Django settings file. Change that to False, and Django will
display a standard page generated by the handler for this status code.
@tonioo tonioo added the bug label Aug 10, 2020
@bigwillystyle42
Copy link

My quarantine is currently impacted by this issue. I have my system configured to email me the errors, so the additional information I can provide is:

Exception Location: /home/modoboa/env/lib/python3.5/site-packages/modoboa_amavis/templatetags/amavis_tags.py in msgtype_to_html, line 140

There is a message in my quarantine which has a type of '?' which appears to be causing this problem. The actual complaint is "BAD HEADER SECTION Improper folded header field made up entirely of whitespace (char 20 hex): Subject: [...]" so it should be an 'H'. I'm not sure why it's a ?, but it'd be great if Modoboa handled it a bit more gracefully.

I tweaked mine to return the raw msgtype on line 140 instead of trying to format it nicely.

@calvez
Copy link

calvez commented Oct 15, 2023

def msgtype_to_html(msgtype):
    """Transform a message type to a bootstrap label."""
    color = constants.MESSAGE_TYPE_COLORS.get(msgtype, "default")
    return mark_safe(
        "<span class=\"label label-{}\" title=\"{}\">{}</span>".format(
            color, constants.MESSAGE_TYPES[msgtype], msgtype))

so this is the problematic line i guess.
What is the way to fix this?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants