[Mailman-Users] Re: detecting pending subscriptions across many lists?

2022-05-31 Thread Karl Berry
By list_requests, do you mean 
https://www.msapiro.net/scripts/list_requests? 

Yes. (Thank you again for all your helper scripts.)

If so, just running it with no arguments will process all lists.

Yes, that's probably the best way. It just takes a while with so many
lists, so I was pondering some kind of shortcut.

They are not in config.pck. They are in pending.pck. See 
Mailman/Pending.py for more info.

I actually see the pending subscriptions in request.pck, not
pending.pck, but thanks for the pointer. Got me to look further :).

Thanks,
Karl

--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
https://mail.python.org/archives/list/mailman-users@python.org/


[Mailman-Users] detecting pending subscriptions across many lists?

2022-05-29 Thread Karl Berry
On lists.gnu.org, we have some 3300 mailman lists. Is there any way to
know, or even probabilistically guess, which have pending subscriptions,
short of running list_requests on every one? 

For pending messages, we can look for the presence of heldmsg-* files in
the mailman data dir (/var/lib/mailman/data for us), but I've been
unable to discern the existence of pending subscriptions anywhere except
in config.pck.

I also couldn't discern a way to grep in config.pck (which would be much
faster than list_requests). Is there some sequence that will only appear
with pending subscriptions? Looking at one list with a pending
subscription now, I see the byte string e64d 4b07 4b05 741d 014b 5574 4110
occuring before the address that wants to subscribe, but not sure if
that, or any part of it, would be a reliable thing to look for.

We appear to be running mailman 2.1.29. Not sure if it is the distro
version (Trisquel GNU/Linux 9.0.2) or installed from the original
source, but guessing that probably doesn't matter for this.

Any info greatly appreciated. --thanks, karl.
--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
https://mail.python.org/archives/list/mailman-users@python.org/


[Mailman-Users] Re: subscription flood, redux

2021-07-29 Thread Karl Berry
Thanks to everyone for the great replies.

davidg> I have it setup, but it's not very sophisticated ...
failregex = .*\/\s+-\s+-\s+\[.*\]\s+"POST\s+\/mailman\/subscribe
It's just looking for repeated subscribe attempts.

Thanks David!  What are you using for maxretry, findtime, bantime, etc.,
in jail.local (or whatever)?  I find it's often as hard to figure out
good values for those as to write the regexps ...

marks> Actually, it is in Mailman 2.1.30. Set
REFUSE_SECOND_PENDING = Yes
in mm_cfg.py to enable it.

Thanks Mark! I've been using the mailman from my distro, which is (sigh)
older.  I'll look into going back to installing mailman from scratch, as
I've done before.

jonb> You can probably do this with a procmail filter before anything hits

I'm not sure. My impression is the bad guys are hitting the subscribe
cgi directly, not sending mail requests. But procmail could work for
mail floods, for sure.

Sorry about not working out the details, but I thought it might be
better to say something rather than nothing.

Definitely :).

Thanks again,
Karl
--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
https://mail.python.org/archives/list/mailman-users@python.org/


[Mailman-Users] subscription flood, redux

2021-07-28 Thread Karl Berry
I was just hit with a subscription flood, along the lines of
  https://mail.python.org/pipermail/mailman-users/2014-May/076880.html
  https://bugs.launchpad.net/mailman/+bug/1082746

I've mitigated the current attack, but it's happened before and will
happen again. I'm already using SUBSCRIBE_FORM_SECRET. I also saw Mark's
patch in the thread above to disable subscriptions for a particular
list, which is helpful.

Still, trying to look ahead, I have two further questions:

1) The above mailman-users thread refers to using fail2ban. This sounds
sensible. Does anyone have a a working fail2ban filter they can share
for this? I'd rather not write one from scratch; my previous attempts at
doing so have been rather uneven.  (Not the easiest thing to search for,
since fail2ban itself uses mailman for its mailing lists, it seems. I
couldn't find anything, at any rate.)

2) At least in my cases, the floods try to subscribe the same address
over and over (and over and ...). It occurs to me that mailman could
silently discard a request to subscribe an address f...@bar.com if
f...@bar.com already has a pending subscription -- that is, not sending
out the confirmation request. Would this be doable? Mark, anyone?

Although I realize that has downsides, for myself at least I'd prefer to
minimize the backscatter pain for the random targeted addresses. Real
people who are failing to subscribe can write the owner.

Thanks in advance,
Karl


--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
https://mail.python.org/archives/list/mailman-users@python.org/


[Mailman-Users] template directives, prev/next period?

2020-06-14 Thread Karl Berry
In the template files, e.g., templates/en/archidxhead.html and
article.html, is there a %(...)s value that would link to
the next/prev archive period? It would be nice for browsing.

More generally, is there a reference list of the % values available?

Sorry if this information is in the documentation somewhere. I couldn't
find it :(. --thanks, karl.
--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
https://mail.python.org/archives/list/mailman-users@python.org/


[Mailman-Users] automatic decode of base64 text/plain

2016-11-08 Thread Karl Berry
Some mailers annoyingly send text/plain parts in base64 encoding, making
grep and all other standard tools ineffective.

I wonder if it would be feasible for mailman to automatically decode
such back into normal text, at least for the archives. Maybe also for
sending out, though clearly that is more intrusive.

I could also imagine this being done at the MTA level, but that seems
even more likely to be too intrusive.

I looked around a bit for methods with no luck.  Any thoughts?  --thanks, karl.

P.S. Here's an example fragment, with a leading "> " to avoid misparsing.

> Content-Type: text/plain; charset="utf-8"
> Content-Transfer-Encoding: base64
> 
> PiBBcmUgeW91IHNheWluZyB0aGF0IEkgbmVlZCB0byBjaGFuZ2UgbXkgcHJvZmlsZT8gDQo+ICAg
> bGFjZSB3aGVyZSB3ZSBjb3VsZA0KPiBkbyBiZXR0ZXI6IHN1cHBvc2UgYSBzY2hlbWUtZnVsbCAo
..
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


[Mailman-Users] per-list email at munging?

2016-05-25 Thread Karl Berry
I just set up some mailman lists for commit archives.  I'd like to avoid
the "@" -> " at " munging for them (at least in the bodies, though also
in the headers is fine/expected), while retaining that minimal munging
for the other lists on the server.

Looking at HyperArch.py (and Defaults.py), it seems
ARCHIVER_OBSCURES_EMAILADDRS is server-wide.  Any viable way to make it
per-list?  I couldn't find anything in web searches or at
http://fog.ccsf.cc.ca.us/~msapiro/scripts/ but always easy to miss stuff.

It's not so much that I myself think the " at " munging is so
wonderfully effective at antispam, but I feel sure that if I turn it off
now, my users will complain vociferously and constantly.  Such is life.

Thanks,
Karl

P.S. It seems the original author (Richard Barrett) offered to make it
per-list back in 2003 but no one asked for it :).
https://sourceforge.net/p/mailman/patches/273/
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


[Mailman-Users] newsgroup-mailman moderation

2013-06-29 Thread Karl Berry
Greetings,

For gnu.org, we have always had gatewaying between Usenet and
mailman for quite a few lists, e.g., help-gnu-emacs and bug-gnu-utils.

When a message is gatewayed *from* Usenet to the mailing list, Mailman
evidently omits any of the usual moderation features
(generic_nonmember_action and the like).  Mark (Sapiro) mentioned this
in http://mail.python.org/pipermail/mailman-users/2008-April/061154.html,
and it's also the behavior that we have always seen.  Evidently due to
the inq.enqueue call in gate_news, around line 179 in 2.1.15.

However, spam does get posted to Usenet, and we don't want it to simply
be blindly injected into the mailing lists.  The workaround we've been
using is to add Newsgroups: to the Spam Filter Regexp with
Action=Hold for header_filter_rules (in Privacy Options  Spam filters).

That holds the incoming posts from Usenet.  But the downside is
significant: every Usenet post is held, even when it would otherwise be
approved (e.g., it comes from a known whitelisted address).

So, we would really like to have posts from Usenet be subject to the
normal mailman moderation rules (for purposes of both holding and
accepting messages).  Is it feasible to hack gate_news to make that
happen?  Help?  Unfortunately my own mailman-fu is not nearly up to the
job :(.

Thanks,
Karl
--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


[Mailman-Users] downloading private archives in batch?

2004-05-21 Thread Karl Berry
Has anyone happened to have written a script to allow downloading
the archives of a private mailman list offline (not in a browser)?

That is, you give the mailman username/password on the command line, it
does the mailman authentication over http[s], remembers the cookie, and
gets you the full raw archives (for example).

It does not sound terribly difficult to write, but maybe no one has
needed it :).

I searched the documentation and FAQs and list archives and google,
with no luck.  Any pointers appreciated.

Thanks,
karl

--
Mailman-Users mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/


[Mailman-Users] sys.exit(0) causes no cgi output

2003-02-17 Thread Karl Berry
Red Hat 7.2 (i686), apache 1.3.26, python 2.2.2, mailman 2.1.1 (also
happened with 2.1).

After applying the htdig patches, we found that calls to
http://.../mailman/htdig/... got an internal server error (HTTP 500).
(An example full url:
http://tug.org/mailman/htdig/pdftex/2002-July/002843.html.)

It turned out that nothing was being written to stdout, that is, in
driver.py we have the following block:

try:
try:
sys.stderr = logger
sys.stdout = tempstdout
main()
sys.__stdout__.write(tempstdout.getvalue())
finally:
sys.stderr = sys.__stderr__
sys.stdout = sys.__stdout__
except SystemExit:
# This is a valid way for the function to exit.
pass

The sys.__stdout__.write(tempstdout.getvalue()) statement was not
getting executed, so apache had no headers to send back, thus the ISE.
Instead, the main() call was jumping to the finally block and then the
except SystemExit block.

Why?  Because of the sys.exit(0) at the end of htdig.py.  If that is
changed to `return', it works.  So, apparently sys.exit(0) is throwing a
SystemExit exception, which I guess is logical enough.

Since not every sys.exit(0) can be changed to return (e.g., the one in
error_quit in htdig.py), for now I changed driver.py so that the `except
SystemExit' also does the write:
except SystemExit:
# This is a valid way for the function to exit.
sys.__stdout__.write(tempstdout.getvalue())
pass

(Well, actually, I changed cgi-wrapper.c to invoke xdriver and changed
it in a new script xdriver.py to avoid possibly disturbing all the other
mailman cgi scripts.)

Of course, there are sys.exit's scattered everywhere throughout all the
*.py files, not just in htdig.py.  So I feel like I must be missing
something.  How can it be working for every other script (at least I
guess it is), and no one else is seeing the problem?  Or does driver.py
really need to be changed?

Any info appreciated, this has been a frustrating morning.

Thanks,
[EMAIL PROTECTED]

--
Mailman-Users mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/

This message was sent to: archive@jab.org
Unsubscribe or change your options at
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org



[Mailman-Users] old request causes checkdbs failure in 2.1

2003-01-19 Thread Karl Berry
I updated my site (red hat linux 6.2, i686) to mailman 2.1 and python 2.2.2.

Unfortunately, I managed to create a request to the new `mailman' list
during the upgrade which ended up in the old format, and is causing
cron/checkdbs to fail (see below).  At least that's what I gather from
the couple of relevant messages I could find about it.

It's just a junk request, and all I want to do is get rid of it so I
stop getting the error.  Help?  Where are the pending_requests stored?
How can I view/delete them?  Or is there another way to fix?

Any help appreciated.

Thanks,
karl


Here is the actual error:

bash$ ./cron/checkdbs
Traceback (most recent call last):
  File ./cron/checkdbs, line 136, in ?
main()
  File ./cron/checkdbs, line 80, in main
text += '\n' + pending_requests(mlist)
  File ./cron/checkdbs, line 102, in pending_requests
when, addr, fullname, passwd, digest, lang = mlist.GetRecord(id)
ValueError: unpack tuple of wrong size

--
Mailman-Users mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/

This message was sent to: archive@jab.org
Unsubscribe or change your options at
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org



[Mailman-Users] compress full mbox files?

2002-12-12 Thread Karl Berry
Back on November 18, 2001, Jackie Meese asked about gzipping the full
mbox files in the mailman archive system:
http://www.mail-archive.com/mailman-users@python.org/msg05253.htm
There was no answer that I could see.

Is there an answer?  The uncompressed file is many megabytes on active
lists.  This is not good either for disk space on the server, or for
people who want to download it.

I just want to do the usual thing of rotating it monthly or whatever.
It's obviously no problem to do the compression and rotation, leaving an
empty writable file behind for new messages.  The mailman-specific
problem is the html to access the archive.  Is editing the template in
Mailman/Archiver/HyperArch.py (and all the existing lists :() the only way?  

I'm still using mailman 2.0.13.  Will 2.1 offer any changes in this
regard?  (I looked around on the MM2.1 page, but didn't see anything
conclusive one way or the other.)

Thanks,
[EMAIL PROTECTED]

--
Mailman-Users mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/

This message was sent to: archive@jab.org
Unsubscribe or change your options at
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org