emersion / go-smtp

📤 An SMTP client & server library written in Go
MIT License
1.72k stars 216 forks source link

Fix broken encodeXtext() #232

Closed ikedas closed 1 year ago

ikedas commented 1 year ago

With this method call:

email := "e=mc2@example.com"
c.Mail(email, &MailOptions{Auth: &email})

this should be sent to the server:

MAIL FROM:<e=mc2@example.com> AUTH=e+3Dmc2@example.com

However, following thing is sent:

MAIL FROM:<e=mc2@example.com> AUTH=e+65+3D=+3Dm+6Dc+632+32@+40e+65x+78a+61m+6Dp+70l+6Ce+65.+2Ec+63o+6Fm+6D

This PR will fix it.

emersion commented 1 year ago

Overall LGTM, the old code was definitely broken.