You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2021/09/18 14:40:42 UTC

[incubator-ponymail-foal] branch master updated: older emails have the date on a single line by itself, thus, allow not just a space but any whitespace

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 d2d5dc3  older emails have the date on a single line by itself, thus, allow not just a space but any whitespace
d2d5dc3 is described below

commit d2d5dc33f178b45bec8363476e5182851d60b600
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sat Sep 18 09:40:38 2021 -0500

    older emails have the date on a single line by itself, thus, allow not just a space but any whitespace
---
 server/endpoints/mbox.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/endpoints/mbox.py b/server/endpoints/mbox.py
index 44e5475..8b60f76 100644
--- a/server/endpoints/mbox.py
+++ b/server/endpoints/mbox.py
@@ -37,7 +37,7 @@ async def convert_source(session: plugins.session.SessionObject, email: dict):
         if not source_as_text.startswith("From "):
             from_line = "From MAILER-DAEMON Thu Jan  1 00:00:00 1970\n"  # Fallback in case no date found
             # If we have any Received: headers, we can extrapolate an approximate time from the last (top) one.
-            from_match = re.search(r"(?:[\r\n]|^)Received:\s+from[^;]+?; (.+?)[\r\n]", source_as_text)
+            from_match = re.search(r"(?:[\r\n]|^)Received:\s+from[^;]+?;\s+(.+?)[\r\n]", source_as_text)
             if from_match:
                 recv_time = eutils.parsedate_tz(from_match.group(1))
                 if recv_time: