SMTP configuration mismatch between Gitea and Postmark #11658

Open
opened 2025-11-02 09:43:41 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @ghost on GitHub (Sep 14, 2023).

Description

Issue:
When trying to configure Gitea to send mail via a Postmark SMTP server, the system is unable to send emails, the test end point in /admin/config does not even complete with an error - it simply spends forever trying to complete.

Details:
I've taken a number of steps to narrow this down. If I configure Gitea to any other SMTP server, I manage to get it working without too much trouble. If I use other ways of testing the Postmark SMTP server, it too manages to work. It's only when I put the two together that I get the broken behavior.

There are two methods of setting up an SMTP server with Postmark. One uses the API token for a Postmark server as both the user and password of the SMTP configuration. The other generates a special "access key" / "secret key" for a particular message stream. Through experimentation I found that only the first method is broken. (And again, it is only broken when I put it together with Gitea - the first method works just fine when tested in any other way).

I took a look at the debug log after trying to run the test email and this is the last line in the log

2023/09/14 22:11:27 ...eb/routing/logger.go:68:func1() [W] router: slow      POST /admin/config/test_mail for ***.***.***.***:0, elapsed 3847.4ms @ admin/config.go:30(admin.SendTestMail)

The page itself simply goes into a never ending loading state.

Gitea Version

1.20.3

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?

I am running Gitea from the binary installation instructions on an Ubuntu on systemd. No docker. Ubuntu version 22.04.2

Database

SQLite

Originally created by @ghost on GitHub (Sep 14, 2023). ### Description Issue: When trying to configure Gitea to send mail via a Postmark SMTP server, the system is unable to send emails, the test end point in /admin/config does not even complete with an error - it simply spends forever trying to complete. Details: I've taken a number of steps to narrow this down. If I configure Gitea to any other SMTP server, I manage to get it working without too much trouble. If I use other ways of testing the Postmark SMTP server, it too manages to work. It's only when I put the two together that I get the broken behavior. There are *two* methods of setting up an SMTP server with Postmark. One uses the API token for a Postmark server as both the user and password of the SMTP configuration. The other generates a special "access key" / "secret key" for a particular message stream. Through experimentation I found that only the *first* method is broken. (And again, it is only broken when I put it together with Gitea - the first method works just fine when tested in any other way). I took a look at the debug log after trying to run the test email and this is the last line in the log ``` 2023/09/14 22:11:27 ...eb/routing/logger.go:68:func1() [W] router: slow POST /admin/config/test_mail for ***.***.***.***:0, elapsed 3847.4ms @ admin/config.go:30(admin.SendTestMail) ``` The page itself simply goes into a never ending loading state. ### Gitea Version 1.20.3 ### 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? I am running Gitea from the binary installation instructions on an Ubuntu on systemd. No docker. Ubuntu version 22.04.2 ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 09:43:41 -06:00
Author
Owner

@techknowlogick commented on GitHub (Sep 14, 2023):

Without leaking any of your credentials, could you share your mailer config for postmark?

@techknowlogick commented on GitHub (Sep 14, 2023): Without leaking any of your credentials, could you share your mailer config for postmark?
Author
Owner

@ghost commented on GitHub (Sep 14, 2023):

Yes. I've tried a few different configurations - all that seem like they should work when I test postmark other ways.

[mailer]
ENABLED = true
PROTOCOL = smtp+starttls
SMTP_ADDR = smtp.postmarkapp.com
SMTP_PORT = 25
USER = *** Server API-Token ***
PASSWD = *** Server API-Token ***
FROM = git@mydomain.com

I have tried with smtp and with smtp+starttls and I have tried with port 25 and port 587. All had the same behavior.

@ghost commented on GitHub (Sep 14, 2023): Yes. I've tried a few different configurations - all that seem like they should work when I test postmark other ways. ``` [mailer] ENABLED = true PROTOCOL = smtp+starttls SMTP_ADDR = smtp.postmarkapp.com SMTP_PORT = 25 USER = *** Server API-Token *** PASSWD = *** Server API-Token *** FROM = git@mydomain.com ``` I have tried with `smtp` and with `smtp+starttls` and I have tried with port `25` and port `587`. All had the same behavior.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11658