Export cPanel Mailinglist to a txt file

Special Shoutout to authors of the below post for inspiration.

https://www.werockyourweb.com/how-export-cpanels-mailman-mailing-list/

Here is a nice oneliner to export a mailing list for a client lickety-split.

Replace the user and maillist_email variables in the beginning to match yours.

user="cpanelusername";maillist_email="examplelist@example.com";LISTNAME=$(echo $maillist_email|sed -e 's/@/_/') ; /usr/local/cpanel/3rdparty/mailman/bin/list_members ${LISTNAME} > /home/$user/${LISTNAME}_subscribers.txt && chown ${user}:${user} /home/$user/${LISTNAME}_subscribers.txt