プロジェクト

全般

プロフィール

Vote #79044

完了

Empty email attachments are imported to Redmine, creating broken DB records

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Email receiving_29
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
29
version_id:
136
issue_org_id:
27885
author_id:
3866
assigned_to_id:
0
comments:
4
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Redmine generally disallows empty or 0-byte-sized attachments, this is not checked when importing attachments from emails through the @MailHandler@ though.

In the case of an empty email attachment, an @Attachment@ record is created, though without @disk_filename@, @disk_directory@ and @digest@. The attachment is then shown in the attachment list of the issue, but clicking on the attachment link to see the attachment or to download it leads to an error, as there is no file on disk for that attachment.


journals

The attached patch fixes this issues and adds a test for that case. The fixture email is copied from the @ticket_with_attachment.eml@ fixture and adapted accordingly. It is probably also possible to merge this test into the general attachments for emails test in that same test file.

It might also be possible and a good idea to switch to @ActsAsAttachable#save_attachments@ to save email attachments in the @MailHandler@, as in that case attachment handling in the @MailHandler@ would not need to be manually synced with the logic of other places.
--------------------------------------------------------------------------------
LGTM.
The fix also can be applied to 3.4-stable and 3.3-stable. Setting target version to 3.3.6.
--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------
Thank you!
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリEmail receiving_29 にセット
  • 対象バージョン3.3.6_136 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0