-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Email decoding issue #348
Comments
@D3strukt0r I can confirm the decoding issue using your sample messages, and I can also confirm that this is originating "upstream" in the jhillyerd/enmime module (which Mailpit uses to decode messages). I was able to replicate it with a simple test to rule out that it is related in any way to Mailpit (see below). What I can't confirm is whether it has anything to do with your message encoding / structure (I cannot see any obvious issue). It is very strange how just a slight change causes the issue, so it appears to be a possible issue with main.gopackage main
import (
"bufio"
"fmt"
"os"
"github.com/jhillyerd/enmime"
)
func main() {
if len(os.Args) != 2 {
fmt.Printf("usage: %s <message>\n", os.Args[0])
os.Exit(1)
}
file, err := os.Open(path.Clean(os.Args[1]))
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
defer file.Close()
r := bufio.NewReader(file)
env, err := enmime.ReadEnvelope(r)
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
fmt.Println("## TEXT ##")
fmt.Println(env.Text)
fmt.Println("## HTML ##")
fmt.Println(env.HTML)
} Working example:go run . example-works.eml.txt
## TEXT ##
Loggen Sie sich ein, um die Einladung zu akzeptieren oder geben Sie den folge
Nachricht:
öoöo
## HTML ##
Loggen Sie sich ein, um die Einladung zu akzeptieren oder geben <br />
<br />Nachricht:<br />
öoöo<br /> Broken example:go run . example-broken.eml.txt
## TEXT ##
Loggen Sie sich ein, um die Einladung zu akzeptieren oder geben Sie den folgen
Nachricht:
öoöo
## HTML ##
Loggen Sie sich ein, um die Einladung zu akzeptieren oder geben S<br />
<br />Nachricht:<br />
öoöo<br /> My suggestion would be for you to report the issue to jhillyerd/enmime and hopefully someone there can either confirm (and potentially fix) the issue, or explain why your message is causing this. It may be useful to reference this issue to save them time. |
I can confirm that I get the correct decoding using the default Go library, so I am almost 100% certain it's an upstream (enmime) issue. I will continue to investigate and see if I can find a workaround as I'm not entirely sure a fix will come any time soon. |
I've found the reason why this happens (commented on in the issue you reported) - will wait for a response to try understand why before I look at a solution (assuming it's not a bug). |
@D3strukt0r I have just released v1.20.3 which should provide a solution for your issue. Please confirm it is working correctly for you now? Thanks. |
@axllent yes seems to be working fine for me now :) thank you a lot <3 |
That's fantastic, thank you for the feedback. |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [axllent/mailpit](https://github.com/axllent/mailpit) | patch | `v1.20.2` -> `v1.20.3` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>axllent/mailpit (axllent/mailpit)</summary> ### [`v1.20.3`](https://github.com/axllent/mailpit/blob/HEAD/CHANGELOG.md#v1203) [Compare Source](axllent/mailpit@v1.20.2...v1.20.3) ##### Chore - Update caniemail database - Update node dependencies - Update Go dependencies - Do not recenter selected messages in sidebar on every new message ##### Fix - Disable automatic HTML/Text character detection when charset is provided ([#​348](axllent/mailpit#348)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Hello, we have been trying to figure out for hours now if an email we are sending from our backend is sending the email faulty or if it's mailpit display that's broken, and after rigorous testing we figured something is off with mailpit
Here are a working case (any length shorter or equal to this will work)
example-works.eml.txt
And an example where anything longer or equal to this length (not sure if this is actually true) will break
example-broken.eml.txt
when being sent to any other mailcatcher software or opening in MS Outlook, it is displayed correctly
I hope this can help you identify the issue :)
PS: I tested with Mailpit v1.20.1
The text was updated successfully, but these errors were encountered: