dataset/seed/applicationservice/2022.03.08/dovecot/funcs/dovecot.py
2022-03-29 16:30:38 +02:00

20 lines
585 B
Python

from crypt import crypt as _crypt
from string import ascii_letters as _ascii_letters, digits as _digits
from secrets import choice as _choice
from risotto.utils import multi_function as _multi_function
def sha512_crypt(password):
salt = ''.join([_choice(_ascii_letters + _digits) for _ in range(8)])
prefix = '$6$'
return _crypt(password, prefix + salt)
@_multi_function
def calc_well_known(*args):
if None in args:
return
ret = []
for dom in args[1]:
ret.append(f'https://{args[0]}/mail/{dom}/autodiscover/autodiscover.xml')
return ret