Cannot send mail after merge when Username contains UTF8 character #863

Closed
opened 2025-11-02 03:39:28 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @Avalancs on GitHub (Jul 3, 2017).

  • Gitea version (or commit ref): 1.1.2
  • Git version: git version 2.13.0.windows.1
  • Operating system: Windows Server 2016 Standard
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant (cannot view logs)
  • Log gist:
    2017/07/03 12:14:19 [...les/mailer/mailer.go:244 processMailQueue()] [E] Failed to send emails [username@mycompany.com]: Subject: [Project] description (#16), issue comment - gomail: could not send email 1: gomail: invalid address "=?UTF-8?q?"P=C3=A9ter"_git@mycompany.com?=": mail: expected single address, got "?="

Description

After merging a commit in one of our repositories, I saw this in the log, which says it was unable to deliver the notification.

P=C3=A9ter

Should be

Péter

which is used as the Full name for that user (acquired through Active Directory), so I think the latin/utf8 character

é

causes the mentioned error.

Originally created by @Avalancs on GitHub (Jul 3, 2017). - Gitea version (or commit ref): 1.1.2 - Git version: git version 2.13.0.windows.1 - Operating system: Windows Server 2016 Standard - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant (cannot view logs) - Log gist: 2017/07/03 12:14:19 [...les/mailer/mailer.go:244 processMailQueue()] [E] Failed to send emails [username@mycompany.com]: Subject: [Project] description (#16), issue comment - gomail: could not send email 1: gomail: invalid address "=?UTF-8?q?\"P=C3=A9ter\"_<git@mycompany.com>?=": mail: expected single address, got "?=" ## Description After merging a commit in one of our repositories, I saw this in the log, which says it was unable to deliver the notification. > P=C3=A9ter Should be > Péter which is used as the Full name for that user (acquired through Active Directory), so I think the latin/utf8 character > é causes the mentioned error.
GiteaMirror added the type/bug label 2025-11-02 03:39:28 -06:00
Author
Owner

@lafriks commented on GitHub (Jul 3, 2017):

Seems to be validation problem as UTF-8 email address is correct

@lafriks commented on GitHub (Jul 3, 2017): Seems to be validation problem as UTF-8 email address is correct
Author
Owner

@Avalancs commented on GitHub (Jul 3, 2017):

I'll check tomorrow if this happens all the time, since I do remember receiving some notifications. Is the error message for not being able to deliver mails because e.g. the mail server is not available the same, or different?

@Avalancs commented on GitHub (Jul 3, 2017): I'll check tomorrow if this happens all the time, since I do remember receiving some notifications. Is the error message for not being able to deliver mails because e.g. the mail server is not available the same, or different?
Author
Owner

@lafriks commented on GitHub (Jul 3, 2017):

I could be wrong but seems to be validation in Gitea code

@lafriks commented on GitHub (Jul 3, 2017): I could be wrong but seems to be validation in Gitea code
Author
Owner

@rems4e commented on GitHub (Sep 8, 2017):

I'm facing this problem right now, where all of the people in my team have a name with characters out of basic latin character set… So none of them are receiving the emails :)

By the way the emails are generated by tickets update, if that's relevant.

Gitea is in version 1.1.4.

@rems4e commented on GitHub (Sep 8, 2017): I'm facing this problem right now, where all of the people in my team have a name with characters out of basic latin character set… So none of them are receiving the emails :) By the way the emails are generated by tickets update, if that's relevant. Gitea is in version 1.1.4.
Author
Owner

@Avalancs commented on GitHub (Sep 8, 2017):

Hi rems4e,

Our workaround for the problem was to replace/remove these characters in the Gitea database (since the full name was coming from AD we could not edit it on the UI) and since then everyone is receiving emails.

@Avalancs commented on GitHub (Sep 8, 2017): Hi rems4e, Our workaround for the problem was to replace/remove these characters in the Gitea database (since the full name was coming from AD we could not edit it on the UI) and since then everyone is receiving emails.
Author
Owner

@rems4e commented on GitHub (Sep 8, 2017):

Hi,

Thanks for the hint. But this is not really acceptable for us, as the directory is used for other stuffs that can't accomodate with this change.

Anyway, this is a bug in Gitea that is a little cumbersome at the moment :) Maybe I could have a look and try fixing it?

@rems4e commented on GitHub (Sep 8, 2017): Hi, Thanks for the hint. But this is not really acceptable for us, as the directory is used for other stuffs that can't accomodate with this change. Anyway, this is a bug in Gitea that is a little cumbersome at the moment :) Maybe I could have a look and try fixing it?
Author
Owner

@lafriks commented on GitHub (Sep 8, 2017):

@rems4e you are more than welcome to try to fix it and send PR

@lafriks commented on GitHub (Sep 8, 2017): @rems4e you are more than welcome to try to fix it and send PR
Author
Owner

@rems4e commented on GitHub (Sep 8, 2017):

@lafriks OK, that should be feasible. However, could you please hint me where to start? Mainly, on which branch should I base my work? I've had a look at the contributing info but I'm not sure it answers all of my questions :)

@rems4e commented on GitHub (Sep 8, 2017): @lafriks OK, that should be feasible. However, could you please hint me where to start? Mainly, on which branch should I base my work? I've had a look at the contributing info but I'm not sure it answers all of my questions :)
Author
Owner

@rems4e commented on GitHub (Oct 12, 2017):

I was hoping this could be in the 1.2.0 release. Is there something I can do to see it in 1.2.X ?

@rems4e commented on GitHub (Oct 12, 2017): I was hoping this could be in the 1.2.0 release. Is there something I can do to see it in 1.2.X ?
Author
Owner

@lafriks commented on GitHub (Oct 12, 2017):

@rems4e Backporting all fixed issues to 1.2 will take too much time. I think we will release 1.3-rc in coming weeks :) we are trying to switch to faster release cycle to not have such problems that we had with 1.2

@lafriks commented on GitHub (Oct 12, 2017): @rems4e Backporting all fixed issues to 1.2 will take too much time. I think we will release 1.3-rc in coming weeks :) we are trying to switch to faster release cycle to not have such problems that we had with 1.2
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#863