Github user Humbedooh commented on the issue:
https://github.com/apache/incubator-ponymail/issues/371
Here's a simple workaround for the base64 encoding when it happens:
~~~
--- a/site/api/source.lua
+++ b/site/api/source.lua
@@ -46,6 +46,10 @@ function handle(r)
if aaa.canAccessDoc(r, doc, account) then
local doc_raw = elastic.get('mbox_source', doc.request_id)
if doc_raw then
+ -- If this could be base64, try to convert it.
+ if (#doc_raw.source % 4 == 0) then -- base64 is always
multiples of 4, this is the fastest test.
+ pcall(function() doc_raw.source =
r:base64_decode(doc_raw.source) end) -- try to convert, fall back to original
if failed
+ end
r:puts(doc_raw.source)
else
r:puts("Could not find the email source, sorry!")
~~~
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---