Gitea does not accept user emails hosted at ip addresses instead of domain names. #7733

Open
opened 2025-11-02 07:34:53 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @ghost on GitHub (Aug 23, 2021).

  • 1.14.6:
  • Git version: irrelevant
  • Operating system: OpenSUSE, 15.3, but should be irrelevant
  • Database (use [x]): irrelevant
    • PostgreSQL
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
    No log up to this point.

Description

Gitea does not accept user emails hosted at ip addresses instead of domain names.

I have a small office, and we do not run a DNS server. We exchange emails by mailing each other to username@[192.168.1.5]

I would like to receive notifications from Gitea at least until we can hire a system administrator.

However, Gitea does not allow registering new users with such emails, and if registered with a fake one, does not allow adding such an email address.

...

Originally created by @ghost on GitHub (Aug 23, 2021). - 1.14.6: - Git version: irrelevant - Operating system: OpenSUSE, 15.3, but should be irrelevant - Database (use `[x]`): irrelevant - [x] PostgreSQL - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) - [ ] No - Log gist: No log up to this point. ## Description Gitea does not accept user emails hosted at ip addresses instead of domain names. I have a small office, and we do not run a DNS server. We exchange emails by mailing each other to `username@[192.168.1.5]` I would like to receive notifications from Gitea at least until we can hire a system administrator. However, Gitea does not allow registering new users with such emails, and if registered with a fake one, does not allow adding such an email address. ...
Author
Owner

@noerw commented on GitHub (Aug 23, 2021):

I'm tempted to say this is a won't-fix due to it being a rare edge case + I'm fairly certain that setting up a local DNS is much less effort than making this work with gitea.

Alternatively you could make a custom build of gitea, and change the email adress validator

@noerw commented on GitHub (Aug 23, 2021): I'm tempted to say this is a won't-fix due to it being a rare edge case + I'm fairly certain that setting up a local DNS is much less effort than making this work with gitea. Alternatively you could make a custom build of gitea, and change the [email adress validator](https://github.com/go-gitea/gitea/blob/95f40047efe5bf9cf0d32315a2b95f04217f613a/models/user_mail.go?plain=1#L39-L51)
Author
Owner

@noerw commented on GitHub (Aug 23, 2021):

related: #16695
maybe the email validator needs an overhaul anyway..

@noerw commented on GitHub (Aug 23, 2021): related: #16695 maybe the email validator needs an overhaul anyway..
Author
Owner

@ghost commented on GitHub (Aug 23, 2021):

For what it is worth:

https://changelog.com/posts/theres-only-one-way-to-validate-an-email-address

@ghost commented on GitHub (Aug 23, 2021): For what it is worth: https://changelog.com/posts/theres-only-one-way-to-validate-an-email-address
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7733