Search results for query "sapiro"
- 6292 messages
[MM3-users] Re: postfix malformed address with confirm replies
by Stephen Mats Mats
> On Feb 28, 2021, at 01:32, Stephen J. Turnbull <turnbull.stephen.fw(a)u.tsukuba.ac.jp> wrote:
>
> Mark Sapiro writes:
>> On 2/27/21 4:36 AM, Stephen J. Turnbull wrote:
>
>>> is legal, and I think that most servers will accept it, but RFC
>>> 5321 sets a limit of 64 octets on mailboxes[1], and your
>>> confirmation mailbox is 67 octets.
>>
>> Since the -confirm+<token> part is fixed at 49 octets, this would imply
>> a limit in list names of 15 octets. Ouch!
>
> I'm pretty sure we would have run into this before, if there were a
> lot of servers out there imposing this limit. 15 octets is pretty
> darn short, there are probably quite a few list names out there longer
> than that. Not to mention that the RFC itself says "you SHOULD NOT be
> a jerk about this". :-) So I don't think this is a big problem in
> practice, and I hope Steve can reconfigure the obstructive server to
> not be so picky.
>
To be clear the 'obstructive server’ is mailman-core. :)
[ec2-user@ip-172-31-18-xxx ~]$ telnet 172.19.199.2 8024
Trying 172.19.199.2...
Connected to 172.19.199.2.
Escape character is '^]'.
220 mailman-core GNU Mailman LMTP runner 2.0
LHLO ip-172-31-18-xxx.us-west-2.compute.internal
250-mailman-core
250-SIZE 33554432
250-8BITMIME
250 HELP
MAIL FROM:<stephen.s.w.matsmats(a)gmail.com>
250 OK
RCPT TO:<matsmats-mm3-test1-confirm+d6f77a2572ef55a8b2c4ca0d77de8493fbb55856(a)mm3.aca-aws.s.uw.edu>
553 5.1.3 Error: malformed address
RCPT TO:<matsmats-mm3-test1-confirm+d6f77a2572ef55a8b2c4ca0d77de8493fbb55(a)mm3.aca-aws.s.uw.edu>
250 OK
quit
221 Bye
Didn’t really dig but my guess would be the LMTP from aiosmtpd.lmtp is actually throwing the 553.
For a bit of context, of the 25,801 mailman2 lists we have here at University of Washington 5,211 have names longer than 15 characters (we don’t have any lists with multibyte characters in their names). Our longest list name is 33 characters. I didn’t dump every config to see the number of lists that subscribe_policy set to confirm or confirm and approve. But I expect it’s a small minority.
steve
> For Mailman, I doubt we need a full SHA1 (?) for the purpose. We can
> truncate the thing, probably opportunistically (ie, so the whole
> confirmation mailbox fits in 64 octets, or we could even parse the
> bounce message and resend only if we run into a problem).
>
> Steve
> _______________________________________________
> 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/
5 years, 6 months
[MM3-users] Non-ascii characters missing from Pipermail archive txt and gz downloads
by Mark Dale
Mailman 2.1.34
Debian 10
Postfix
Hi
I'm hoping someone can shine a light on character encoding issue I've encountered.
A plain-text email with non-ascii characters in the body gets posted to the list.
As per Mark Sapiro's guide I've captured the incoming message to file.
- https://www.mail-archive.com/mailman-users@python.org/msg73469.html
The message is received by Mailman with the non-ascii characters displaying correctly.
The header of that message has:
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.9.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Language: en-AU
Content-Transfer-Encoding: 8bit
In the list's mbox file and archive webpage, the message displays the non-ascii characters correctly.
In the archive's downloaded .txt (and also .gz) file, the non-ascii characters are missing and displayed as "?".
I've copied the message text in below, from both the correct one from the email and the erroneous .txt file. Hopefully they won't get scrambled up when I send this.
Any advice on getting the non-ascii characters written into the archive .txt file would be gratefully received.
Thanks,
Mark
=== Message text as okay in mbox and as shown on the archive webpage ===
If one goes by the definition of veḷippaṭai as given in the Tamil Lexicon that the meaning of an ambiguous word should be disambiguated by a qualifying word, then aruvi āmpal does not conform to that definition since in the case of aruvi āmpal in Patiṟṟuppattu 63, aruvi is really made up of aru+vi, a compound. Moreover, the expression aṭai aṭuppu aṟiyā is already there to clarify that āmpal is a number and not a flower. Thus, aruvi simply provides information in addition to aṭai aṭuppu aṟiyā that āmpal is not a flower. The modern commentator Aruḷampalavaṉār also does not call it veḷippaṭai.
===
=== Message text with missing characters in te archive's txt and gz downloads ==
If one goes by the definition of ve?ippa?ai as given in the Tamil Lexicon that the meaning of an ambiguous word should be disambiguated by a qualifying word, then aruvi ?mpal does not conform to that definition since in the case of aruvi ?mpal in Pati??uppattu 63, aruvi is really made up of aru+vi, a compound. Moreover, the expression a?ai a?uppu a?iy? is already there to clarify that ?mpal is a number and not a flower. Thus, aruvi simply provides information in addition to a?ai a?uppu a?iy? that ?mpal is not a flower. The modern commentator Aru?ampalava??r also does not call it ve?ippa?ai.
===
5 years, 5 months
[MM3-users] Re: Message-Footer after migrating to Mailman3
by Abhilash Raj
> On Jul 9, 2021, at 9:15 AM, christopher.claus(a)tgcamberg1848.de wrote:
>
> Mark Sapiro wrote:
>>> ERROR 2021-05-24 16:22:22,895 1648 django.security.DisallowedHost Invalid HTTP_HOST header: 'tgc_mailman_web:8000'. The domain name provided is not valid according to RFC 1034/1035.
>>> WARNING 2021-05-24 16:22:22,896 1648 django.request Bad Request: /postorius/api/templates/list/homepage.gruppe.tgcamberg1848.de/list:member:regular:footer
>>> It appears you created the new template with Postorius, but there is an
>> issue for Postorius templates. Possibly your Django setting for
>> POSTORIUS_TEMPLATE_BASE_URL needs to be adjusted.
>>> Obviously I have a problem with the hostname. I set
>>> [code]
>>> POSTORIUS_TEMPLATE_BASE_URL=http://tgc_mailman_web:8000
>>> [/code]
>>> where tgc_mailman_web is my container name. This URL ist stored in the DB-table "template" for the name=list:member:regular:footer. A call to my fqdn or to localhost
>>> [code]
>>> wget http://localhost:8000/postorius/api/templates/list/homepage.gruppe.tgcamberg...
>>> [/code]
>>> will return the footer itself - this works fine. Therefore, should i set POSTORIUS_TEMPLATE_BASE_URL to http://localhost:8000?
>>> If that works, yes.
>
> Hi Mark,
>
> thanks for your reply and excuse my delay. I was very busy in the last weeks but made some tests. Newly created templates with POSTORIUS_TEMPLATE_BASE_URL=http://localhost:8000 did not work. I changed it to my fqdn - at the moment I am able to access the template via this URl (e.G. http://lists.example.de:8000/postorius/api/templates/list/homepage.lists.ex…)
> But if I try to send an email I got the following error:
You want the URL at which Postorius (postorius) is available from Core (mailman-core container). The default for that in the container images is set to http://mailman-web:8000. Does that not work for you?
If you want to verify, you want to exec into the Core’s container (`docker exec -it mailman-core bash`) and see if you can curl the URL from inside there. If you are using the default docker-compose-postorius.yaml then there is a /etc/hosts entry created by docker for the mailman-web container, hence `http://mailman-web:8000` works there (but it won’t work on the host, since docker doesn’t modify the host’s /etc/hosts).
There might also be a bug in play here which would cause such connection refused errors when subscribing/unsubscribing when there was a template configured for the list. Is that the case for you or are you seeing always when trying to send the email (which would imply that the Web container simply isn’t reachable from Core).
--
thanks,
Abhilash Raj (maxking)
5 years
[MM3-users] Re: Core, Hyperkitty and Postorius releases
by Odhiambo Washington
On Sat, May 15, 2021 at 12:24 AM Abhilash Raj <maxking(a)asynchronous.in>
wrote:
>
>
> On Fri, May 14, 2021, at 2:16 PM, Odhiambo Washington wrote:
> > On Sat, May 15, 2021 at 12:01 AM Mark Sapiro <mark(a)msapiro.net> wrote:
> >
> > > On 5/14/21 1:54 PM, Odhiambo Washington wrote:
> > > >
> > > > /usr/local/include/sass
> > > >
> > > > That is the only thing found that is in the base system.
> > >
> > > And that's the one you want. What is it's mode?
> > >
> >
> > root@gw:/usr/home/wash # ls -al /usr/local/include/sass
> > total 104
> > drwxr-xr-x 2 root wheel 512 Apr 16 16:49 .
> > drwxr-xr-x 176 root wheel 10240 Apr 19 18:05 ..
> > -rw-r--r-- 1 root wheel 2369 Apr 8 11:08 base.h
> > -rw-r--r-- 1 root wheel 10742 Apr 8 11:08 context.h
> > -rw-r--r-- 1 root wheel 6632 Apr 8 11:08 functions.h
> > -rw-r--r-- 1 root wheel 6489 Apr 8 11:08 values.h
> > -rw-r--r-- 1 root wheel 198 Apr 8 11:08 version.h
> >
> > I imagined I needed an executable.
>
> This sounds like a result of you running `pip3 install sass`, probably
> with sudo
> which failed mid-way due to the exception you posted above.
>
Closer to the truth! It failed. I was running this from within the
virtualenv.
> Which OS are you using?
FreeBSD.
> On debian/ubuntu, you can install:
>
> sudo apt install sassc
>
Do I need to install sassc in the base OS or in the virtualenv?
> I am not exactly sure how it got removed during your upgrade
> to the new version of Mailman since it shouldn't affect your system
> packages.
>
The funny part is my MM3 used to run. Mark took so much hand-holding for me
to get it running.
Then one day I used the update process and things got hosed.
The happy part is that I had not put any production lists on MM3 as I
hadn't developed the confidence of managing it.
Did you install Mailman initially using system packages or instructions
> provided at [1]?
>
> [1]:
> https://docs.mailman3.org/en/latest/install/virtualenv.html#virtualenv-inst…
No. I relied on
https://wiki.list.org/DOC/Mailman%203%20installation%20experience. This is
way back!
Your new link is recent, no?
--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v "^$|^.*#" :-)
5 years, 4 months
[MM3-users] Re: Errors while importing mm2 list archives - SOLVED
by Odhiambo Washington
On Tue, Dec 20, 2022 at 9:50 AM Odhiambo Washington <odhiambo(a)gmail.com>
wrote:
>
>
> On Tue, Dec 20, 2022 at 3:52 AM Mark Sapiro <mark(a)msapiro.net> wrote:
>
>> On 12/17/22 23:22, Odhiambo Washington wrote:
>> >
>> > I have dropped the DB, recreated, ...
>>
>> When you created the DB did you specify `CHARACTER SET utf8mb4`, e.g.
>>
>> CREATE DATABASE mailmansuite CHARACTER SET utf8mb4
>>
>
> Yes. That is what I do at the minimum for my databases unless specific
> instructions exist against it.
> So it seems like I have done everything that is commonly expected, but the
> import still fails on several messages.
>
It turns out that all this time I was barking up the wrong tree!
I was having all my modifications in /etc/mailman3/*.
When I did run 'mailman info', the information that came out is that
mailman was actually reading /opt/mailman/mm/mailman.cfg
I then just moved all the files I had put in /etc/mailman3/ to
/opt/mailman/mm/.
There is a WARNING on
https://docs.list.org/en/latest/install/virtualenv.html#virtualenv-install
which says one must create the config file as /etc/mailman3/mailman.cfg
How to force mailman to read that file is something I haven't understood,
but turns out to be what has taken me days trying to get things right.
Ultimately, when I did the import, there was only one email from the
archives that failed to be imported - which I honestly don't mind, but
maybe there is a solution for this
"'utf-8' codec can't encode character '\udcae' in position 331: surrogates
not allowed" ??
(venv) [mailman@gw ~/mm]$ /opt/mailman/mm/bin/django-admin
hyperkitty_import -l kictanet(a)lists.kictanet.or.ke
/usr/local/mailman2/archives/private/kictanet.mbox/kictanet.mbox
Importing from mbox file
/usr/local/mailman2/archives/private/kictanet.mbox/kictanet.mbox to
kictanet(a)lists.kictanet.or.ke
21%*Failed adding message
<1260802782.6596.1350003565(a)webmail.messagingengine.com
<1260802782.6596.1350003565(a)webmail.messagingengine.com>>: 'utf-8' codec
can't encode character '\udcae' in position 331: surrogates not allowed*
Computing thread structure
Synchronizing properties with Mailman
915 emails left to refresh, checked 0
767 emails left to refresh, checked 0
Warming up cache
The full-text search index is not updated for this list. It will not be
updated by the 'minutely' incremental update job. To update the index for
this list, run the Django admin command with arguments
'update_index_one_list kictanet(a)lists.kictanet.or.ke'.
(venv) [mailman@gw ~/mm]$
--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
3 years, 8 months
[MM3-users] Re: "Delete this thread" -> 'HTTP-500 -> NoneType' object has no attribute 'all'
by Simon Liebold
Am 28.05.2017 um 21:16 schrieb Mark Sapiro:
>
> I just tested this on another list on this server. and both 'delete
> message' and 'delete thread' worked for me with the latest release
> Hyperkitty 1.1.0, django_mailman3 1.1.0 and Django-1.10.7.
>
> Did you get to the confirmation page and then get the 500 or did the 500
> come before getting the confirmation page? Is there a full traceback in
> mailman_web.log?
>
I didn't find a 'delete message' button. But "Delete this thread" went
straight to the 500. Both, Hyperkitty and django-mailman are up-to-date
with master.
ERROR 2017-05-28 13:04:14,496 29835 django.request Internal Server
Error:
/hyperkitty/list/simsimmer@lists.simonliebold.de/thread/4I2TRZTFXMMH2XRQAS73IAEIYROFE5YM/delete
Traceback (most recent call last):
File
"/opt/mailman/venv-2.7/local/lib/python2.7/site-packages/Django-1.11rc1-py2.7.egg/django/core/handlers/exception.py",
line 41, in inner
response = get_response(request)
File
"/opt/mailman/venv-2.7/local/lib/python2.7/site-packages/Django-1.11rc1-py2.7.egg/django/core/handlers/base.py",
line 249, in _legacy_get_response
response = self._get_response(request)
File
"/opt/mailman/venv-2.7/local/lib/python2.7/site-packages/Django-1.11rc1-py2.7.egg/django/core/handlers/base.py",
line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File
"/opt/mailman/venv-2.7/local/lib/python2.7/site-packages/Django-1.11rc1-py2.7.egg/django/core/handlers/base.py",
line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File
"/opt/mailman/venv-2.7/local/lib/python2.7/site-packages/Django-1.11rc1-py2.7.egg/django/contrib/auth/decorators.py",
line 23, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/opt/mailman/hyperkitty/hyperkitty/lib/view_helpers.py", line
141, in inner
return func(request, *args, **kwargs)
File "/opt/mailman/hyperkitty/hyperkitty/views/message.py", line 306,
in delete
form = MessageDeleteForm(initial={"email": initial})
File
"/opt/mailman/venv-2.7/local/lib/python2.7/site-packages/Django-1.11rc1-py2.7.egg/django/forms/forms.py",
line 96, in __init__
self.fields = copy.deepcopy(self.base_fields)
File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib/python2.7/copy.py", line 328, in _reconstruct
args = deepcopy(args, memo)
File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
y = copier(x, memo)
File "/usr/lib/python2.7/copy.py", line 237, in _deepcopy_tuple
y.append(deepcopy(a, memo))
File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
y = copier(x, memo)
File "/usr/lib/python2.7/copy.py", line 230, in _deepcopy_list
y.append(deepcopy(a, memo))
File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
y = copier(x, memo)
File "/usr/lib/python2.7/copy.py", line 230, in _deepcopy_list
y.append(deepcopy(a, memo))
File "/usr/lib/python2.7/copy.py", line 174, in deepcopy
y = copier(memo)
File
"/opt/mailman/venv-2.7/local/lib/python2.7/site-packages/Django-1.11rc1-py2.7.egg/django/forms/models.py",
line 1168, in __deepcopy__
result.queryset = self.queryset.all()
AttributeError: 'NoneType' object has no attribute 'all'
Simon
9 years, 3 months
[MM3-users] Re: Mailman issues after re-boot
by Odhiambo Washington
On Sat, Sep 16, 2023 at 5:49 PM Paul Rubin <paulrubin37(a)gmail.com> wrote:
> *<< I sent this to the mailman3 issues on gitlab and Mark replied but asked
> me to move to this list, so I copied everything and inserted responses. I
> hope this makes sense and someone can help me.>>*
>
> After a lengthy power failure I had to reboot a machine that has been
> running for several years. the WEB-UI does not seem to be able to see
> mailman-core. I have looked for log entries that might explain what the
> issue is and I am stumped to even find logs that will update when I get an
> error on the browser. Mailman is definitely running, postgres is running
> and mailman web is running. if I go to the lists page I see lists, if I try
> to access a specific list I get Server error: An error occurred while
> processing your request.
>
> I looked in /var/logs/mailman /opt/mailman/web/mailmanweb
>
> All I can find is:
>
> django.urls.exceptions.NoReverseMatch: Reverse for
> 'list_unsubscription_requests' not found.
> 'list_unsubscription_requests' is not a valid view function or pattern
> name.16688 ERROR 2023-09-12 13:56:58,430 1760 django.request Internal
> Server Error: /mailman3/lists/goodstein.goodstein.org/ File
> "/opt/mailman/venv/lib64/python3.8/site-packages/haystack/admin.py",
> line 8, in <module> from django.utils.translation import
> ungettextImportError: cannot import name 'ungettext' from
> 'django.utils.translation'
>
> (/opt/mailman/venv/lib64/python3.8/site-packages/django/utils/translation/__init__.py)
>
> Also I have to run mailman from "mailman start" because the systemctl
> returns this:
>
> ● mailman3.service - GNU Mailing List Manager Loaded: loaded
> (/etc/systemd/system/mailman3.service; enabled; vendor preset:
> disabled) Active: failed (Result: exit-code) since Tue 2023-09-12
> 10:06:31 EDT; 13s ago Process: 31159
> ExecStart=/opt/mailman/venv/bin/mailman start (code=exited,
> status=1/FAILURE) CPU: 806msSep 12 10:06:31 mail
> mailman[31159]: Error in atexit._run_exitfuncs:Sep 12 10:06:31 mail
> mailman[31159]: Traceback (most recent call last):Sep 12 10:06:31 mail
> mailman[31159]: File "/usr/lib64/python3.8/logging/__init__.py",
> line 2126, in shutdownSep 12 10:06:31 mail mailman[31159]:
> h.flush()Sep 12 10:06:31 mail mailman[31159]: File
> "/opt/mailman/venv/lib64/python3.8/site-packages/mailman/core/logging.py",
> line 67, in flushSep 12 10:06:31 mail mailman[31159]: if
> self._stream:Sep 12 10:06:31 mail mailman[31159]: AttributeError:
> 'ReopenableFileHandler' object has no attribute '_stream'Sep 12
> 10:06:31 mail systemd[1]: mailman3.service: Control process exited,
> code=exited, status=1/FAILURESep 12 10:06:31 mail systemd[1]:
> mailman3.service: Failed with result 'exit-code'.Sep 12 10:06:31 mail
> systemd[1]: Failed to start GNU Mailing List Manager.
>
> Please tell me where to start looking or adjusting.
>
>
> Reply from Mark Sapiro,* Edited to include responses:*
>
> Mark Sapiro <https://gitlab.com/msapiro>@msapiro
> <https://gitlab.com/msapiro>· 1 day ago
> <https://gitlab.com/mailman/mailman-web/-/issues/23#note_1557601916>
> Owner
> Add reaction
> More actions
>
> The mailman-users(a)mailman3.org list is probably a more appropriate place
> for issues like this.
>
> django.urls.exceptions.NoReverseMatch: Reverse for
> 'list_unsubscription_requests' not found. 'list_unsubscription_requests' is
> not a valid view function or pattern name. 16688 ERROR 2023-09-12
> 13:56:58,430 1760 django.request Internal Server Error: /mailman3/lists/
> goodstein.goodstein.org/
>
> /opt/mailman/venv/lib64/python3.8/site-packages/postorius/urls.py should
> contain
>
> re_path( r'^unsubscription_requests$',
> list_views.list_unsubscription_requests,
> name='list_unsubscription_requests', ),
>
> Y
>
> *Yes this exists*
>
> and /opt/mailman/venv/lib64/python3.8/site-packages/postorius/views/list.py
> should define list_unsubscription_requests.
>
> *Yes there is a method by this name defined*
>
> File "/opt/mailman/venv/lib64/python3.8/site-packages/haystack/admin.py",
> line 8, in from django.utils.translation import ungettext ImportError:
> cannot import name 'ungettext' from 'django.utils.translation'
> (/opt/mailman/venv/lib64/python3.8/site-packages/django/utils/translation/
> *init*.py)
>
> See
>
> https://docs.djangoproject.com/en/4.2/internals/deprecation/#deprecation-re…
> -
> ungettext() is removed from django>=4.0
>
> Sep 12 10:06:31 mail mailman[31159]: AttributeError:
> 'ReopenableFileHandler' object has no attribute '_stream'
>
> I don't understand this one offhand, but what is the content of
> /etc/systemd/system/mailman3.service, in particular the settings for User,
> Group and ExecStart?
>
> *The service looks right:*
>
> 1 [Unit]
> 2 Description=GNU Mailing List Manager
> 3 After=syslog.target network.target postgresql.service
> 4
> 5 [Service]
> 6 Type=forking
> 7 PIDFile=/opt/mailman/mm/var/master.pid
> 8 User=mailman
> 9 Group=mailman
> 10 ExecStart=/opt/mailman/venv/bin/mailman start
> 11 ExecReload=/opt/mailman/venv/bin/mailman restart
> 12 ExecStop=/opt/mailman/venv/bin/mailman stop
> 13
> 14 [Install]
> 15 WantedBy=multi-user.target
>
> *It seems I may have two versions of the mailman script:*
>
> mail:/opt/mailman # which mailman
> /usr/bin/mailman
> mail:/opt/mailman # ls -al /usr/bin/mailman
> -rwxr-xr-x 1 root root 382 May 10 2021 /usr/bin/mailman
> mail:/opt/mailman # ls -al /opt/mailman/venv/bin/mailman
> -rwxr-xr-x 1 mailman mailman 231 Sep 12 10:02 /opt/mailman/venv/bin/mailman
>
> Somehow, your installation is corrupted. I don't know how
>
> *I need to know what to remove, how to correctly update, etc., That said
> the two scripts appear to be very similar:*
>
> mail:/opt/mailman # head /usr/bin/mailman
>
> #!/usr/bin/python3
> # EASY-INSTALL-ENTRY-SCRIPT: 'mailman==3.3.4','console_scripts','mailman'
> __requires__ = 'mailman==3.3.4'
> import re
> import sys
> from pkg_resources import load_entry_point
>
> if __name__ == '__main__':
> sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
> sys.exit(
>
>
> mail:/opt/mailman # head /opt/mailman/venv/bin/mailman
> #!/opt/mailman/venv/bin/python3
> # -*- coding: utf-8 -*-
> import re
> import sys
> from mailman.bin.mailman import main
> if __name__ == '__main__':
> sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
> sys.exit(main())
> mail:/opt/mailman #
>
> *Given the two years since the last reboot I also tried following *
> https://docs.mailman3.org/en/latest/upgrade-guide.html *to make sure I was
> running the latest*
>
> pip install -U mailman postorius django-mailman3 hyperkitty mailman-web
>
Why don't you try and do a fresh virtualenv install and move your configs
into it?
1. cd /opt
2. mv mailman _mailman.BAK
3. Create a backup of the database.
Then follow this:
https://docs.mailman3.org/en/latest/install/virtualenv.html#virtualenv-inst…,
but do not create the database as it already exists.
You also do not need to run any database migrations, so you can actually
skip those
You just need to ensure that `mailman info` says that its configuration
files are in /etc/mailman3/
Create the necessary directories as per the above installation instructions.
--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
[How to ask smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html]
2 years, 11 months
[MM3-users] Lessons learned and a couple little gotcha for newbies
by William Oliver
I just finished, with great help from Mark Sapiro on the list, a new
installation of mailman3.
I used the instructions at
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/insta…
and
https://docs.mailman3.org/en/latest/install/virtualenv.html
There were a couple of gotchas that I didn't see well documented.
1) I got the error
django.template.library.InvalidTemplateLibrary: Invalid template
library specified. ImportError raised when trying to load
'hyperkitty.templatetags.decorate': cannot import name 'escape_html'
from 'mistune.scanner' (/opt/mailman/venv/lib/python3.9/site-
packages/mistune/scanner.py)
when I ran 'mailman-web migrate'
The fix was trivial: I just added the lines:
from mistune.util import escape_html
from mistune.util import escape_url
to
/opt/mailman/venv/lib/python3.9/site-packages/mistune/scanner.py
It's not hard to search for those definitions, but if someone doesn't
know a smattering of python, it might not be obvious.
2) Similarly, migrate (using postgres) also gave the error:
File "/opt/mailman/venv/lib/python3.9/site-
packages/django/db/backends/postgresql/utils.py", line 6, in
utc_tzinfo_factory
raise AssertionError("database connection isn't set to UTC")
I was able to find a discusson of this one at
https://stackoverflow.com/questions/68024060/assertionerror-database-connec…
which had me downgrade to an older version of psycopg2-binary:
pip install psycopg2-binary==2.8.6
There might be a different fix, but this worked.
3) When I ran the test "uwsgi --ini /etc/mailman3/uwsgi.ini" I got the
error:
ModuleNotFoundError: No module named 'settings'
This was also trivially fixed by adding the path:
export PYTHONPATH=$PYTHONPATH:/etc/mailman3
in /opt/mailman/.bashrc
4) Sometimes when I rebooted the machine, when I ran 'systemctl start
mailman3' I'd get the error that mailman wouldn't start because the
lock was stll there. I never could figure out where the lock was, so I
worked around it by replacing
ExecStart=/opt/mailman/venv/bin/mailman start
with
ExecStart=/opt/mailman/venv/bin/mailman start --force
in /etc/systemd/system/mailman3.service
I'm sure there's something bad about doing that, but it works for me,
so far.
5) I had a problem with mail to outside people not being delivered
while mail to the local host was delivered. It turned out that this was
because in my mailman.cfg I had "smtp_host:my.listserver.tld when it
should have been localhost. The error was "relay access denied." To
fix this, I had to add my.listserver.tld to "mynetworks" in
/etc/postfix/main.cf, ie change:
mynetworks = 127.0.0.0/8 10.0.0.0/24
to
mynetworks = 127.0.0.0/8 10.0.0.0/24 111.222.333.444 <--- my ip address
However, Mark Sapiro (a God) told me this was because I had changed a
line in the [mta] section of mailman.cfg. I had changed
smtp_host: localhost
to
smtp_host: mydomain.tld
Here's the thing. The reason I did this was because the instructions at
https://docs.mailman3.org/en/latest/config-core.html
give this as their model:
[mta]
incoming: mailman.mta.postfix.LMTP
outgoing: mailman.mta.deliver.deliver
lmtp_host: mail.example.com
lmtp_port: 8024
smtp_host: mail.example.com <---- not localhost
smtp_port: 25
The instructions are good, but there are a few places where one size
does not fit all, I guess.
6) A second error in delivery to outside addresses resulted in an
"Access denied" error. A search on the internet revealed that this had
to do with (for me) smtpd_recipient_restrictions in postfix. See, for
instance:
https://know.mailsbestfriend.com/postfix_error_relay_access_denied_noqueue_…
Changing this fixed things.
I'm not sure, but I think this shows up mostly with installations that
include dovecot.
7) If you are using virtual domains in postfix, you need to use the
"unusual postfix configuration" in
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/mta.h…
virtual_alias_maps =
hash:/path-to-mailman/var/data/postfix_vmap
8) You need to manually set the local virtual host for mailman3.
Somehow, I got the impression from the installation instructions that
this was done automagically to the default x.mydomain.tld if your
domain is mydomain.tld. It doesn't.
9) Follow the instructions verbatim, and follow them in the order
provided. I installed postfix and nginx out of order, and it did OK,
but once you get into the python virtual environment, it is easy to
miss something if you don't do it in order.
10) Jot down lots of notes. This is one of the more complicated
installations I've done, mostly because it involved configuring a
zillion packages to talk to each other: Postfix, nginx, postorius,
hyperkitty, django, and others (I'd never heard of "whoosh" or "sass"
for instance). All of these can be unforgiving with configuration
errors.
The default installation instructions assumed a number of packages I'd
never used. I'm an apache/dovecot/mysql kind of person, and I had to
switch to nginx/postgres to use the instructions as the written
defaults. I'm sure I could have used apache and mysql, but it would
mean trying to figure out what didn't work without following the
installations verbatim. I'd never even heard of postorius, hyperkitty,
or django.
So, it was easy to get confused a bit. Taking notes of changes I made
was important in being able to back out of disastrous choices. Plus,
once I'd installed it on one machine, I sat down and installed it on
another machine, and it was very useful to have written down how I
fixed an issue when it came up again -- and I didn't remember exactly
what I had done.
11) Make multiple sequential backups of configuration files. I went
down a couple of paths I shouldn't have gone down. For instance, with
the vmap issue, I got it in my head that it was a postfix configuration
issue, not a mailman issue. So I kept changing things in postfix.
Once I was told that it was in *mailman* I had to set the virtual host,
I needed to back out of about 8 tweaks I'd made to main.cf in
/etc/postfix. If I hadn't been making main.cf.backup.01,
main.cf.backup.02, etc. I would have had to spend another few hours
trying to remember what inappropriate changes I had made.
This is particularly true for me because I am not a great typist, and
when I try to retype something to back out, there's a reasonable chance
I'll mistype something and it still won't work. With these backups, I
don't have both manually back out of things *and* proof my typing again
and again. It's a lot easier to delete backups once things are working
than to try to remember what you did late at night after a couple of
bourbons.
12) Choose one set of installation instructions and follow it. Don't
try to mix instructions from different tutorials unless you really know
what you are doing. I didn't. For instance, there's a different set
of mailman3 installation instructions at:
https://wiki.list.org/DOC/Howto_Install_Mailman3_On_Debian10
It does things a little differently. It's useful to look at that when
you are debugging why something's not working, but you can get into
some trouble trying to do both installations at the same time -- which
I found myself doing when something wasn't working. It didn't help.
billo
4 years, 8 months
[MM3-users] Re: Database problem after system upgrade
by Odhiambo Washington
On Wed, Nov 15, 2023 at 11:34 AM Lars Bjørndal <lars(a)lamasti.net> wrote:
> Thanks a lot.
>
> [Odhiambo]
>
> > From the above output, I'd try two things:
> >
> > 1. Is the database really running?
> >
> > ```
> > $ sudo -u postgres psql
> > ```
> >
> > 2. Can mailman connect to the database:
> >
> > ```
> > psql -h localhost -U mailman -d mailman -W
> > ```
> >
> > What does those two commands give you?
>
> I found that I did need to change the pg_hba.conf to get authentication to
> work.
>
> When I no start Mailman, I get the following:
>
> Traceback (most recent call last):
> File "/opt/mailman3/venv/bin/mailman", line 8, in <module>
> sys.exit(main())
> ^^^^^^
> File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py",
> line 1130, in __call__
> return self.main(*args, **kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py",
> line 1055, in main
> rv = self.invoke(ctx)
> ^^^^^^^^^^^^^^^^
> File
> "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/bin/mailman.py",
> line 69, in invoke
> return super().invoke(ctx)
> ^^^^^^^^^^^^^^^^^^^
> File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py",
> line 1657, in invoke
> return _process_result(sub_ctx.command.invoke(sub_ctx))
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py",
> line 1404, in invoke
> return ctx.invoke(self.callback, **ctx.params)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py",
> line 760, in invoke
> return __callback(*args, **kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File
> "/opt/mailman3/venv/lib64/python3.11/site-packages/click/decorators.py",
> line 26, in new_func
> return f(get_current_context(), *args, **kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File
> "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/commands/cli_control.py",
> line 91, in start
> status, lock = master_state()
> ^^^^^^^^^^^^^^
> File
> "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/bin/master.py",
> line 104, in master_state
> os.kill(pid, 0)
> PermissionError: [Errno 1] Operation not permitted
>
>
> But which operation are not permitted, how to find the cause?
>
That message is cryptic to me, but @Mark Sapiro <mark(a)msapiro.net> might
know.
Could you please see if there are stale lock files in
/opt/mailman3/var/locks/ that could be preventing mailman3 from starting?
If there are two files there, delete them and try starting mailman3 again.
Beyond that possibility, I now remain clueless :)
--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
[How to ask smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html]
2 years, 10 months
[MM3-users] Re: Installation Wooes
by Samir Faci
I manually patched up the bug since It seems it only occurs once or twice
in the code base.
Here's my next question. Hopefully this isn't off topic, but trying to get
postfix to work with mailman and I keep on getting relay denied issues.
/var/log/mailman/smtp.log
May 04 02:06:20 2020 (136767)
<158855797827.136760.10970401726993928773@lists> smtp to
booh(a)lists.domain.org for 1 recips, completed in 0.016954421997070312
seconds
May 04 02:06:20 2020 (136767)
<158855797827.136760.10970401726993928773@lists> post to
booh(a)lists.domain.org from booh-owner(a)lists.domain.org, 5180 bytes
May 04 02:06:20 2020 (136765) ('198.199.98.177', 42734) Data: b'QUIT'
May 04 02:06:20 2020 (136765) ('198.199.98.177', 42734) connection lost
May 04 02:06:20 2020 (136765) Connection lost during _handle_client()
May 04 02:06:21 2020 (136767)
<158855797827.136760.10970401726993928773@lists> recipients refused: {'
csgeek(a)domain.com': (554, b'5.7.1 <csgeek(a)domain.com>: Relay access
denied')}
May 04 02:06:21 2020 (136767)
<158855797827.136760.10970401726993928773@lists> smtp to
booh(a)lists.domain.org for 1 recips, completed in 0.022742748260498047
seconds
May 04 02:06:21 2020 (136767)
<158855797827.136760.10970401726993928773@lists> post to
booh(a)lists.domain.org from booh-owner(a)lists.geekbeacon.org, 5496 bytes, 1
failures
May 04 02:06:21 2020 (136767)
<158855797827.136760.10970401726993928773@lists> delivery to
csgeek(a)domain.com failed with code 554, b'5.7.1 <csgeek(a)domain.com>: Relay
access denied'
These are the changes I have in postfix that seem relevant.
/etc/postfix/master.cf
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
/etc/postfix/main.cf
compatibility_level = 2
recipient_delimiter = +
unknown_local_recipient_reject_code = 550
owner_request_special = no
transport_maps = hash:/var/lib/mailman3/data/postfix_lmtp
local_recipient_maps = $alias_maps hash:/var/lib/mailman3/data/postfix_lmtp
relay_domains = hash:/var/lib/mailman3/data/postfix_domains
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
defer_unauth_destination
myhostname = lists.domain.org
mydestination = $myhostname, localhost.localdomain, localhost, $mydomain,
lists.domain.org
Any help is appreciated.
--
Samir Faci
On Sat, May 2, 2020 at 1:40 PM Andrew Hodgson <andrew(a)hodgson.io> wrote:
> Mark Sapiro <mark(a)msapiro.net> wrote:
> >On 5/2/20 12:51 AM, Samir Faci wrote:
> >> A few questions about an Ubuntu install.
> >>
> >> i'm getting this behavior:
>
> >> AttributeError: module 'time' has no attribute 'clock'
>
>
> >> I'm on python 3.8.2
>
>
> >It time.clock() went away in Python 3.8. Mailman versions older than
> >3.3.0 are not compatible with Python 3.8. You need to upgrade Mailman
> core.
>
> I think this is a bug in Ubuntu 20.04.
>
> Python3 package is:
> Python3 3.8.2-0ubuntu2
> https://packages.ubuntu.com/search?suite=focal&keywords=python3
> Mailman3 is: 3.2.2-1
> https://packages.ubuntu.com/search?suite=focal&keywords=mailman3
>
> Andrew.
> _______________________________________________
> 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/
>
--
Thank you
Samir Faci
https://keybase.io/csgeek
6 years, 4 months