Sending test mail fails #9381

Closed
opened 2025-11-02 08:36:59 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @monochromec on GitHub (Aug 10, 2022).

Description

Mail server set-up using sendmail per instructions found in https://docs.gitea.io/en-us/email-setup
The relevant section from app.ini:

[mailer]
ENABLED          = true
FROM             = gitea@valid.domain
PROTOCOL         = sendmail
#MAILERTYPE       = sendmail                                                                                                                                                                                
# HOST             = localhost:25                                                                                                                                                                           
# SKIP_VERFIY      = true                                                                                                                                                                                   
# USER             =                                                                                                                                                                                        
# PASSWD           =                                                                                                                                                                                        
SENDMAIL_PATH    = /sbin/sendmail
SENDMAIL_TIMEOUT = 1m
SENDMAIL_ARGS    = --

When trying send a test mail via the configuration page, I get the following error:

Failed to send a testing email to 'target@adress.com': gomail: could not send email 1: missing port in address

To me that looks like the PROTOCOL = sendmail entry is ignored as removing the comments from the HOST entry solves this (but in turn creates other issues wrt localhost, certificates, TLS encryption, etc).

gitea version is 1.17 running on CENTOS 7.9. More than happy to provide additional information as required.

Gitea Version

1.17

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.37.1

Operating System

CENTOS 7.9

How are you running Gitea?

Downloaded binary from download page

Database

SQLite

Originally created by @monochromec on GitHub (Aug 10, 2022). ### Description Mail server set-up using sendmail per instructions found in https://docs.gitea.io/en-us/email-setup The relevant section from app.ini: ``` [mailer] ENABLED = true FROM = gitea@valid.domain PROTOCOL = sendmail #MAILERTYPE = sendmail # HOST = localhost:25 # SKIP_VERFIY = true # USER = # PASSWD = SENDMAIL_PATH = /sbin/sendmail SENDMAIL_TIMEOUT = 1m SENDMAIL_ARGS = -- ``` When trying send a test mail via the configuration page, I get the following error: ``` Failed to send a testing email to 'target@adress.com': gomail: could not send email 1: missing port in address ``` To me that looks like the ```PROTOCOL = sendmail``` entry is ignored as removing the comments from the HOST entry solves this (but in turn creates other issues wrt localhost, certificates, TLS encryption, etc). gitea version is 1.17 running on CENTOS 7.9. More than happy to provide additional information as required. ### Gitea Version 1.17 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.37.1 ### Operating System CENTOS 7.9 ### How are you running Gitea? Downloaded binary from download page ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 08:36:59 -06:00
Author
Owner
@wxiaoguang commented on GitHub (Aug 10, 2022): For 1.17 , you need the old document: https://github.com/go-gitea/gitea/blob/release/v1.17/custom/conf/app.example.ini https://github.com/go-gitea/gitea/blob/release/v1.17/docs/content/doc/advanced/config-cheat-sheet.en-us.md
Author
Owner

@monochromec commented on GitHub (Aug 10, 2022):

Thank you for the quick reaction, swapping comments on MAILER_TYPE and PROTOCOL solved the issue.

@monochromec commented on GitHub (Aug 10, 2022): Thank you for the quick reaction, swapping comments on MAILER_TYPE and PROTOCOL solved the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9381