AttributeError: 'MailingList' object has no attribute 'get_requests_count'
by Shashikanth Komandoor
Hi Team,
I am currently running Mailman 3 with version 3.3.2rc2 and in
built postfix version 2.10.1-6 on RHEL 7.5 with PostgreSQL 11.9 version
with default values. As of now, we don't have any lists and just installed
software components only.
After the installation and configuration, I have tried
creating the domains and lists. I was successful in creating them but when
I tried to login and browse the lists using LDAP authentication, I am
getting the "Mailman REST API not available. Restart Mailman core".
I see the below trace in the mailmansuite.log.
*Traceback (most recent call last): File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/mailmanclient/restbase/base.py",
line 119, in __getattr__ return self._get(name) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/mailmanclient/restbase/base.py",
line 86, in _get raise KeyError(key)KeyError: 'get_requests_count'During
handling of the above exception, another exception occurred:Traceback (most
recent call last): File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/core/handlers/exception.py",
line 34, in inner response = get_response(request) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/core/handlers/base.py",
line 115, in _get_response response =
self.process_exception_by_middleware(e, request) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/core/handlers/base.py",
line 113, in _get_response response = wrapped_callback(request,
*callback_args, **callback_kwargs) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/views/generic/base.py",
line 71, in view return self.dispatch(request, *args, **kwargs) File
"/var/lib/mailman/postorius/src/postorius/views/generic.py", line 74, in
dispatch return super(MailingListView, self).dispatch(request, *args,
**kwargs) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/views/generic/base.py",
line 97, in dispatch return handler(request, *args, **kwargs) File
"/var/lib/mailman/postorius/src/postorius/views/list.py", line 311, in get
return render(request, 'postorius/lists/summary.html', data) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/shortcuts.py",
line 19, in render content = loader.render_to_string(template_name,
context, request, using=using) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/loader.py",
line 62, in render_to_string return template.render(context, request)
File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/backends/django.py",
line 61, in render return self.template.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 171, in render return self._render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 163, in _render return self.nodelist.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 936, in render bit = node.render_annotated(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 903, in render_annotated return self.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/loader_tags.py",
line 150, in render return compiled_parent._render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 163, in _render return self.nodelist.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 936, in render bit = node.render_annotated(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 903, in render_annotated return self.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/loader_tags.py",
line 62, in render result = block.nodelist.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 936, in render bit = node.render_annotated(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 903, in render_annotated return self.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/library.py",
line 234, in render return t.render(new_context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 173, in render return self._render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 163, in _render return self.nodelist.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 936, in render bit = node.render_annotated(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 903, in render_annotated return self.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/defaulttags.py",
line 309, in render return nodelist.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 936, in render bit = node.render_annotated(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 903, in render_annotated return self.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/defaulttags.py",
line 309, in render return nodelist.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 936, in render bit = node.render_annotated(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 903, in render_annotated return self.render(context) File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 986, in render output = self.filter_expression.resolve(context)
File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/django/template/base.py",
line 697, in resolve new_obj = func(obj, *arg_vals) File
"/var/lib/mailman/postorius/src/postorius/templatetags/nav_helpers.py",
line 80, in pending_subscriptions return
mlist.get_requests_count(token_owner='moderator') File
"/var/lib/mailman/venv3/lib64/python3.6/site-packages/mailmanclient/restbase/base.py",
line 124, in __getattr__ self.__class__.__name__, name))AttributeError:
'MailingList' object has no attribute 'get_requests_count'ERROR 2020-10-25
19:29:46,101 835 django.server "GET
/postorius/lists/mailteamhyd.dlist.nic.in/
<http://mailteamhyd.dlist.nic.in/> HTTP/1.1" 500 1162*
I don't see any error messages in the mailman.log. And I
also executed a few curl commands in getting the details of the lists
created and list info which I got their results successfully.
Could you please guide where exactly I am missing or do I
need to make any changes in my customizations ?
--
Thanks & Regards,
Shashi Kanth.K
9052671936
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campai…>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campai…>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
5 years, 1 month
Re: templates
by Odhiambo Washington
They're in the DB.
On Thu, May 4, 2023, 20:33 Christian via Mailman-users <
mailman-users(a)mailman3.org> wrote:
> I'm having issues with my lists. For each list I have created a template [
> list:user:action:subscribe ]which has a prospective subscriber have to
> consent to list rules before they are subscribed. This template I created
> is
> listed in Postorius for each list. I have noticed that there are no other
> templates listed in Postorius. Furthermore, there is no 'lists'
> subdirectory under Mailman's var/templates/.
>
>
>
> Help (please)!
>
>
>
> _______________________________________________
> Mailman-users mailing list -- mailman-users(a)mailman3.org
> To unsubscribe send an email to mailman-users-leave(a)mailman3.org
> https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
> Archived at:
> https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message…
>
> This message sent to odhiambo(a)gmail.com
>
2 years, 7 months
Re: Filter who can send on mailman3 list?
by Marcus Granath
Mark Sapiro wrote:
> > As Ruth said in her reply at
> https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message…
> in Postorius, go to the Users dropdown and select Non-Members. On that
> page there is a form to enter Email Address and Display Name with an Add
> nonmember button.
Sorry, but actually I can not find any "Users dropdown" to select "Non-Members" at any Postorius in my web interface. :-(
Maybe, could it be that I am actually not the admin of the mailman3 server, I'm "just" the admin of my mailman-list - so just admin for my mailman-list and not for the mailman server?
Maybe then I need to try contact our mailman server admin, or?
Or any other way for me as just an mailman-list admin to add this "Non-Member"?.... ;-)
4 years, 7 months
Re: changing adverstised status
by Abhilash Raj
On Wed, Aug 22, 2018, at 1:27 AM, Alexander Klotz wrote:
> Hi there,
>
> we are trying to set a once public list to private but have trouble
> doing so. In Postorius this doesn't seem to work - you can change "show
> list on index page" via the settings, but the value isn't saved. Is
> there a way to set advertised = False to a specific list via the shell?
Could be related to https://gitlab.com/mailman/postorius/merge_requests/352
The behavior of some of our boolean fields changed with newer releases of Django, but it has been fixed in master branch.
>
> Thanks & Regards,
> Alex
>
> (Kulturserver editorial staff)
> _______________________________________________
> Mailman-users mailing list -- mailman-users(a)mailman3.org
> To unsubscribe send an email to mailman-users-leave(a)mailman3.org
> https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
--
thanks,
Abhilash Raj (maxking)
7 years, 3 months
Re: changing default preferred language of list
by Mark Sapiro
On 3/29/22 13:01, Paul Paulchen wrote:
>
> As far as I understood, it should be pretty easy. My wish: every new list we create has a default value for the preferred language: de (instead of us)
...
> We put the values in:
>
> [mailman]
> default_language: de
>
> "/etc/mailman.cfg" and "/opt/mailman/mailman-extra.cfg"
> Nothing changes. When I create a new list via Postorius, is see the preferred language is US.
This is a bug in Mailman's REST API. I just created
https://gitlab.com/mailman/mailman/-/issues/997 for this.
Creating the list via `mailman create` sets the list's preferred
language as expected, but creating it via the REST API whoch Postorius
uses does not.
--
Mark Sapiro <mark(a)msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
3 years, 8 months
Re: [Django] ERROR (EXTERNAL IP): Service Unavailable
by dancab@caltech.edu
Thanks Mark. I can't see the held messages view at all for this list.
I don't think there's any sensitive info so I'm posting the entire message I get to the server admin email.
[Django] ERROR (EXTERNAL IP): Service Unavailable: /postorius/lists/cpa-announcement.caltech.edu/held_messages
root(a)mailman3.caltech.edu
Tue 2/23/2021 10:30 AM
Service Unavailable: /postorius/lists/cpa-announcement.caltech.edu/held_messages
Report at /postorius/lists/cpa-announcement.caltech.edu/held_messages
Service Unavailable: /postorius/lists/cpa-announcement.caltech.edu/held_messages
Request Method: GET
Request URL: https://mailman3.caltech.edu/postorius/lists/cpa-announcement.caltech.edu/h…
Django Version: 3.0.10
Python Executable: /opt/mailmanve/bin/python3
Python Version: 3.6.8
Python Path: ['/var/www/mailman-www', '/opt/mailmanve/bin', '/usr/lib64/python36.zip', '/usr/lib64/python3.6', '/usr/lib64/python3.6/lib-dynload', '/opt/mailmanve/lib64/python3.6/site-packages', '/opt/mailmanve/lib/python3.6/site-packages']
Server time: Tue, 23 Feb 2021 18:30:19 +0000
Installed Applications:
('hyperkitty',
'postorius',
'django_mailman3',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'django_gravatar',
'compressor',
'haystack',
'django_extensions',
'django_q',
'allauth',
'allauth.account',
'allauth.socialaccount')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django_mailman3.middleware.TimezoneMiddleware',
'postorius.middleware.PostoriusMiddleware')
Request information:
USER: dancab
GET: No GET data
POST: No POST data
FILES: No FILES data
COOKIES:
_ga = 'GA1.2.1144367399.1613604556'
csrftoken = 'CtA6fFlrwV2fkDonIRHKdBX3V1lRQJA7UjRxYE2nCGEi6s65mFkkLDe3EEKkxgyo'
sessionid = 'm1dqvcmvcs12dxc8pui8u2wrz5cncam4'
META:
CSRF_COOKIE = 'CtA6fFlrwV2fkDonIRHKdBX3V1lRQJA7UjRxYE2nCGEi6s65mFkkLDe3EEKkxgyo'
HTTP_ACCEPT = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'
HTTP_ACCEPT_ENCODING = 'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE = 'en-US,en;q=0.9,es-US;q=0.8,es;q=0.7'
HTTP_CONNECTION = 'Keep-Alive'
HTTP_COOKIE = '_ga=GA1.2.1144367399.1613604556; csrftoken=CtA6fFlrwV2fkDonIRHKdBX3V1lRQJA7UjRxYE2nCGEi6s65mFkkLDe3EEKkxgyo; sessionid=m1dqvcmvcs12dxc8pui8u2wrz5cncam4'
HTTP_HOST = 'mailman3.caltech.edu'
HTTP_PRAGMA = 'akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no, akamai-x-get-request-id,akamai-x-get-nonces,akamai-x-get-client-ip,akamai-x-feo-trace'
HTTP_REFERER = 'https://mailman3.caltech.edu/postorius/lists/cpa-announcement.caltech.edu/'
HTTP_SEC_FETCH_DEST = 'document'
HTTP_SEC_FETCH_MODE = 'navigate'
HTTP_SEC_FETCH_SITE = 'same-origin'
HTTP_SEC_FETCH_USER = '?1'
HTTP_UPGRADE_INSECURE_REQUESTS = '1'
HTTP_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36'
HTTP_X_FORWARDED_FOR = '131.215.248.132'
HTTP_X_FORWARDED_HOST = 'mailman3.caltech.edu'
HTTP_X_FORWARDED_PORT = '443'
HTTP_X_FORWARDED_PROTO = 'https'
HTTP_X_FORWARDED_SERVER = 'mailman3.caltech.edu'
PATH_INFO = '/postorius/lists/cpa-announcement.caltech.edu/held_messages'
QUERY_STRING = ''
RAW_URI = '/postorius/lists/cpa-announcement.caltech.edu/held_messages'
REMOTE_ADDR = '127.0.0.1'
REMOTE_PORT = '49702'
REQUEST_METHOD = 'GET'
SCRIPT_NAME = ''
SERVER_NAME = '127.0.0.1'
SERVER_PORT = '8000'
SERVER_PROTOCOL = 'HTTP/1.1'
SERVER_SOFTWARE = 'gunicorn/20.0.4'
gunicorn.socket = <socket.socket fd=15, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 8000), raddr=('127.0.0.1', 49702)>
wsgi.errors = <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f31f8c22f60>
wsgi.file_wrapper = ''
wsgi.input = <gunicorn.http.body.Body object at 0x7f31f8c22ef0>
wsgi.input_terminated = True
wsgi.multiprocess = False
wsgi.multithread = False
wsgi.run_once = False
wsgi.url_scheme = 'https'
wsgi.version = '(1, 0)'
Settings:
Using settings module settings
ABSOLUTE_URL_OVERRIDES = {}
ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
ACCOUNT_UNIQUE_EMAIL = True
ADMINS = "(('Mailman Suite Admin', 'dancab(a)its.caltech.edu'),)"
ALLOWED_HOSTS = ['api.mailman3.caltech.edu', 'mailman3.caltech.edu', 'www.mailman3.caltech.edu', 'www.lists.caltech.edu', 'lists.caltech.edu', 'localhost']
APPEND_SLASH = True
AUTHENTICATION_BACKENDS = "('django_auth_ldap.backend.LDAPBackend', 'django.contrib.auth.backends.ModelBackend')"
AUTH_LDAP_ALWAYS_UPDATE_USER = True
AUTH_LDAP_BIND_DN = ''
AUTH_LDAP_BIND_PASSWORD = '********************'
AUTH_LDAP_SERVER_URI = 'ldap://ldapslave5.caltech.edu'
AUTH_LDAP_START_TLS = True
AUTH_LDAP_USER_ATTR_MAP = {'username': 'uid', 'first_name': 'givenName', 'last_name': 'sn', 'email': 'mail'}
AUTH_LDAP_USER_SEARCH = <LDAPSearch: ou=Accounts,ou=ITS,o=Caltech,c=US>
AUTH_PASSWORD_VALIDATORS = '********************'
AUTH_USER_MODEL = 'auth.User'
BASE_DIR = '/var/www/mailman-www'
CACHES = {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS = 'default'
CACHE_MIDDLEWARE_KEY_PREFIX = '********************'
CACHE_MIDDLEWARE_SECONDS = 600
COMPRESSORS = {'css': 'compressor.css.CssCompressor', 'js': 'compressor.js.JsCompressor'}
COMPRESS_CACHEABLE_PRECOMPILERS = '()'
COMPRESS_CACHE_BACKEND = 'default'
COMPRESS_CACHE_KEY_FUNCTION = '********************'
COMPRESS_CLEAN_CSS_ARGUMENTS = ''
COMPRESS_CLEAN_CSS_BINARY = 'cleancss'
COMPRESS_CLOSURE_COMPILER_ARGUMENTS = ''
COMPRESS_CLOSURE_COMPILER_BINARY = 'java -jar compiler.jar'
COMPRESS_CSS_HASHING_METHOD = 'mtime'
COMPRESS_DATA_URI_MAX_SIZE = 1024
COMPRESS_DEBUG_TOGGLE = None
COMPRESS_ENABLED = True
COMPRESS_FILTERS = {'js': ['compressor.filters.jsmin.JSMinFilter'], 'css': ['compressor.filters.css_default.CssAbsoluteFilter']}
COMPRESS_JINJA2_GET_ENVIRONMENT = <function CompressorConf.JINJA2_GET_ENVIRONMENT at 0x7f31ffd0d268>
COMPRESS_MINT_DELAY = 30
COMPRESS_MTIME_DELAY = 10
COMPRESS_OFFLINE = False
COMPRESS_OFFLINE_CONTEXT = {'STATIC_URL': '/static/'}
COMPRESS_OFFLINE_MANIFEST = 'manifest.json'
COMPRESS_OFFLINE_TIMEOUT = 31536000
COMPRESS_OUTPUT_DIR = 'CACHE'
COMPRESS_PARSER = 'compressor.parser.AutoSelectParser'
COMPRESS_PRECOMPILERS = "(('text/less', 'lessc {infile} {outfile}'), ('text/x-scss', 'sassc -t compressed {infile} {outfile}'), ('text/x-sass', 'sassc -t compressed {infile} {outfile}'))"
COMPRESS_REBUILD_TIMEOUT = 2592000
COMPRESS_ROOT = '/var/www/mailman-www/static'
COMPRESS_STORAGE = 'compressor.storage.CompressorFileStorage'
COMPRESS_TEMPLATE_FILTER_CONTEXT = {'STATIC_URL': '/static/'}
COMPRESS_URL = '/static/'
COMPRESS_URL_PLACEHOLDER = '/__compressor_url_placeholder__/'
COMPRESS_VERBOSE = False
COMPRESS_YUGLIFY_BINARY = 'yuglify'
COMPRESS_YUGLIFY_CSS_ARGUMENTS = '--terminal'
COMPRESS_YUGLIFY_JS_ARGUMENTS = '--terminal'
COMPRESS_YUI_BINARY = 'java -jar yuicompressor.jar'
COMPRESS_YUI_CSS_ARGUMENTS = ''
COMPRESS_YUI_JS_ARGUMENTS = ''
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 = False
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.mysql', 'NAME': 'mailman3_prod', 'USER': 'mailman', 'PASSWORD': '********************', 'HOST': 'aus-sql1.caltech.edu', 'PORT': '3306', 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'OPTIONS': {}, 'TIME_ZONE': None, 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}}}
DATABASE_ROUTERS = []
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 = False
DEBUG_PROPAGATE_EXCEPTIONS = False
DECIMAL_SEPARATOR = '.'
DEFAULT_CHARSET = 'utf-8'
DEFAULT_EXCEPTION_REPORTER_FILTER = 'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL = 'postmaster(a)mailman3.caltech.edu'
DEFAULT_INDEX_TABLESPACE = ''
DEFAULT_TABLESPACE = ''
DISALLOWED_USER_AGENTS = []
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_HOST_PASSWORD = '********************'
EMAIL_HOST_USER = ''
EMAIL_PORT = 587
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 = 420
FILE_UPLOAD_TEMP_DIR = None
FILTER_VHOST = False
FIRST_DAY_OF_WEEK = 0
FIXTURE_DIRS = []
FORCE_SCRIPT_NAME = None
FORMAT_MODULE_PATH = None
FORM_RENDERER = 'django.forms.renderers.DjangoTemplates'
HAYSTACK_CONNECTIONS = {'default': {'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', 'PATH': '/var/www/mailman-www/fulltext_index'}}
IGNORABLE_404_URLS = []
INSTALLED_APPS = "('hyperkitty', 'postorius', 'django_mailman3', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount')"
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'), ('uz', 'Uzbek'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')]
LANGUAGES_BIDI = ['he', 'ar', 'fa', 'ur']
LANGUAGE_CODE = 'en-us'
LANGUAGE_COOKIE_AGE = None
LANGUAGE_COOKIE_DOMAIN = None
LANGUAGE_COOKIE_HTTPONLY = False
LANGUAGE_COOKIE_NAME = 'django_language'
LANGUAGE_COOKIE_PATH = '/'
LANGUAGE_COOKIE_SAMESITE = None
LANGUAGE_COOKIE_SECURE = False
LOCALE_PATHS = []
LOGGING = {'version': 1, 'disable_existing_loggers': False, 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}}, 'handlers': {'mail_admins': {'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler'}, 'file': {'level': 'DEBUG', 'class': 'logging.handlers.WatchedFileHandler', 'filename': '/var/www/mailman-www/logs/mailmansuite.log', 'formatter': 'verbose'}, 'console': {'class': 'logging.StreamHandler', 'formatter': 'simple'}}, 'loggers': {'django.request': {'handlers': ['mail_admins', 'file'], 'level': 'ERROR', 'propagate': True}, 'django': {'handlers': ['file'], 'level': 'ERROR', 'propagate': True}, 'hyperkitty': {'handlers': ['file'], 'level': 'DEBUG', 'propagate': True}, 'postorius': {'handlers': ['console', 'file'], 'level': 'DEBUG'}}, 'formatters': {'verbose': {'format': '%(levelname)s %(asctime)s %(process)d %(name)s %(message)s'}, 'simple': {'format': '%(levelname)s %(message)s'}}}
LOGGING_CONFIG = 'logging.config.dictConfig'
LOGIN_REDIRECT_URL = 'list_index'
LOGIN_URL = 'account_login'
LOGOUT_REDIRECT_URL = None
LOGOUT_URL = 'account_logout'
MAILMAN_ARCHIVER_FROM = "('127.0.0.1', '::1')"
MAILMAN_ARCHIVER_KEY = '********************'
MAILMAN_REST_API_PASS = '********************'
MAILMAN_REST_API_URL = '********************'
MAILMAN_REST_API_USER = '********************'
MANAGERS = []
MEDIA_ROOT = ''
MEDIA_URL = ''
MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
MESSAGE_TAGS = {40: 'danger'}
MIDDLEWARE = "('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django_mailman3.middleware.TimezoneMiddleware', 'postorius.middleware.PostoriusMiddleware')"
MIGRATION_MODULES = {}
MONTH_DAY_FORMAT = 'F j'
NUMBER_GROUPING = 0
PASSWORD_HASHERS = '********************'
PASSWORD_RESET_TIMEOUT_DAYS = '********************'
POSTORIUS_TEMPLATE_BASE_URL = 'http://mailman3.caltech.edu'
PREPEND_WWW = False
Q_CLUSTER = {'timeout': 300, 'save_limit': 100, 'orm': 'default'}
ROOT_URLCONF = 'urls'
SECRET_KEY = '********************'
SECURE_BROWSER_XSS_FILTER = False
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_HSTS_INCLUDE_SUBDOMAINS = False
SECURE_HSTS_PRELOAD = False
SECURE_HSTS_SECONDS = 0
SECURE_PROXY_SSL_HEADER = "('HTTP_X_FORWARDED_SCHEME', 'https')"
SECURE_REDIRECT_EXEMPT = []
SECURE_REFERRER_POLICY = None
SECURE_SSL_HOST = None
SECURE_SSL_REDIRECT = False
SERVER_EMAIL = 'root(a)mailman3.caltech.edu'
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 = False
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.PickleSerializer'
SETTINGS_MODULE = 'settings'
SHORT_DATETIME_FORMAT = 'm/d/Y P'
SHORT_DATE_FORMAT = 'm/d/Y'
SIGNING_BACKEND = 'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS = []
SITE_ID = 1
STATICFILES_DIRS = []
STATICFILES_FINDERS = "('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'compressor.finders.CompressorFinder')"
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT = '/var/www/mailman-www/static/'
STATIC_URL = '/static/'
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.template.context_processors.csrf', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'django_mailman3.context_processors.common', 'hyperkitty.context_processors.common', 'postorius.context_processors.postorius']}}]
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 = 'UTC'
USE_I18N = True
USE_L10N = True
USE_THOUSAND_SEPARATOR = False
USE_TZ = True
USE_X_FORWARDED_HOST = True
USE_X_FORWARDED_PORT = False
WSGI_APPLICATION = 'wsgi.application'
X_FRAME_OPTIONS = 'DENY'
YEAR_MONTH_FORMAT = 'F Y'
4 years, 9 months
Re: Help with installing Postorius and Hyperkitty on Ubuntu 19
by Mark Sapiro
On 6/8/19 4:04 AM, Andrew Bernard wrote:
>
> Where is the Django config area for the
> pip installed modules? It is this that I find obscure.
The short answer is wherever you put it. If you look at
<https://wiki.list.org/DOC/Mailman%203%20installation%20experience>
which Abhilash mentioned, you'll see what I do.
Abhilash mentioned creating the virtualenv in /opt/mailman/. I actually
have another level below that, /opt/mailman/mm/, but this is only for
convenience to separate things as I also have directories for the git
branches and for local patches, so if we are just working with
/opt/mailman/, you can put your Django settings.py and settings_local.py
files there. I also put various other config things there like
Mailman's var/ directory
Django's static/ directory
mailman.cfg
mailman-hyperkitty.cfg
gunicorn.conf
and an empty __init__.py file so Django can import settings.
Then I create a /opt/mailman/bin/ directory and in that I put small bash
scripts to run things.
for example:
opt/mailman/bin/mailman contains
#!/bin/bash
unset PYTHONSTARTUP
exec /opt/mailman/venv/bin/mailman \
-C "/opt/mailman/mm/mailman.cfg" \
$@
opt/mailman/bin/django-admin contains
#!/bin/bash
. /opt/mailman/venv/bin/activate
cd /opt/mailman/
export PYTHONPATH=/opt/mailman/
export DJANGO_SETTINGS_MODULE=settings
django-admin $@
and opt/mailman/bin/gunicorn contains
#!/opt/mailman/venv/bin/python
import sys
sys.path[0:0] = [
'/opt/mailman/',
]
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import gunicorn.app.wsgiapp
if __name__ == '__main__':
sys.exit(gunicorn.app.wsgiapp.run())
Then I use those commands to run Mailman, Django and gunicorn. Some of
this may not be directly applicable to you, but I hope it gives you the
basic idea.
--
Mark Sapiro <mark(a)msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
6 years, 5 months
Re: How to change the language in mailman3
by Mark Sapiro
On 7/17/20 9:44 AM, Massimo Zappalà wrote:
> Hi everyone,
> Mark thanks for the reply.
> My installation was done on Debian Buster by installing the mailman3-full package
>
> I can't find the path you indicated:
>> Mailman core in mailman/messages/
>> Hyperkitty in hyperkitty/local/
>> django-mailman3 in django-mailman3/local/
>> postorius in postorius/local/
> Maybe some packages are missing?
I doubt things are missing. I can't keep track of where all the
downstream packages put things, but look in /usr/lib/mailman and/or
/var/lib/mailman or use tools like `find` or `locate`.
>> To set language for Django (i.e. hyperkitty and postorius) see
>> https://docs.djangoproject.com/en/3.0/topics/i18n/translation/#how-django-di....
> What are the files to be edited?
settings_local.py
>> For Mailman core, set [mailman] default_language: in mailman.cfg.
> Ok Done
>
>> You also need to (re)generate the .mo file which can be done with the
>> generate_mo.sh script.
> I can't find the script
It probably isn't included in the Debian package. This is what it does.
#!/bin/bash
# This script generates .mo files from all the .po files in the source.
echo 'Generating mo files for GNU Mailman ...'
for file in `find -name 'mailman.po'`
do
echo $file
msgfmt $file -o ${file/po/mo} -v
done
>> For Django, you need to generate .mo files with
>> django_admin compilemessages
> Where should this be written?
You give the compilemessages subcommand to whatever command you use for
django-admin or manage.py or whatever the Debian package calls it.
--
Mark Sapiro <mark(a)msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
5 years, 4 months
Re: nginx configuration on a multitasking server
by Mark Sapiro
On 12/23/21 9:57 AM, David Newman wrote:
>
> The task-pending message that MM3 sends to list owners and moderators
> just says generically to check the dashboard, without providing a URL.
>
> Can that be modified to provide an explicit URL, something like this?
>
> https://lists.example.com/mailman3/lists/listname
Yes, That particular message is built from the list:admin:action:post
template. You may wish to make custom versions of that and other
templates. The templates and their default values are at
https://gitlab.com/mailman/mailman/-/tree/master/src/mailman/templates/en
You can make custom versions of templates in two ways. You can create if
necessary a /opt/mailman/mm/var/templates directory (it probably already
exists). Within that directory, sitewide English templates are put in
the site/en/ directory, domain specific English templates are put in the
domains/<domain_name>/en/ directory and list specific English templates
are put in the lists/<list_id>/en/ directory.
For templates like this, you probably want sitewide ones. E.g.,
site/en/list:admin:action:post.txt
---------------------------------------------------------------
As list administrator, your authorization is requested for the
following mailing list posting:
List: $listname
From: $sender_email
Subject: $subject
The message is being held because:
$reasons
At your convenience, visit
https://lists.example.com/mailman3/lists/$list_id/held_messages
to approve or deny the request.
---------------------------------------------------------------
The other way to create custom templates is via Postotrius, but
Postorius only creates list and domain specific templates. Also, if you
create a template in Postorius, it overrides any in
/opt/mailman/mm/var/templates/ until you delete it in Postorius.
Info about templates and what substitution variables can be used is at
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/…
--
Mark Sapiro <mark(a)msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
3 years, 11 months
Re: New year releases!
by Mark Sapiro
On 1/4/23 14:41, Mark Sapiro wrote:
> On 1/4/23 13:54, Dan Caballero wrote:
...
>> File "/var/www/mailman-www/urls.py", line 20, in <module>
>> from django.conf.urls import include, url
>> ImportError: cannot import name 'url' from 'django.conf.urls'
>> (/opt/mailmanve/lib/python3.9/site-packages/django/conf/urls/__init__.py)"
>
>
> In Django 3.1 django.conf.urls.url was a deprecated alias to
> django.urls.re_path and in Django 4.0 it was removed. See, e.g.
> <https://docs.djangoproject.com/en/3.2/ref/urls/> and
> <https://docs.djangoproject.com/en/4.0/ref/urls/>.
>
> However, the above Traceback doesn't identify which module contains the
>
> from django.conf.urls import include, url
Looking more closely, I see that it does. It is
/var/www/mailman-www/urls.py.
That file probably has contents like
```
from django.conf.urls import include, url
from django.contrib import admin
from django.urls import reverse_lazy
from django.views.generic import RedirectView
urlpatterns = [
url(r'^$', RedirectView.as_view(
url=reverse_lazy('list_index'),
permanent=True)),
url(r'^postorius/', include('postorius.urls')),
url(r'^hyperkitty/', include('hyperkitty.urls')),
url(r'', include('django_mailman3.urls')),
url(r'^accounts/', include('allauth.urls')),
# Django admin
url(r'^admin/', admin.site.urls),
]
```
That needs to be changed to
```
from django.contrib import admin
from django.urls import include, reverse_lazy, re_path
from django.views.generic import RedirectView
urlpatterns = [
re_path(r'^$', RedirectView.as_view(
url=reverse_lazy('list_index'),
permanent=True)),
re_path(r'^postorius/', include('postorius.urls')),
re_path(r'^hyperkitty/', include('hyperkitty.urls')),
re_path(r'', include('django_mailman3.urls')),
re_path(r'^accounts/', include('allauth.urls')),
# Django admin
re_path(r'^admin/', admin.site.urls),
]
```
--
Mark Sapiro <mark(a)msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
2 years, 11 months