Update group membership using external database

Something API solution like that is what I would recommend. I’m not aware of a mailman-to-discourse solution. If you’re running the mailman server, you could add hooks there to add/remove people from the Discourse group when their subscription status changes, but a daily cronjob that syncs them is probably easier and nearly as effective. Depending on how many subscribers and churn rate, you could also be even more low-tech and just let people request access to the group or contrive to Invite individual users to a group.