[Mailman-Developers] Re: Introduction, FOSDEM, scaling down, latency, OpenPGP support
Hello Justus, I find it very good that you are trying to reduce the memory consumption of mailman 3. I cannot help in doing this. I hope you find some way to reduce the memory. Do you know by accident, if the runner processes use identical memory, and by calling https://man7.org/linux/man-pages/man2/madvise.2.html the kernel can somehow detect these identical memory and then use a single instance for all identical regions of memory? Greetings Дилян -Original Message- From: Justus Winter To: mailman-developers@python.org Subject: [Mailman-Developers] Introduction, FOSDEM, scaling down, latency, OpenPGP support Date: 01/21/2024 02:08:34 PM Hello everyone :) I want to introduce myself, I'm Justus, I have worked on GnuPG in the past and am now working on Sequoia-PGP, and I'm running two Mailman installations in a resource constrained shared hosting environment. I'd like to contribute a little to Mailman, and I'd like to better understand how the Mailman project is doing nowadays. I have gotten a bugfix merged in the past, but I now have what I think is a fairly uncontroversial cleanup merge request that has neither been merged nor has it gotten comments. - https://gitlab.com/mailman/mailman/-/merge_requests/1158 As FOSDEM is around the corner, are any of you going to be there and are up for a chat? Besides cleanups and bugfixes, there are three things I'd like to do: - Improve Mailman to better scale down to small installations - Improve latency of messages - Implement OpenPGP support Here are the things I did so far: - https://gitlab.com/mailman/mailman/-/merge_requests/1094 - https://gitlab.com/mailman/mailman/-/issues/1050 - https://gitlab.com/mailman/mailman/-/merge_requests/1166 - I have Mailman running with runners in threads instead of processes, but that is in a proof-of-concept stage at this point and needs some cleaning up (I understand that Mailman is a GNU project that wants copyright assignments, and I have done that in the past for other GNU projects, and would be happy to do that for Mailman, but at the same time I feel like putting up *any* barrier to contributing is unfortunate.) Best, Justus ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] Re: Fwd: (Custom) Plugins: Proper file path(s) for adding a handler?
Hello Thomas, at https://mail.aegee.org/cgit/mailman_sieve/ I have created a mailman3 plugin, which has hooks when new members are added or removed from the mailing list. You can use this as example. Kind regards Дилян -Original Message- From: Thomas Ward via Mailman-Developers Reply-To: Thomas Ward To: mailman-developers@python.org Subject: [Mailman-Developers] Fwd: (Custom) Plugins: Proper file path(s) for adding a handler? Date: 10/24/2023 02:26:43 AM I originally sent this to the mailman3 list, but got no reply all day, suggesting that perhaps this might have not been the best place to send this message to. So, sending it to the mailman-developers list, which is more tech/devel oriented. Primarily, my goal here is to figure out how to add handlers via a plugin, but there's no documentation for it, so I'm looking for more information. Worst case, I can probably add my handlers and pipelines as direct files in the venv inside Mailman's paths for the PyPI packages, but I'd like to avoid that if possible and just add an extra plugin. Thomas Forwarded Message Subject: (Custom) Plugins: Proper file path(s) for adding a handler? Date: Mon, 23 Oct 2023 11:07:53 -0400 From: Thomas Ward To: mailman-us...@mailman3.org I want to add a custom handler that implements customized thread IDs in the system. I already have the DB logic worked out, but the documentation for plugins is NOT clear on how to define a handler in a plugin, nor does the example plugin in the documentation on Gitlab have any custom handlers. I'm looking to add a custom handler so that the private pipeline for threaded-subject-list can use thread-subject (the custom handler) instead of subject-prefix (builtin). I'm unclear how to add this properly in a plugin that would be read properly by Mailman, though. Any tips on the filestructure needed for the Python code/plugin package in order to properly be set up and work? Thomas ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9 ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] Making Hyperkitty more friendly to Search Engines
cross posting, since I sent this to mailman-users@, but wanted to distribute over mailman-developers@ Hello, it would be good, if Hyperkitty integrates better with search engines for public archives. In particular: • generates sitemap files, containing information about each archive page, created by Hyperkitty, when was it last modified, how often is the webpage expected to changes (never) — https://gitlab.com/mailman/hyperkitty/-/issues/467 ) . This way, when search engines index Hyperkitty archives, they will crawl just what changes since the previous crawl, and not everything. Crawling everything repeatedly generates a lot of server load. • include metadata about when the hyperkitty archive (article) was published — https://gitlab.com/mailman/hyperkitty/-/issues/466 . Then search results will show (sometimes) the date of the publication • tell search engines immediately, whenever new public archive weppage is generated — https://gitlab.com/mailman/hyperkitty/-/issues/468 , so that they can in theory index that webpage immediately. I have experience on integrating webpages with search engines on the above bullets. If somebody is willing to implement these features in Hyperkitty, I can answer any questions related to the search engines, not related to the code in Hyperkitty itself. The biggest friends of search engines are fast loading webpages. Removing the dependencies on jQuery in django-mailman3, Hyperkitty and Postorius would result somehow faster loading pages. I can assume that some administrators (=me) refrain for letting search engines index the archives, because the servers have not enough capacities to handle the huge webcrawling periodic traffic. Implementing the above suggestions shall remove the obstacle letting search engines index public archives. Greetings Дилян ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] Re: span: class="d-none d-md-inline", “d-md-none” in translated strings
Hello Mark, the hyperkitty page for https://lists.mailman3.org/archives/list/mailman-us...@mailman3.org/ has this form templates/hyperkitty/overwiev.html: {% if posting_enabled %} {% trans 'Start a nNew thread' %} {% endif %} Now, class="d-none d-md-block" is display:block , when the viewport is at least 576px, otherwise it is display:none . Likewise Start a nNew thread class="d-none d-md-inline” is display:inline, when the width of the view port is at least 576px and display:none otherwise. Class="d-md- none" is only visible, when the width is at most 576px. For screens, which are less than 576px wide, the whole block «» is hidden, and «Start a nNew thread» is not displayed. So, when is “N” supposed to appear? It never appears. Greetings Дилян On Sun, 2022-05-15 at 18:22 -0700, Mark Sapiro wrote: > On 5/15/22 12:21, Дилян Палаузов wrote: > > Hello, > > > > I am trying to translate HyperKitty. Can somebody explain me in > > the > > strings: > > > > Start a nNew thread > > > > Manage sSubscription > > > > what the purpose is of d-none, d-md-inline, d-md-none and how are > > these > > strings supposed to be translated? > > > They are bootstrap classec and are not to be translated. > > > > Assuming they are Bootstrap-invention to present different text on > > differently-wide screens, I tried to make my browser narrower and > > wider, while > > https://lists.mailman3.org/archives/list/mailman-us...@mailman3.org/ > > is > > loaded, and I see no big difference. The whole block “+Start a new > > thread” is replaced by “+ New”, without “ thread” afterwards. > > I'm not sure why you see that. Taking > ``` > Start a n class="d-md-none">New thread > ``` > as an example the whole point of the span tags is to render the > initial > text as either `Start a n` or `N` depending on screen size and in > either > case followed by `ew thread` so that the entire rendered string > becomes > either `Start a new thread` or `New thread` depending on screen size. > That's all you need to translate, > > Depending on what the actual translations of `Start a new thread` are > are `New thread` you may be able to translate this similarly or you > may > need to translate it more like > ``` > Start a new class="d-md-none">New thread > ``` > or even > ``` > Start a new thread class="d-md-none">New thread > ``` > > -- > Mark Sapiro The highway is for gamblers, > San Francisco Bay Area, California better use your sense - B. > Dylan > ___ > Mailman-Developers mailing list -- mailman-developers@python.org > To unsubscribe send an email to mailman-developers-le...@python.org > https://mail.python.org/mailman3/lists/mailman-developers.python.org/ > Mailman FAQ: https://wiki.list.org/x/AgA3 > > Security Policy: https://wiki.list.org/x/QIA9 ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] span: class="d-none d-md-inline", “d-md-none” in translated strings
Hello, I am trying to translate HyperKitty. Can somebody explain me in the strings: Start a nNew thread Manage sSubscription what the purpose is of d-none, d-md-inline, d-md-none and how are these strings supposed to be translated? Assuming they are Bootstrap-invention to present different text on differently-wide screens, I tried to make my browser narrower and wider, while https://lists.mailman3.org/archives/list/mailman-us...@mailman3.org/ is loaded, and I see no big difference. The whole block “+Start a new thread” is replaced by “+ New”, without “ thread” afterwards. On wide screen the block is light-blue, on narrow screen it is greyed out. The “Manage subscription” disappears. I have to add, that I am not logged in. Greetings Дилян ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] Re: GSoC for working professionals
Hello Christopher, the eligibility criteria by the sponsor are at https://developers.google.com/open-source/gsoc/faq#what_are_the_eligibility_requirements_for_participation They do not seem to exclude your use case. If you are willing to deliver results, I do not think that anybody is going to prohibit you from participating in GSOC. https://wiki.list.org/DEV/Google%20Summer%20of%20Code%202022 contains a list of Mailman3-Ideas for GSOC. In the meantime you can setup mailman+mailmanclient+postorius+hyperkitty+mailman- hyperkitty+django_mailman3 on your system. There are different way to get the setup. You can also submit some trivial improvement, like grammatical corrections of the documentation. I personally installed mailman few weeks ago and have not deployed it yet in production. The MLM I use currently has a notion of Sub-List: all subscribers of a mailing list A, are automatically subscribers of mailing list B, if B is a sub-list of A. Moreover, the subject-prefix all subscribers get is the one of the mailing list A, when a mail is sent to A (and received by B-subscribers). One of the concerns migrating to mailman3 for me is the lack of this feature (or at least I have not found it yet). Some email providers offer “Feedback loop”. That is, when a mail is sent from your server to their server and a user clicks that mail explicitly as spam, your server gets a notification (in “Abuse Reporting Format”) and can unsubscribe the user from a mailing list, when the ARF message contains the user, and the mailing list name. For the closed-source MLM I use I have implemented the above functionality and I would like to get it working for Mailman. That would be, upon receiving an ARF message, sending a POST-request to the REST API, containing: - the subscriber address - the returned message - the mailing list name Then Mailman shall unsubscribe the address from the mailing list, and send a (templated) message to the subscriber, telling her which email message she has marked manually as spam, why she was unsubscribed and how can she subscribe again). Some email providers are more stubborn in sending the ARF-messages, as they delete the address of the subscriber, but keep the original Message-Id header. So when an ARF-message is received from such providers, it shall be possible to decode from the Message-Id the real recipient, and trigger the un-subscription process for the decoded email address. The encoding of the ML-recipient in the Message-Id header is to my knowledge currently not possible. So one idea for GSOC is to extend mailman to handle ARF-messages (or parts of it), which arrive over the REST-interface. The rationale for the REST-interface is, that all ARF-messages for a server are send to a single email address and the software handling that address can decide, if it is a mailman-originating message and forward it to mailman, otherwise handle it differently. (In fact, the software could also redirect the message over LMTP to a special address, but getting a message over LMTP of REST is almost the same here). Greetings Дилян On Sun, 2022-03-20 at 15:20 +0800, Christopher wrote: > Hi everyone > > Nice to meet you all! I am interested in GSoC 2022 and I discovered > that > Mailman might be one of the interesting projects I would like to > contribute > to. However, I am not a student, but I am working as a software > engineer > full time (10-6 on weekdays). I would like to start contributing to > open > source projects and stumbled upon GSoC which I thought it's a great > opportunity to get started. If I am able to churn out 14.5 hours of > work > per week (by working on the weekends) across 12 weeks (summing up to > 175 > hours), do I stand a chance to be accepted as a GSoC participant? > > Thanks, > Christopher Chong > ___ > Mailman-Developers mailing list -- mailman-developers@python.org > To unsubscribe send an email to mailman-developers-le...@python.org > https://mail.python.org/mailman3/lists/mailman-developers.python.org/ > Mailman FAQ: https://wiki.list.org/x/AgA3 > > Security Policy: https://wiki.list.org/x/QIA9 ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] Re: --- in DMARC From: rewritings
Hello, > > In particular, we don't include the original From: @domain because > > of goal #2 [in dmarc.py]. We use --- to imply that something is > > missing. Perhaps ellipsis would have been a better choice, but we > > didn't want anything that even hinted at a domain. > > OK, that makes some sense. Here's goal #2: > > # 2) the original From: address should not be in a comment or > display > #name in the new From: because it is claimed that multiple > domains > #in any fields in From: are indicative of spamminess. This > means > #it should be in Reply-To: or Cc:. > > I don't recall there being documentation of this claim. I certainly > believe it happens at least occasionally (I know several mail admins > who will implement any filter that might eliminate 1 or more spams in > the next decade ;-). But is it really a major problem? > > I'm coming around to the idea of a general format language for > configuring various Mailman-generated texts with a bunch of standard > codes (like strftime). There are too many "minority" problems like > the OP's (and I suspect "multiple addresses are spam" for that > matter) > for me to be comfortable ignoring the set, but on the other hand the > number of options we'd have to provide to satisfy 1/10th of them > would > be insane, and unpopular with 99% of the folks considering changing > the default. “It is claimed that multiple domains in any fields in From: are indicative for spamminess” is a rumour, which does not account for real-world feasible use cases. Since other MLMs have the option to include the full original-From: address in the display-part of the From: header, mailman shall have this option, too. Greetings Дилян ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] --- in DMARC From: rewritings
Hello, the DMARC Mitigation action “Replace From: with list address” is evaluated in mailman/handlers/dmarc.py:munged_headers(). In the case, where From: is a non-member email address, without display part, which non-member may post, this happens: realname = email realname = re.sub(r'@([^ .]+\.)+[^ .]+$', '---', realname) with _.using(mlist.preferred_language.code): via = _('${realname} via ${mlist.display_name}') display_name = str(Header(via, mlist.preferred_language.charset)) value = [('From', formataddr((display_name, mlist.posting_address)))] In short, if a@b is a non-member, who may post to mailing list “E ”, and b is DMARC-protected, the final distrubuted email will have From: "a--- via E " Reply-To: a@b compare to the IETF mailing lists, which would send: From:where a and b are from a@b, d is from c@d The bottom of https://answers.uillinois.edu/illinois/page.php?id=86787 describes the mitigariton options offered by Sympa: display name From: User Name display name and e-mail From: “User Name” (userem...@address.com) < listn...@lists.illinois.edu > email “via Mailing List” From: “User Name” (userem...@address.com via listName Mailing List) name “via Mailing List” From: “User Name” (the website likely means:) From: “User Name via listName” As can be seen, the other MLMs do not replace domains with --- . I find ugly the --- , inserted by mailman. In my real-world case the From: is a...@example.org, the ML name is a...@l.example.org (localname is the same, the domains are different). The result is: From: aaa--- via Aaa So there is twice trippe-A and @example.org disappeared. Mentioning twice AAA in the display name in this case really has to added value. That said, I propose removing now the line realname = re.sub(r'@([^ .]+\.)+[^ .]+$', '---', realname) and in the future offer as options: From: User Name From: “User Name” (userem...@address.com) < listn...@lists.illinois.edu > From: “User Name” (userem...@address.com via listName Mailing List) From: “User Name via listName” ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] Re: Creating an event catching plugin
Hello, On Thu, 2022-03-10 at 11:26 -0800, Abhilash Raj wrote: > > > > On Mar 8, 2022, at 12:45, Дилян Палаузов > > wrote: > > > > Hello, > > > > the object passed was actually an unsubscription/subscription > > event, > > which was just pretty-printed. > > > > Is there any explanation, why in the code below YYY is not printed? > > > > when I add > > > > def pre_hook(self): > > print('pre_HOOK') > > > > > > pre_HOOK is also not printed, but __init__ is called, as XXX is > > printed. > > I am not sure if you figured it out already, I see that you moved > your code from pre_hook to __init__ for your plugin. > pre_hook(), post_hook() and resource must be present in the IPLugin implementation, see https://gitlab.com/mailman/mailman/-/issues/985 . Otherwise logs/plugins.log gets: Mar 11 10:11:00 2022 (1998657) Plugin class does not implement IPlugin: mailman_sieve.SievePlugin and ”mailman info” does not call the hooks. What is the difference between doing something in pre_hook(), or in __init__() ? Greetings Дилян > Just for testing, I enabled the `print(‘hello world’)` in your plugin > and in a local install and it seems to work, > > > ``` > $ mailman info > Hello World > GNU Mailman 3.3.6b1 (Tom Sawyer) > Python 3.9.10 (main, Jan 15 2022, 11:40:53) > [Clang 13.0.0 (clang-1300.0.29.3)] > config file: /Users/maxking/Documents/mm3/core-workspace- > 2/var/etc/mailman.cfg > db url: sqlite:Users/maxking/Documents/mm3/core-workspace- > 2/var/data/mailman.db > devmode: DISABLED > REST root url: http://localhost:8001/3.1/ > REST credentials: restadmin:restpass > ``` > > The configuration is like your README.md recommends > > ``` > [plugin.mailman_sieve] > class: mailman_sieve.SievePlugin > enabled: yes > configuration: ./sieve.cfg > ``` > > > Greetings > > Дилян > > > > On Tue, 2022-03-08 at 19:39 +0200, Дилян Палаузов wrote: > > > Hello, > > > > > > can you point me to existing, open-source mailman plugins? > > > We don’t currently have any that i know of, so this is really the > first one! I am happy to see that :-) > > We should put up a list of community maintained plugins in a page at > docs.mailman3.org so the users can actually discover them plugin. > > > > > > > I want to write a plugin, which fires on all subscriptions, > > > unsubscriptions and configuration changes. > > > > > > This code: > > > > > > def subscribe_events(e): > > > print('EVENT', e) > > > > > > @implementer(IPlugin) > > > class SievePlugin: > > > def __init__(self): > > > print('XXX') > > > zope.event.subscribers.append(subscribe_events) > > > > > > def post_hook(self): > > > print('YYY') > > > zope.event.subscribers.append(subscribe_events) > > > > > > > > > prints: > > > XXX > > > EVENT x...@example.org joined zzz.udoma.bapha.be > > > EVENT ab c joined zzz.udoma.bapha.be > > I guess you were using `print` statements for debugging when working > on the plugin, but generally, it is good to use logging library > instead since print logs to stdout, which might not be set correctly > in daemon processes like Mailman. > > > > > > > or > > > XXX > > > EVENT x...@example.org left zzz.udoma.bapha.be > > > > > > on `mailman addmembers/mailman delmembers`. But it does not > > > trigger > > > a > > > UnsubscriptionEvent or SubscriptionEvent. > > > > > > Greetings > > > Дилян > > > > ___ > > Mailman-Developers mailing list -- mailman-developers@python.org > > To unsubscribe send an email to mailman-developers-le...@python.org > > https://mail.python.org/mailman3/lists/mailman-developers.python.org/ > > Mailman FAQ: https://wiki.list.org/x/AgA3 > > > > Security Policy: https://wiki.list.org/x/QIA9 > > -- > thanks, > Abhilash Raj (maxking) > > > ___ > Mailman-Developers mailing list -- mailman-developers@python.org > To unsubscribe send an email to mailman-developers-le...@python.org > https://mail.python.org/mailman3/lists/mailman-developers.python.org/ > Mailman FAQ: https://wiki.list.org/x/AgA3 > > Security Policy: https://wiki.list.org/x/QIA9 ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] New MM3 plugin: mailman_sieve
Hello, I have published a new Mailman 3 plugin at https://mail.aegee.org/cgit/mailman_sieve/tree/ . It generates for each mailing list a Sieve script. When the Sieve script is evaluated during the SMTP dialog, it would reject some emails, which otherwise would be bounced by Mailman. Less bounces means less backscatters and better IP reputation. For the record, I do the evaluation of the Sieve scripts during the SMTP dialog with https://mail.aegee.org/cgit/aegee-milter . Since the latter is not documented yet, you cannot use it. The mailman_sieve plugin is not useful, unless you have software to evaluate the Sieve Scripts during the SMTP dialog. This is a very first version, which does what it is supposed to do. Some optimizations are possible, like not including the subscriber addresses in the Sieve scripts for announce-only mailing lists. I am not good at writing setuptools configuration. Neither do I understand the mailman system very good right now, creating possibly shorter scripts. But the plugin is there to keep by IP reputation good! See https://mail.aegee.org/cgit/mailman_sieve/tree/README.md . My reading of the mm3 source code is that there is no event triggered, when the mailing list configuration changes, like adding a new moderator, or switching the announce-only status. In the lack of such event triggers, the Sieve scripts are not updated. When the code improves, the plugin could be published in PyPi or in mailman/contrib . Greetings Дилян ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] Re: Creating an event catching plugin
Hello, the object passed was actually an unsubscription/subscription event, which was just pretty-printed. Is there any explanation, why in the code below YYY is not printed? when I add def pre_hook(self): print('pre_HOOK') pre_HOOK is also not printed, but __init__ is called, as XXX is printed. Greetings Дилян On Tue, 2022-03-08 at 19:39 +0200, Дилян Палаузов wrote: > Hello, > > can you point me to existing, open-source mailman plugins? > > I want to write a plugin, which fires on all subscriptions, > unsubscriptions and configuration changes. > > This code: > > def subscribe_events(e): > print('EVENT', e) > > @implementer(IPlugin) > class SievePlugin: > def __init__(self): > print('XXX') > zope.event.subscribers.append(subscribe_events) > > def post_hook(self): > print('YYY') > zope.event.subscribers.append(subscribe_events) > > > prints: > XXX > EVENT x...@example.org joined zzz.udoma.bapha.be > EVENT ab c joined zzz.udoma.bapha.be > > or > XXX > EVENT x...@example.org left zzz.udoma.bapha.be > > on `mailman addmembers/mailman delmembers`. But it does not trigger > a > UnsubscriptionEvent or SubscriptionEvent. > > Greetings > Дилян ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] Creating an event catching plugin
Hello, can you point me to existing, open-source mailman plugins? I want to write a plugin, which fires on all subscriptions, unsubscriptions and configuration changes. This code: def subscribe_events(e): print('EVENT', e) @implementer(IPlugin) class SievePlugin: def __init__(self): print('XXX') zope.event.subscribers.append(subscribe_events) def post_hook(self): print('YYY') zope.event.subscribers.append(subscribe_events) prints: XXX EVENT x...@example.org joined zzz.udoma.bapha.be EVENT ab c joined zzz.udoma.bapha.be or XXX EVENT x...@example.org left zzz.udoma.bapha.be on `mailman addmembers/mailman delmembers`. But it does not trigger a UnsubscriptionEvent or SubscriptionEvent. Greetings Дилян ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
[Mailman-Developers] Unclear usage of `member = ISubscriptionManager(mlist).register(…)`
Hello, I am trying to understand the source code. My reading is, that interfaces/subscriptions.py:class ISubscriptionManager.register always returns a 3-tuple and the last element of the tuple is a member object, or None. This coincides with the implementation in app/subscriptions.py.SubscriptionManager.register . cli_synmembers.py:add_members() contains: member = registrar.register( subscriber, pre_verified=True, pre_approved=True, pre_confirmed=True, send_welcome_message=welcome_msg)[2] member.preferences.delivery_status = delivery_status member.preferences.delivery_mode = delivery_mode return and commands/cli_addmembers.py:add_members() contains member = registrar.register( subscriber, pre_verified=True, pre_approved=True, pre_confirmed=True, invitation=invite, send_welcome_message=welcome_msg)[2] if member is not None: member.preferences.delivery_status = delivery_status member.preferences.delivery_mode = delivery_mode return So my question is: when regirstar.register returns a tuple, the last argument of which is a members, why do the above snippets store the result in a variable called `member`? How are the set preferences set to member handled further, as my reading is that the variable just disappears, immediately after member.preferences is set? Greeting Дилян ___ Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-le...@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9