Hello, I want to have a mailman configured together with virtual alias. To do that I need to use alias_domain. I have tried to do it with mailman shell. The domain seams to be created but when I leave the shell and enter again, the domain is not longer there.
On the other hand, If I create a domain in administrator interface, it is not listed in the shell. If I create in the web interface, which field correspond to the alias_domain : Domain Name, Display Name , Mail domain?
The code I use in the shell is:
mailman shell
from mailman.interfaces.domain import IDomainManager from zope.component import getUtility manager = getUtility(IDomainManager) from operator import attrgetter def show_domains(*, with_owners=False): if len(manager) == 0: print('no domains') return for domain in sorted(manager, key=attrgetter('mail_host')): print(domain) owners = sorted(owner.addresses[0].email for owner in domain.owners) for owner in owners: print('- owner:', owner)
manager.add('example.edu',alias_domain='x.example.edu') show_domains(with_owners=True) exit()
Thanks in advance
Albert