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 3d78afb  allow for + in message-id here
3d78afb is described below

commit 3d78afbf62d15bf7af3e822791d3dab5d36f0316
Author: Daniel Gruno <[email protected]>
AuthorDate: Fri Dec 31 19:30:43 2021 +0100

    allow for + in message-id here
---
 server/endpoints/source.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/server/endpoints/source.py b/server/endpoints/source.py
index ce25d68..9fa1b3e 100644
--- a/server/endpoints/source.py
+++ b/server/endpoints/source.py
@@ -27,12 +27,16 @@ import plugins.aaa
 async def process(
     server: plugins.server.BaseServer, session: plugins.session.SessionObject, 
indata: dict,
 ) -> aiohttp.web.Response:
+    listid = indata.get("list", "")
     # First, assume permalink and look up the email based on that
     email = await plugins.messages.get_email(session, 
permalink=indata.get("id"))
 
     # If not found via permalink, it might be message-id instead, so try that
     if email is None:
-        email = await plugins.messages.get_email(session, 
messageid=indata.get("id"), listid=indata.get("list", ""))
+        email = await plugins.messages.get_email(session, 
messageid=indata.get("id"), listid=listid)
+    if not email and ' ' in mailid: # only try again if we need to due to 
space in url
+        mailid = mailid.replace(" ", "+")
+        email = await plugins.messages.get_email(session, 
messageid=indata.get("id"), listid=listid)
 
     if email and isinstance(email, dict) and not email.get("deleted"):
         if plugins.aaa.can_access_email(session, email):

Reply via email to