dataset/seed/applicationservice/2022.03.08/mailman/funcs/mailman.py

21 lines
602 B
Python
Raw Normal View History

2022-03-11 18:41:49 +01:00
from risotto.utils import multi_function as _multi_function
2022-03-08 19:42:28 +01:00
from itertools import chain
@_multi_function
def mailman_emails(lists, domain):
ret = []
for lst in lists:
2022-03-20 21:14:13 +01:00
for suffix in [None, 'bounces(\+.*)?', 'confirm(\+.*)?', 'join', 'leave', 'owner', 'request', 'subscribe', 'unsubscribe']:
2022-03-08 19:42:28 +01:00
if suffix:
lst_name = lst + '-' + suffix
else:
lst_name = lst
ret.append(lst_name + '@' + domain)
return ret
@_multi_function
def mailman_concat(lists):
# list of lists to a single list
return list(chain(*lists))