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 2022/01/06 17:16:20 UTC

[incubator-ponymail-foal] branch master updated: Fake attachment name if inline attached forwarded email

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 fda19d2  Fake attachment name if inline attached forwarded email
fda19d2 is described below

commit fda19d2896708c796925c7104f3a38c777d9bd70
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Thu Jan 6 18:16:14 2022 +0100

    Fake attachment name if inline attached forwarded email
---
 tools/archiver.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/archiver.py b/tools/archiver.py
index 0af7f59..43d44f9 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -139,6 +139,9 @@ def parse_attachment(
             if fd is None:
                 return None, None
             filename = part.get_filename()
+            # If inline-attached email, fake a name
+            if not filename and part.get_content_type() and part.get_content_type().lower() == "message/rfc822":
+                filename = "attached_email.eml"
             if filename:
                 attachment = {
                     "content_type": part.get_content_type(),

Re: [incubator-ponymail-foal] branch master updated: Fake attachment name if inline attached forwarded email

Posted by sebb <se...@gmail.com>.
On Thu, 6 Jan 2022 at 17:16, <hu...@apache.org> wrote:
>
> 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 fda19d2  Fake attachment name if inline attached forwarded email
> fda19d2 is described below
>
> commit fda19d2896708c796925c7104f3a38c777d9bd70
> Author: Daniel Gruno <hu...@apache.org>
> AuthorDate: Thu Jan 6 18:16:14 2022 +0100
>
>     Fake attachment name if inline attached forwarded email
> ---
>  tools/archiver.py | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/tools/archiver.py b/tools/archiver.py
> index 0af7f59..43d44f9 100755
> --- a/tools/archiver.py
> +++ b/tools/archiver.py
> @@ -139,6 +139,9 @@ def parse_attachment(
>              if fd is None:
>                  return None, None
>              filename = part.get_filename()
> +            # If inline-attached email, fake a name

There is no check for inline...

> +            if not filename and part.get_content_type() and part.get_content_type().lower() == "message/rfc822":

What about other unnamed attachments?

> +                filename = "attached_email.eml"

Why not use the content-type?

>              if filename:
>                  attachment = {
>                      "content_type": part.get_content_type(),