This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new f3bb5d4  Add message ID, rename header field for composer version
f3bb5d4 is described below

commit f3bb5d4878e2bd2655451ff76a29817d83f7c388
Author: Daniel Gruno <[email protected]>
AuthorDate: Sat Nov 13 15:51:54 2021 +0100

    Add message ID, rename header field for composer version
---
 server/endpoints/compose.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/endpoints/compose.py b/server/endpoints/compose.py
index 561bf18..25b7736 100644
--- a/server/endpoints/compose.py
+++ b/server/endpoints/compose.py
@@ -25,8 +25,9 @@ import aiosmtplib
 import fnmatch
 import typing
 import aiohttp.web
+import uuid
 
-COMPOSER_VERSION = "0.3"  # Bump when changing logic
+COMPOSER_VERSION = "0.4"  # Bump when changing logic
 
 async def process(
     server: plugins.server.BaseServer,
@@ -74,7 +75,8 @@ async def process(
             msg["To"] = to
             msg["Subject"] = str(email.header.Header(subject, "utf-8"))
             msg["Date"] = email.utils.formatdate()
-            msg["X-Sender"] = "Apache Pony Mail Foal Composer v/%s" % 
COMPOSER_VERSION
+            msg["Message-ID"] = f"<{pony-str(uuid.uuid4())}-{to}>"
+            msg["User-Agent"] = "Apache Pony Mail Foal Composer v/%s" % 
COMPOSER_VERSION
             msg.set_charset("utf-8")
             msg.set_content(body)
             await aiosmtplib.send(msg, hostname=mailhost, port=mailport)

Reply via email to