diff --git a/email_headers/README.md b/email_headers/README.md old mode 100755 new mode 100644 diff --git a/email_headers/__manifest__.py b/email_headers/__manifest__.py index 9368e65..2cd38fb 100644 --- a/email_headers/__manifest__.py +++ b/email_headers/__manifest__.py @@ -23,17 +23,17 @@ "name": "Default Email Headers", "version": "13.0.1.2.0", "license": "AGPL-3", - "description": """ + "summary": """ Adds fields on outgoing email server that allows you to better control the outgoing email headers and Reply-To addresses. """, - "data": ["data/ir_config_parameter_data.xml", "views/ir_mail_server_views.xml",], + "data": ["data/ir_config_parameter_data.xml", "views/ir_mail_server_views.xml"], "author": "Avoin.Systems", "website": "https://avoin.systems", "category": "Email", "depends": ["mail"], "external_dependencies": { - "python": ["Crypto.Cipher.AES",], # pip3 install pycryptodome + "python": ["Crypto.Cipher.AES"], # pip3 install pycryptodome "bin": [], }, "installable": True, diff --git a/email_headers/models/mail.py b/email_headers/models/mail.py index 32d65c4..0d878b8 100644 --- a/email_headers/models/mail.py +++ b/email_headers/models/mail.py @@ -57,15 +57,15 @@ def get_cipher(env): ) -def encode_msg_id(id, env): - id_padded = "%016d" % id +def encode_msg_id(msg_id, env): + id_padded = "%016d" % msg_id encrypted = get_cipher(env).encrypt(id_padded.encode("utf-8")) return base64.b32encode(encrypted).decode("utf-8") # Remove in Odoo 14 -def encode_msg_id_legacy(id, env): - id_padded = "%016d" % id +def encode_msg_id_legacy(msg_id, env): + id_padded = "%016d" % msg_id encrypted = get_cipher(env).encrypt(id_padded.encode("utf-8")) return base64.urlsafe_b64encode(encrypted).decode("utf-8") @@ -106,7 +106,7 @@ class MailServer(models.Model): _inherit = "ir.mail_server" reply_to_method = fields.Selection( - [("default", "Odoo Default"), ("alias", "Alias"), ("msg_id", "Message ID"),], + [("default", "Odoo Default"), ("alias", "Alias"), ("msg_id", "Message ID")], "Reply-To Method", default="default", help="Odoo Default: Don't add any unique identifiers into the\n" @@ -573,7 +573,7 @@ class MailThread(models.AbstractModel): message_id, ) body = self.env.ref("mail.mail_bounce_catchall").render( - {"message": message,}, engine="ir.qweb" + {"message": message}, engine="ir.qweb" ) self._routing_create_bounce_email( email_from, body, message, reply_to=self.env.user.company_id.email diff --git a/email_headers/tests/test_email.py b/email_headers/tests/test_email.py index ccde8ee..dfcd121 100644 --- a/email_headers/tests/test_email.py +++ b/email_headers/tests/test_email.py @@ -1,3 +1,5 @@ +# No need to translate tests +# pylint: disable=translation-required from email.message import EmailMessage import mock