Enabling Mailer leads to failed to start the docker container #10909

Closed
opened 2025-11-02 09:21:54 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @alex-ibb on GitHub (May 24, 2023).

Description

Docker image tag: 1.19.3
Platform: x64

The Gitea service is based on a Docker container, and the ports mapping of the container is 127.0.0.1:30022->22/tcp, 127.0.0.1:30080->3000/tcp.

So, after the initialization page, the following block is added to the app,ini:

[mailer]
ENABLED   = false
SMTP_ADDR = smtp.lovegitea.com
SMTP_PORT = 465
FROM      = Gitea.35
USER      = dev@lovegitea.com
PASSWD    = lovegitea

then the container is keep restarting, and its URL is not accessiable.

However, set the ENABLED to true will correct the issue and the service will be online.

Please feel free to let me know when there are info needed/can be helpful.

The full version of the app.ini:

APP_NAME = Gitea@LoGitea
RUN_MODE = prod
RUN_USER = gitea

[repository]
ROOT            = /data/git/repositories
DEFAULT_PRIVATE = private

[repository.local]
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo

[repository.upload]
TEMP_PATH = /data/gitea/uploads

[server]
APP_DATA_PATH    = /data/gitea
DOMAIN           = localhost
SSH_DOMAIN       = gitea.lovegitea.com
HTTP_PORT        = 3000
ROOT_URL         = https://gitea.lovegitea.com:30443/
DISABLE_SSH      = false
SSH_PORT         = 30022
SSH_LISTEN_PORT  = 22
LFS_START_SERVER = true
HTTP_ADDR        =
OFFLINE_MODE     = false
LANDING_PAGE     = login
LFS_JWT_SECRET   = ZvjDlK6wz_QQTLfooFyMxZWBrAoD6fG-yFcU08WPjsw

[database]
PATH     = /data/gitea/gitea.db
DB_TYPE  = sqlite3
HOST     = localhost:3306
NAME     = gitea
USER     = root
PASSWD   =
LOG_SQL  = false
DB_PATH  = "/data/gitea/gitea.db"
SCHEMA   =
SSL_MODE = disable
CHARSET  = utf8

[indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve

[session]
PROVIDER_CONFIG = /data/gitea/sessions
PROVIDER        = file

[picture]
AVATAR_UPLOAD_PATH            = /data/gitea/avatars
REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
ENABLE_FEDERATED_AVATAR       = false
DISABLE_GRAVATAR              = true

[attachment]
PATH = /data/gitea/attachments

[log]
MODE            = file
LEVEL           = Info
ROUTER          = file
ROOT_PATH       = /data/gitea/log/
ENABLE_XORM_LOG = true
MAX_SIZE_SHIFT  = 28
FILE_NAME       = gitea.log
XORM            = file

[security]
INSTALL_LOCK                  = true
SECRET_KEY                    =
REVERSE_PROXY_LIMIT           = 1
REVERSE_PROXY_TRUSTED_PROXIES = *
PASSWORD_HASH_ALGO            = pbkdf2
LOGIN_REMEMBER_DAYS           = 1
INTERNAL_TOKEN                = eyJhbGJIUzsInR5cCI6IciI1NiIOikpXVCJ9.eyJuYiOjE2ODQ5MjgmY0MjB9.z1i6p32GBsNxc4u3QtVE8cE7Iu2ETeMHu1F2TE4rWu4

[service]
DISABLE_REGISTRATION              = true
REQUIRE_SIGNIN_VIEW               = true
ENABLE_CAPTCHA                    = false
REGISTER_EMAIL_CONFIRM            = true
NO_REPLY_ADDRESS                  = noreply.gitea.35
DEFAULT_ORG_VISIBILITY            = private
DEFAULT_KEEP_EMAIL_PRIVATE        = true
DEFAULT_USER_IS_RESTRICTED        = true
DEFAULT_ENABLE_TIMETRACKING       = true
ALLOW_ONLY_EXTERNAL_REGISTRATION  = false
OFFLINE_MODE                      = true
ENABLE_NOTIFY_MAIL                = true
DEFAULT_ALLOW_CREATE_ORGANIZATION = true

[lfs]
PATH = /data/git/lfs

[git.timeout]
CLONE   = 3600
PULL    = 3600
MIGRATE = 3600
DEFAUlT = 3600
MIRROR  = 3600
GC      = 3600

[log.file.router]
FILE_NAME = router.log

[log.file]
COMPRESSION_LEVEL = 1
MAX_DAYS          = 180

[log.file.xorm]
FILE_NAME = xorm.log

[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false

[other]
ENABLE_SITEMAP                 = false
ENABLE_FEED                    = false
SHOW_FOOTER_BRANDING           = false
SHOW_FOOTER_TEMPLATE_LOAD_TIME = true
SHOW_FOOTER_VERSION            = false

[admin]
DISABLE_REGULAR_ORG_CREATION = false
DEFAULT_EMAIL_NOTIFICATIONS  = enabled

[mailer]
ENABLED   = true
SMTP_ADDR = smtp.lovegitea.com
SMTP_PORT = 465
FROM      = Gitea.35
USER      = dev@lovegitea.com
PASSWD    = lovegitea

[cron.update_checker]
ENABLED = false

[repository.pull-request]
DEFAULT_MERGE_STYLE = merge

[repository.signing]
DEFAULT_TRUST_MODEL = committer

Gitea Version

1.19.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?

Via Docker container.

Database

None

Originally created by @alex-ibb on GitHub (May 24, 2023). ### Description Docker image tag: 1.19.3 Platform: x64 The Gitea service is based on a Docker container, and the ports mapping of the container is ` 127.0.0.1:30022->22/tcp, 127.0.0.1:30080->3000/tcp`. So, after the initialization page, the following block is added to the `app,ini`: ```ini [mailer] ENABLED = false SMTP_ADDR = smtp.lovegitea.com SMTP_PORT = 465 FROM = Gitea.35 USER = dev@lovegitea.com PASSWD = lovegitea ``` then the container is keep restarting, and its URL is not accessiable. However, set the `ENABLED` to true will correct the issue and the service will be online. Please feel free to let me know when there are info needed/can be helpful. The full version of the `app.ini`: ``` APP_NAME = Gitea@LoGitea RUN_MODE = prod RUN_USER = gitea [repository] ROOT = /data/git/repositories DEFAULT_PRIVATE = private [repository.local] LOCAL_COPY_PATH = /data/gitea/tmp/local-repo [repository.upload] TEMP_PATH = /data/gitea/uploads [server] APP_DATA_PATH = /data/gitea DOMAIN = localhost SSH_DOMAIN = gitea.lovegitea.com HTTP_PORT = 3000 ROOT_URL = https://gitea.lovegitea.com:30443/ DISABLE_SSH = false SSH_PORT = 30022 SSH_LISTEN_PORT = 22 LFS_START_SERVER = true HTTP_ADDR = OFFLINE_MODE = false LANDING_PAGE = login LFS_JWT_SECRET = ZvjDlK6wz_QQTLfooFyMxZWBrAoD6fG-yFcU08WPjsw [database] PATH = /data/gitea/gitea.db DB_TYPE = sqlite3 HOST = localhost:3306 NAME = gitea USER = root PASSWD = LOG_SQL = false DB_PATH = "/data/gitea/gitea.db" SCHEMA = SSL_MODE = disable CHARSET = utf8 [indexer] ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve [session] PROVIDER_CONFIG = /data/gitea/sessions PROVIDER = file [picture] AVATAR_UPLOAD_PATH = /data/gitea/avatars REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars ENABLE_FEDERATED_AVATAR = false DISABLE_GRAVATAR = true [attachment] PATH = /data/gitea/attachments [log] MODE = file LEVEL = Info ROUTER = file ROOT_PATH = /data/gitea/log/ ENABLE_XORM_LOG = true MAX_SIZE_SHIFT = 28 FILE_NAME = gitea.log XORM = file [security] INSTALL_LOCK = true SECRET_KEY = REVERSE_PROXY_LIMIT = 1 REVERSE_PROXY_TRUSTED_PROXIES = * PASSWORD_HASH_ALGO = pbkdf2 LOGIN_REMEMBER_DAYS = 1 INTERNAL_TOKEN = eyJhbGJIUzsInR5cCI6IciI1NiIOikpXVCJ9.eyJuYiOjE2ODQ5MjgmY0MjB9.z1i6p32GBsNxc4u3QtVE8cE7Iu2ETeMHu1F2TE4rWu4 [service] DISABLE_REGISTRATION = true REQUIRE_SIGNIN_VIEW = true ENABLE_CAPTCHA = false REGISTER_EMAIL_CONFIRM = true NO_REPLY_ADDRESS = noreply.gitea.35 DEFAULT_ORG_VISIBILITY = private DEFAULT_KEEP_EMAIL_PRIVATE = true DEFAULT_USER_IS_RESTRICTED = true DEFAULT_ENABLE_TIMETRACKING = true ALLOW_ONLY_EXTERNAL_REGISTRATION = false OFFLINE_MODE = true ENABLE_NOTIFY_MAIL = true DEFAULT_ALLOW_CREATE_ORGANIZATION = true [lfs] PATH = /data/git/lfs [git.timeout] CLONE = 3600 PULL = 3600 MIGRATE = 3600 DEFAUlT = 3600 MIRROR = 3600 GC = 3600 [log.file.router] FILE_NAME = router.log [log.file] COMPRESSION_LEVEL = 1 MAX_DAYS = 180 [log.file.xorm] FILE_NAME = xorm.log [openid] ENABLE_OPENID_SIGNIN = false ENABLE_OPENID_SIGNUP = false [other] ENABLE_SITEMAP = false ENABLE_FEED = false SHOW_FOOTER_BRANDING = false SHOW_FOOTER_TEMPLATE_LOAD_TIME = true SHOW_FOOTER_VERSION = false [admin] DISABLE_REGULAR_ORG_CREATION = false DEFAULT_EMAIL_NOTIFICATIONS = enabled [mailer] ENABLED = true SMTP_ADDR = smtp.lovegitea.com SMTP_PORT = 465 FROM = Gitea.35 USER = dev@lovegitea.com PASSWD = lovegitea [cron.update_checker] ENABLED = false [repository.pull-request] DEFAULT_MERGE_STYLE = merge [repository.signing] DEFAULT_TRUST_MODEL = committer ``` ### Gitea Version 1.19.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? Via Docker container. ### Database None
GiteaMirror added the issue/needs-feedback label 2025-11-02 09:21:54 -06:00
Author
Owner

@wxiaoguang commented on GitHub (May 24, 2023):

What does the log say?

ps: you need to remove/reset all secrets from your issue report (eg: INTERNAL_TOKEN, etc), otherwise your instance is under risk.

@wxiaoguang commented on GitHub (May 24, 2023): What does the log say? ps: you need to remove/reset all secrets from your issue report (eg: INTERNAL_TOKEN, etc), otherwise your instance is under risk.
Author
Owner

@alex-ibb commented on GitHub (May 25, 2023):

@wxiaoguang
Thank you for the advice.
Yes, the log says the failure is cased by the format error of mailer - FROM = Gitea.35.
Updating the value to Gitea.35 <your@domain.com> will correct the problem.
Many thanks!

@alex-ibb commented on GitHub (May 25, 2023): @wxiaoguang Thank you for the advice. Yes, the log says the failure is cased by the format error of `mailer` - `FROM = Gitea.35`. Updating the value to `Gitea.35 <your@domain.com>` will correct the problem. Many thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10909