Mailgun setup fails certificate validation #9604

Closed
opened 2025-11-02 08:44:15 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @miguelpeixe on GitHub (Sep 22, 2022).

Description

While setting up Mailgun with either:

HOST=smtp.mailgun.com:587
IS_TLS_ENABLED=true

or

HOST=smtp.mailgun.com:465
IS_TLS_ENABLED=false

Returns the following error while sending a test email:

gomail: could not send email 1: StartTLS: x509: certificate is valid for *.mailgun.org, mailgun.org, not smtp.mailgun.com

Seems like a bug in validation, since *.mailgun.org is a wildcard that covers smtp.mailgun.com

Gitea Version

1.17.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Latest stable image under docker

Database

MySQL

Originally created by @miguelpeixe on GitHub (Sep 22, 2022). ### Description While setting up Mailgun with either: ``` HOST=smtp.mailgun.com:587 IS_TLS_ENABLED=true ``` or ``` HOST=smtp.mailgun.com:465 IS_TLS_ENABLED=false ``` Returns the following error while sending a test email: ``` gomail: could not send email 1: StartTLS: x509: certificate is valid for *.mailgun.org, mailgun.org, not smtp.mailgun.com ``` Seems like a bug in validation, since `*.mailgun.org` is a wildcard that covers `smtp.mailgun.com` ### Gitea Version 1.17.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Latest stable image under docker ### Database MySQL
GiteaMirror added the issue/needs-feedback label 2025-11-02 08:44:15 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Sep 22, 2022):

gomail: could not send email 1: StartTLS: x509: certificate is valid for *.mailgun.org, mailgun.org, not smtp.mailgun.com

I think this message is clear, it said that you are connecting to smtp.mailgun.com, but smtp.mailgun.com claims that it uses certificates for *.mailgun.org, mailgun.org. It doesn't look like a Gitea problem.

@wxiaoguang commented on GitHub (Sep 22, 2022): ``` gomail: could not send email 1: StartTLS: x509: certificate is valid for *.mailgun.org, mailgun.org, not smtp.mailgun.com ``` I think this message is clear, it said that you are connecting to `smtp.mailgun.com`, but `smtp.mailgun.com` claims that it uses certificates for `*.mailgun.org, mailgun.org`. It doesn't look like a Gitea problem.
Author
Owner

@wxiaoguang commented on GitHub (Sep 22, 2022):

The question could only be answered by mailgun

@wxiaoguang commented on GitHub (Sep 22, 2022): The question could only be answered by mailgun
Author
Owner

@miguelpeixe commented on GitHub (Sep 22, 2022):

Huh, I just now saw the TLD 🤦

@miguelpeixe commented on GitHub (Sep 22, 2022): Huh, I just now saw the TLD 🤦
Author
Owner

@wxiaoguang commented on GitHub (Sep 22, 2022):

Indeed, according to mailgun's document https://documentation.mailgun.com/en/latest/quickstart-sending.html

You should use smtp.mailgun.org , but no the .com

@wxiaoguang commented on GitHub (Sep 22, 2022): Indeed, according to mailgun's document https://documentation.mailgun.com/en/latest/quickstart-sending.html You should use smtp.mailgun.org , but no the `.com`
Author
Owner

@miguelpeixe commented on GitHub (Sep 22, 2022):

Yep! Thank you :)

@miguelpeixe commented on GitHub (Sep 22, 2022): Yep! Thank you :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9604