nextcloud / nextcloud/mail

eml not attached when "mark as spam"

Open
#12,943 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug needs info
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Steps to reproduce

Some emails when marked as spam are not being attached when forwarding to my spam@mydomain.com.

I'm not really sure why with some emails it works ok but with some others doesn't.

I think it could be related with some odd characters or emojis on the subject, but I couldn't always reproduce.

Expected behavior

I was expecting that after eml name, the actual eml content

Actual behavior

See this example:

Content-Type: multipart/mixed; boundary="=_pFyz-xNmOnKyMMkP2g2Bn6R"
MIME-Version: 1.0

This message is in MIME format.

--=pFyz-xNmOnKyMMkP2g2Bn6R
Content-Type: multipart/alternative; boundary="=
-uOQk8wOCf0_vv_q92EICfx"

This message is in MIME format.

--=_-uOQk8wOCf0_vv_q92EICfx
Content-Type: text/plain; charset=utf-8

Learn as Junk
--=_-uOQk8wOCf0_vv_q92EICfx
Content-Type: text/html; charset=utf-8

Learn as Junk

--=_-uOQk8wOCf0_vv_q92EICfx--

--=_pFyz-xNmOnKyMMkP2g2Bn6R
Content-Type: message/rfc822;
name0=utf-8''Hac%C3%A9%20tus%20env%C3%ADos%20m%C3%A1s%20f%C3%A1ciles%20y;
name1=%20r%C3%A1pidos%3A%203%20pasos%20para%20lograrlo.eml

--=_pFyz-xNmOnKyMMkP2g2Bn6R--

Mail app version

5.7.15

Nextcloud version

33.0.3

Mailserver or service

dovecot

Operating system

ubuntu 22.04

PHP engine version

PHP 8.3

Nextcloud memory caching

No response

Web server

None

Database

None

Additional info

I understand that attaching the full email message will always have all the needed information. but as a mail server admin a simplified (and truncated) version with some fields would be better to have, like:

DateTime:
From:
To:
CC:
Reply-To:
Subject:
Truncated Body:
Size:
Attachment names:

It could be json encoded and be sent by email.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the “mark as spam” forwarding flow with the supplied MIME example, then trace where the EML attachment content is generated. The fix is complete when affected messages, including subjects with encoded characters or emojis, are forwarded with the full EML content attached.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.