haraka / Haraka

A fast, highly extensible, and event driven SMTP server
https://haraka.github.io
MIT License
4.99k stars 661 forks source link

Process uuencoded files from body as attachments #2758

Open Zerstoren opened 4 years ago

Zerstoren commented 4 years ago

system info

Haraka Haraka.js — Version: 2.8.24
Node v10.16.0
OS Linux chd 4.4.0-170-generic #199-Ubuntu SMP Thu Nov 14 01:45:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
openssl OpenSSL 1.1.0h 27 Mar 2018 (Library: OpenSSL 1.1.1d 10 Sep 2019)

We get some of emails with attachments included in body as uuencoded files. It's very old format but unfortunately it is still used.

Haraka should process such emails, extract uuencoded files from them (cut from body) and provide them as attachments.

It looks like this library is capable of doing all the work: https://www.npmjs.com/package/uue

For example, you can use this email

MIME-Version: 1.0
Received: by 10.217.58.201 with HTTP; Tue, 6 May 2014 05:57:27 -0700 (PDT)
Date: Tue, 6 May 2014 15:57:27 +0300
Subject: Test message
From: example@example.com
To: example@example.com

Some content before

begin 644 odt_uuencoding_file.dat
94W5P97(L(&%T=&%C:&UE;G0@9&5C;V1E9```
`
end

Some content after
mitridatik commented 4 years ago

We have the same issue. Attachment content of such emails goes to body.