FIX: don't strip eml attachments from received emails

This commit is contained in:
Maja Komel
2018-11-01 08:41:13 +01:00
parent 48501b0d45
commit 1ac3e5473a
3 changed files with 48 additions and 4 deletions

View File

@@ -882,7 +882,7 @@ module Email
def attachments
# strip blacklisted attachments (mostly signatures)
@attachments ||= begin
attachments = @mail.attachments.select { |attachment| is_whitelisted_attachment?(attachment) }
attachments = @mail.parts.select { |part| part.attachment? && is_whitelisted_attachment?(part) }
attachments << @mail if @mail.attachment? && is_whitelisted_attachment?(@mail)
attachments
end