diff --git a/mayordomo/__init__.py b/mayordomo/__init__.py index e4ec6d4..84fd453 100644 --- a/mayordomo/__init__.py +++ b/mayordomo/__init__.py @@ -132,13 +132,13 @@ async def enviarCorreosDominio(dominioid): if dkimKey is not None: mail2send = Parser(policy=default).parsestr(carta.contenido) - signature = dkim.sign(carta.contenido.encode(), b'mayordomo', b'ilab.cl', dkimKey, include_headers=[b'from', b'to', b'subject', b'message-id']).decode().replace("\r\n",'') + signature = dkim.sign(carta.contenido.encode('utf-8'), b'mayordomo', b'ilab.cl', dkimKey, include_headers=[b'from', b'to', b'subject', b'message-id']).decode().replace("\r\n",'') await log.info("DKIM-Signature: {}".format(signature[len("DKIM-Signature: "):])) mail2send['DKIM-Signature'] = signature[len("DKIM-Signature: "):] - await smtp.sendmail(remitente.direccion, rcpt_to, mail2send.encode('utf-8')) + await smtp.sendmail(remitente.direccion, rcpt_to, mail2send.as_bytes()) else: await smtp.sendmail(remitente.direccion, rcpt_to, carta.contenido.encode('utf-8'))