On Thu, 6 Jan 2022 at 17:16, <humbed...@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 <humbed...@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(),

Reply via email to