![](https://secure.gravatar.com/avatar/28a1557a7bb6dc51759bf46b61a23b31.jpg?s=120&d=mm&r=g)
Using Mailman version: 2.1.33 packaged for cPanel.
Running the script I obtained from https://www.msapiro.net/scripts/check_arch changes directory and file permissions and ownership. For example, in /archives/private/:
drwxr-x--- 5 mailman username listname_mydomain.org
becomes
drwxrwxr-x 5 root root listname_mydomain.org
And the list then stops archiving.
Is there a way to adjust the script? Or run some command afterwards to set things back to where they were?
Thanks for any help!
Dean Collins
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
On 10/25/21 11:11 AM, Dean Collins wrote:
Don't run Mailman scripts as root. Always run them as the Mailman user.
Is there a way to adjust the script? Or run some command afterwards to set things back to where they were?
You can run chmod and chown to set things back, but even if the script is run as root, I don't see how this would happen. The script opens the file read-only and only reads it.
This must be a cPanel thing. See https://wiki.list.org/DOC/Mailman%20and%20CPanel
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/28a1557a7bb6dc51759bf46b61a23b31.jpg?s=120&d=mm&r=g)
Thanks!
Dean
-----Original Message----- From: Mark Sapiro <mark@msapiro.net> Sent: Tuesday, October 26, 2021 11:55 AM To: mailman-users@python.org Subject: [Mailman-Users] Re: check_arch script changing owner
On 10/25/21 11:11 AM, Dean Collins wrote:
Don't run Mailman scripts as root. Always run them as the Mailman user.
Is there a way to adjust the script? Or run some command afterwards to set things back to where they were?
You can run chmod and chown to set things back, but even if the script is run as root, I don't see how this would happen. The script opens the file read-only and only reads it.
This must be a cPanel thing. See https://wiki.list.org/DOC/Mailman%20and%20CPanel
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Users mailing list -- mailman-users@python.org To unsubscribe send an email to mailman-users-leave@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/
![](https://secure.gravatar.com/avatar/28a1557a7bb6dc51759bf46b61a23b31.jpg?s=120&d=mm&r=g)
Okay, I figured out how to prune with cPanel installations. Your (Mark's) script is much faster, of course, but this works.
During the process, I turned off archiving in the web interface, though I don't know whether that was necessary.
In cPanel, the archives are in /usr/local/cpanel/3rdparty/mailman/archives/private.
Move the archive directory out of the way: mv listname listname.save
Edit/prune the listname.mbox file (or empty it with cp /dev/null).
Turn archiving back on, send a test message, confirm it's been archived, delete the listname.save directory.
Anyway, thanks again!
Dean
-----Original Message----- From: Mark Sapiro <mark@msapiro.net> Sent: Tuesday, October 26, 2021 11:55 AM To: mailman-users@python.org Subject: [Mailman-Users] Re: check_arch script changing owner
On 10/25/21 11:11 AM, Dean Collins wrote:
Don't run Mailman scripts as root. Always run them as the Mailman user.
Is there a way to adjust the script? Or run some command afterwards to set things back to where they were?
You can run chmod and chown to set things back, but even if the script is run as root, I don't see how this would happen. The script opens the file read-only and only reads it.
This must be a cPanel thing. See https://wiki.list.org/DOC/Mailman%20and%20CPanel
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Users mailing list -- mailman-users@python.org To unsubscribe send an email to mailman-users-leave@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/
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
On 10/29/21 5:10 PM, Dean Collins wrote:
Okay, I figured out how to prune with cPanel installations. Your (Mark's) script is much faster, of course, but this works.
I'm confused. Your original post mentioned my https://www.msapiro.net/scripts/check_arch script but this has nothing to do with pruning archives. That script is https://www.msapiro.net/scripts/prune_arch and it could definitely change the ownership and mode of the .mbox and other files/directories if run as root. If you run it as the Mailman user, it should be OK.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
On 10/25/21 11:11 AM, Dean Collins wrote:
Don't run Mailman scripts as root. Always run them as the Mailman user.
Is there a way to adjust the script? Or run some command afterwards to set things back to where they were?
You can run chmod and chown to set things back, but even if the script is run as root, I don't see how this would happen. The script opens the file read-only and only reads it.
This must be a cPanel thing. See https://wiki.list.org/DOC/Mailman%20and%20CPanel
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/28a1557a7bb6dc51759bf46b61a23b31.jpg?s=120&d=mm&r=g)
Thanks!
Dean
-----Original Message----- From: Mark Sapiro <mark@msapiro.net> Sent: Tuesday, October 26, 2021 11:55 AM To: mailman-users@python.org Subject: [Mailman-Users] Re: check_arch script changing owner
On 10/25/21 11:11 AM, Dean Collins wrote:
Don't run Mailman scripts as root. Always run them as the Mailman user.
Is there a way to adjust the script? Or run some command afterwards to set things back to where they were?
You can run chmod and chown to set things back, but even if the script is run as root, I don't see how this would happen. The script opens the file read-only and only reads it.
This must be a cPanel thing. See https://wiki.list.org/DOC/Mailman%20and%20CPanel
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Users mailing list -- mailman-users@python.org To unsubscribe send an email to mailman-users-leave@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/
![](https://secure.gravatar.com/avatar/28a1557a7bb6dc51759bf46b61a23b31.jpg?s=120&d=mm&r=g)
Okay, I figured out how to prune with cPanel installations. Your (Mark's) script is much faster, of course, but this works.
During the process, I turned off archiving in the web interface, though I don't know whether that was necessary.
In cPanel, the archives are in /usr/local/cpanel/3rdparty/mailman/archives/private.
Move the archive directory out of the way: mv listname listname.save
Edit/prune the listname.mbox file (or empty it with cp /dev/null).
Turn archiving back on, send a test message, confirm it's been archived, delete the listname.save directory.
Anyway, thanks again!
Dean
-----Original Message----- From: Mark Sapiro <mark@msapiro.net> Sent: Tuesday, October 26, 2021 11:55 AM To: mailman-users@python.org Subject: [Mailman-Users] Re: check_arch script changing owner
On 10/25/21 11:11 AM, Dean Collins wrote:
Don't run Mailman scripts as root. Always run them as the Mailman user.
Is there a way to adjust the script? Or run some command afterwards to set things back to where they were?
You can run chmod and chown to set things back, but even if the script is run as root, I don't see how this would happen. The script opens the file read-only and only reads it.
This must be a cPanel thing. See https://wiki.list.org/DOC/Mailman%20and%20CPanel
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Users mailing list -- mailman-users@python.org To unsubscribe send an email to mailman-users-leave@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/
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
On 10/29/21 5:10 PM, Dean Collins wrote:
Okay, I figured out how to prune with cPanel installations. Your (Mark's) script is much faster, of course, but this works.
I'm confused. Your original post mentioned my https://www.msapiro.net/scripts/check_arch script but this has nothing to do with pruning archives. That script is https://www.msapiro.net/scripts/prune_arch and it could definitely change the ownership and mode of the .mbox and other files/directories if run as root. If you run it as the Mailman user, it should be OK.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Dean Collins
-
Mark Sapiro