Description
When sending an email via gog gmail send --from, the display name from the Gmail send-as alias gets double-encoded in the From header if it contains non-ASCII characters.
Steps to Reproduce
- Have a send-as alias with a display name containing UTF-8 characters, e.g.
Sérgio Bastos • Importrust
- Send an email:
gog gmail send \
--account user@gmail.com \
--from alias@domain.com \
--to recipient@example.com \
--subject "Test" \
--body "Test email"
Expected
From header displays: Sérgio Bastos • Importrust <alias@domain.com>
Actual
From header displays: Sérgio Bastos • Importrust <alias@domain.com>
This is a classic UTF-8 double-encoding issue - the bytes of the UTF-8 string are being interpreted as Latin-1/ISO-8859-1 and then re-encoded as UTF-8.
Environment
- gogcli version: v0.10.0
- OS: macOS (Darwin, arm64)
Workaround
Changing the display name to ASCII-only characters via gog gmail sendas update is not viable as it requires domain-wide delegation (service account), returning a 403 error for regular OAuth tokens.
Currently there is no workaround other than changing the display name in Gmail web to remove non-ASCII characters.
Description
When sending an email via
gog gmail send --from, the display name from the Gmail send-as alias gets double-encoded in the From header if it contains non-ASCII characters.Steps to Reproduce
Sérgio Bastos • ImportrustExpected
From header displays:
Sérgio Bastos • Importrust <alias@domain.com>Actual
From header displays:
Sérgio Bastos • Importrust <alias@domain.com>This is a classic UTF-8 double-encoding issue - the bytes of the UTF-8 string are being interpreted as Latin-1/ISO-8859-1 and then re-encoded as UTF-8.
Environment
Workaround
Changing the display name to ASCII-only characters via
gog gmail sendas updateis not viable as it requires domain-wide delegation (service account), returning a 403 error for regular OAuth tokens.Currently there is no workaround other than changing the display name in Gmail web to remove non-ASCII characters.