Skip to content
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

EML Attactment Issue #303

Open
samrocks1011 opened this issue Sep 18, 2023 · 0 comments
Open

EML Attactment Issue #303

samrocks1011 opened this issue Sep 18, 2023 · 0 comments
Labels

Comments

@samrocks1011
Copy link

What I did: We are using your code to decode the real-time SMTP mail and add footer text at the end of the mail. After necessary changes, we encode the mail again and if the original mail contains eml files(message/rfc822) as an attachment, the eml file is converted in base64 content, which is not supported as per RFC ( https://www.w3.org/Protocols/rfc1341/7_3_Message.html ) . We have found the issue in encode.go file where any attachment is found it was setting the Encoding to base64.

What I expected: We changed the encode.go file on the 89 line. Below is the code.

cte := te7Bit
if len(p.Content) > 0 {
if strings.Contains(p.ContentType, "message") {
cte = 6
} else {
cte = teBase64
}
// cte = teBase64

if p.TextContent() {
cte = selectTransferEncoding(p.Content, false)
if p.Charset == "" {
p.Charset = utf8
}
}
// RFC 2045: 7bit is assumed if CTE header not present.
switch cte {
case teBase64:
p.Header.Set(hnContentEncoding, cteBase64)
case teQuoted:
p.Header.Set(hnContentEncoding, cteQuotedPrintable)
}
}


What I got:

Release or branch I am using:

(Please attach a sample message if you feel it will help reproduce the issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants