[Mailman-Users] Re: Temporary susension

2021-03-10 Thread Mark Sapiro

On 3/10/21 2:03 PM, Vako Nicolian wrote:

Is there a way to temporarily suspend all emails in a mailing list?


Set General Options -> emergency to Yes.


If so, can there be an automatic message sent to all members about this 
suspension?


Posters are not notified when their post is held due to `emergency`.

What you need to do is send your announcement to the list and then set 
`emergency` or set `emergency` first and post your announcement with an 
`Approved: ` header or first body line.


--
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
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] Temporary susension

2021-03-10 Thread Vako Nicolian

Is there a way to temporarily suspend all emails in a mailing list?
If so, can there be an automatic message sent to all members about this 
suspension?


Vako
--
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: Question on /var/lib/mailman/spam

2021-03-10 Thread Mark Sapiro
On 3/10/21 1:05 PM, David Gibbs via Mailman-Users wrote:
> Here's the script I have setup to feed accumulated spam into spamassassin.
> 
> https://gist.github.com/fallingrock/1afdc2117d771851255a737f7c3652b4

looks reasonable.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
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: Change moderator or admin password (random) different for each list they were an admin or moderator for - Mailman 2.1

2021-03-10 Thread Mark Sapiro
On 3/10/21 12:39 PM, Daniel Botting wrote:
> Hi Mark,
> 
> Thank you, much appreciated.
> 
> I've got it working and progressed a little further ;)
> 
>> ["pwgen", "-sB", "15", "1"]).strip())
> I had to remove the very end closing bracket, it was causing a syntax
> error.


That was my mistake, sorry.


> I then encountered a Errno 2 error no such file, which I tracked down to
> the fact this was a new test server due to mail not being received to
> lists and I didn't have pwgen installed.
> 
> I then managed to get it to email me either directly for each occurence
> of the password being changed if I just put in my email address directly
> or if one moderator is set, the issue comes that if I have more than one
> moderator it's mangling the message:
> 
>    print('%s moderator password changed to %s' %
>   (mlist.real_name, newpassword))
> 
>     print(mlist.moderator)
>     sender = 'root@host fqdn'
>     receivers = [mlist.moderator]

mlist.moderator is already a list so [mlist.moderator] is a list of lists.


>     #receivers = ['my.directem...@domain.co.uk']
> 
>     message = """ Daniel on list-test4
>     """
> 
>     try:
>     smtpObj = smtplib.SMTP('localhost')
>     smtpObj.sendmail(sender, receivers, message)
>     print ("Successfully sent email")
> 
>     except SMTPException:
>     print ("Error: unable to send email")
> 
>     mlist.Save()
> 
> If it can't send email because of this issue the traceback advises (been
> trying to figure this out as well):
> 
> NameError: global name 'SMTPException' is not defined


You have to import it. You also need to import smtplib. If you do

import smtplib

then you can do
try:
smtpObj = smtplib.SMTP('localhost')
...
except smtplib.SMTPException:
...

Or if you also do

from smtplib import SMTPException

you can write the except clause as

except SMTPException:

There is no magic by which Python knows the names of things other than
builtins (see sections 2 - 6 at
). You have to import
them or define them.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
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: Question on /var/lib/mailman/spam

2021-03-10 Thread David Gibbs via Mailman-Users

On 3/10/21 11:42 AM, Mark Sapiro wrote:

This is problematic. The idea is that the site admin can use these
messages to train some bayesian spam filter, but it is up to the site to
implement such a process. If you want to just ignore them, you could set
up a periodic cron to



Here's the script I have setup to feed accumulated spam into spamassassin.

https://gist.github.com/fallingrock/1afdc2117d771851255a737f7c3652b4

david

--
I'm riding in the American Diabetes Association's Tour de Cure to raise 
money for diabetes research, education, advocacy, and awareness.  You 
can make a tax-deductible donation to my ride by visiting 
https://mideml.diabetessucks.net.


You can see where my donations come from by visiting my interactive 
donation map ... https://mideml.diabetessucks.net/map (it's a geeky thing).

--
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: Change moderator or admin password (random) different for each list they were an admin or moderator for - Mailman 2.1

2021-03-10 Thread Daniel Botting

Hi Mark,

Thank you, much appreciated.

I've got it working and progressed a little further ;)


["pwgen", "-sB", "15", "1"]).strip())

I had to remove the very end closing bracket, it was causing a syntax error.

I then encountered a Errno 2 error no such file, which I tracked down to 
the fact this was a new test server due to mail not being received to 
lists and I didn't have pwgen installed.


I then managed to get it to email me either directly for each occurence 
of the password being changed if I just put in my email address directly 
or if one moderator is set, the issue comes that if I have more than one 
moderator it's mangling the message:


   print('%s moderator password changed to %s' %
  (mlist.real_name, newpassword))

    print(mlist.moderator)
    sender = 'root@host fqdn'
    receivers = [mlist.moderator]
    #receivers = ['my.directem...@domain.co.uk']

    message = """ Daniel on list-test4
    """

    try:
    smtpObj = smtplib.SMTP('localhost')
    smtpObj.sendmail(sender, receivers, message)
    print ("Successfully sent email")

    except SMTPException:
    print ("Error: unable to send email")

    mlist.Save()

If it can't send email because of this issue the traceback advises (been 
trying to figure this out as well):


NameError: global name 'SMTPException' is not defined

I did some debugging:

print.moderator displays:

['moderat...@domain.co.uk', 'moderat...@domain.co.uk']

Exim4 mainlog file is showing:

2021-03-10 20:24:55 SMTP syntax error in "rcpt 
TO:" H=localhost (box 
fqdn) [127.0.0.1] malformed address: @domain.co.uk> may not follow 


I've been trying to work out to get a space to be added, as that looks 
like the issue to me?


Finally in regards to pythontutor, very helpful thank you. My thirteen 
year old son is also taking an interest in Python recently after doing a 
bit at school, we are learning together :)


Many thanks

Daniel

On 08/03/2021 18:04, Mark Sapiro wrote:

You want something like this for the script
--
import subprocess
from Mailman.Utils import sha_new

def change_moderator_password2(mlist, moderator):
 if not mlist.Locked():
 mlist.Lock()
 try:
 if moderator in mlist.moderator:
 newpassword = subprocess.check_output(
 ["pwgen", "-sB", "15", "1"]).strip())
 mlist.mod_password = sha_new(newpassword).hexdigest()
 print('%s moderator password changed to %s' %
   (mlist.real_name, newpassword))
 mlist.Save()
 else:
 print('%s not found in %s moderator' %
   (moderator, mlist.real_name))

 except subprocess.CalledProcessError as e:
 print("password not changed for %s: %s\n%s" %
   (mlist.real_name, moderator, e.output))
 finally:
 mlist.Unlock()


--
Daniel Botting
Systems Administrator
Codethink Ltd.
3rd Floor Dale House,
35 Dale Street,
Manchester, M1 2HF
United Kingdom

http://www.codethink.co.uk/
We respect your privacy. See https://www.codethink.co.uk/privacy.html

--
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: Question on /var/lib/mailman/archives/private/LISTNAME/attachments/

2021-03-10 Thread Mark Sapiro
On 3/10/21 9:28 AM, Bader, Robert (Bob) wrote:
> I see files in var/lib/mailman/archives/private/LISTNAME/attachments/.  I did 
> some searching and found that :
> 
> The stored attachments have been scrubbed from the 'plain' format
> digest. This happens whether or not anyone actually subscribes to the
> 'plain' format digest. The only way to avoid it with configuration
> settings is to set Digest options -> digestable to No (i.e. disable
> digests).
> 
> Otherwise, you could set up a cron to periodically remove them, but
> then if you actually have 'plain' digest sebscribers, you'll break the
> links in their digests.
> 
> 
> Some of the lists that that files in attachments does not have archived 
> turned on and no users do not have digest set.
> 
> So if I under stand this these attachments are kept because under “digest 
> options” “digestible is set to “on”. Is that correct? So even if no user have 
> digest on , the list keeps attachments?
> 
> 
> So what is the best way to clear these files, can I just clear out the 
> attachments directory?  If no users have digest set , then this will be un 
> notable. But if user have digest on and it is set to PLAIN, then that could 
> be an issue?


`Attachments` are removed from messages, stored aside in the lists
attachments directory and replaced by links as part of the process of
flattening the message to plain text by Mailman/Handlers/Scrubber.py.

This will happen to all messages if the list's Non-digest options ->
scrub_nondigest setting is Yes. Otherwise, it happens twice to each
message with such attachments that survive Content filtering. Once when
the message is prepared for archiving and once when the plain text
digest is prepared.

If the list isn't archived and no one receives digests, you still have
to set Digest options -> digestable to No to prevent preparation of a
plain text digest even though it won't be sent to any one.

Assuming the list isn't archived and there are no digests, it is safe to
clear out the attachments directory.

Also, see the thread at
.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
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: Question on /var/lib/mailman/spam

2021-03-10 Thread Mark Sapiro
On 3/10/21 6:27 AM, Bader, Robert (Bob) wrote:
> I see messages in /var/lib/mailman/spam.  I did some searching and found that 
> :
> 
> When a moderator checks the "preserve message for site administrator"
> box when handling a held message, the message is put in that spam/
> directory.
> But how do I properly access them clear them out? Is this done via the web 
> interface or just the command line? I admin the server, but each list has its 
> own administrator. I assume they checked "preserve message for site 
> administrator" accidentally.


This is problematic. The idea is that the site admin can use these
messages to train some bayesian spam filter, but it is up to the site to
implement such a process. If you want to just ignore them, you could set
up a periodic cron to

rm /path/to/mailman/spam/*

On the one site where this is an issue for me, I'm more selective. I do

# At 11:59 remove 'preserved' spam older than 30 days.
59 23 * * * find /srv/mailman/spam -type f -mtime +30 -exec rm '{}' \;

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
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] Question on /var/lib/mailman/archives/private/LISTNAME/attachments/

2021-03-10 Thread Bader, Robert (Bob)
I see files in var/lib/mailman/archives/private/LISTNAME/attachments/.  I did 
some searching and found that :



The stored attachments have been scrubbed from the 'plain' format
digest. This happens whether or not anyone actually subscribes to the
'plain' format digest. The only way to avoid it with configuration
settings is to set Digest options -> digestable to No (i.e. disable
digests).

Otherwise, you could set up a cron to periodically remove them, but
then if you actually have 'plain' digest sebscribers, you'll break the
links in their digests.


Some of the lists that that files in attachments does not have archived turned 
on and no users do not have digest set.

So if I under stand this these attachments are kept because under “digest 
options” “digestible is set to “on”. Is that correct? So even if no user have 
digest on , the list keeps attachments?


So what is the best way to clear these files, can I just clear out the 
attachments directory?  If no users have digest set , then this will be un 
notable. But if user have digest on and it is set to PLAIN, then that could be 
an issue?








--
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] Question on /var/lib/mailman/spam

2021-03-10 Thread Bader, Robert (Bob)
I see messages in /var/lib/mailman/spam.  I did some searching and found that :

When a moderator checks the "preserve message for site administrator"
box when handling a held message, the message is put in that spam/
directory.
But how do I properly access them clear them out? Is this done via the web 
interface or just the command line? I admin the server, but each list has its 
own administrator. I assume they checked "preserve message for site 
administrator" accidentally.





--
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/