Skip to content

Commit 09fefd3

Browse files
Merge remote-tracking branch 'origin/release/17.7' into release/17.8
2 parents e2d88aa + 57b003f commit 09fefd3

23 files changed

Lines changed: 730 additions & 6 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# frozen_string_literal: true
2+
3+
#-- copyright
4+
# OpenProject is an open source project management software.
5+
# Copyright (C) the OpenProject GmbH
6+
#
7+
# This program is free software; you can redistribute it and/or
8+
# modify it under the terms of the GNU General Public License version 3.
9+
#
10+
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
11+
# Copyright (C) 2006-2013 Jean-Philippe Lang
12+
# Copyright (C) 2010-2013 the ChiliProject Team
13+
#
14+
# This program is free software; you can redistribute it and/or
15+
# modify it under the terms of the GNU General Public License
16+
# as published by the Free Software Foundation; either version 2
17+
# of the License, or (at your option) any later version.
18+
#
19+
# This program is distributed in the hope that it will be useful,
20+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
# GNU General Public License for more details.
23+
#
24+
# You should have received a copy of the GNU General Public License
25+
# along with this program; if not, write to the Free Software
26+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27+
#
28+
# See COPYRIGHT and LICENSE files for more details.
29+
#++
30+
31+
module Interceptors
32+
# Removes recipients on a domain listed in the `blocked_email_domains` setting.
33+
# The validation on User only applies to addresses as they are entered, so this
34+
# covers users whose domain was blocked after their account already existed.
35+
#
36+
# Mails left without any recipient are dropped by DoNotSendMailsWithoutRecipient,
37+
# which is why this has to run before it.
38+
module RemoveBlockedRecipients
39+
FIELDS = %i[to cc bcc].freeze
40+
41+
module_function
42+
43+
def delivering_email(mail)
44+
domains = ::OpenProject::BlockedEmailDomains.domains
45+
46+
return if domains.empty?
47+
48+
FIELDS.each { |field| remove_blocked(mail, field, domains) }
49+
end
50+
51+
def remove_blocked(mail, field, domains)
52+
addresses = Array(mail.send(field))
53+
allowed = addresses.reject { |address| ::OpenProject::BlockedEmailDomains.blocked?(address, domains:) }
54+
55+
return if allowed.size == addresses.size
56+
57+
Rails.logger.info do
58+
"Removed blocked #{field} recipients from '#{mail.subject}': #{(addresses - allowed).join(', ')}"
59+
end
60+
61+
mail.send(:"#{field}=", allowed)
62+
end
63+
end
64+
end

app/models/user.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ def self.blocked_condition(blocked)
185185

186186
validates :mail, email: true, unless: Proc.new { |user| user.mail.blank? }
187187
validates :mail, length: { maximum: 256, allow_nil: true }
188+
# Only on change so that blocking a domain does not make its existing users unsaveable
189+
validates :mail, blocked_email_domain: true, if: Proc.new { |user| user.mail_changed? }
188190

189191
validates :password,
190192
confirmation: {
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# frozen_string_literal: true
2+
3+
#-- copyright
4+
# OpenProject is an open source project management software.
5+
# Copyright (C) the OpenProject GmbH
6+
#
7+
# This program is free software; you can redistribute it and/or
8+
# modify it under the terms of the GNU General Public License version 3.
9+
#
10+
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
11+
# Copyright (C) 2006-2013 Jean-Philippe Lang
12+
# Copyright (C) 2010-2013 the ChiliProject Team
13+
#
14+
# This program is free software; you can redistribute it and/or
15+
# modify it under the terms of the GNU General Public License
16+
# as published by the Free Software Foundation; either version 2
17+
# of the License, or (at your option) any later version.
18+
#
19+
# This program is distributed in the hope that it will be useful,
20+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
# GNU General Public License for more details.
23+
#
24+
# You should have received a copy of the GNU General Public License
25+
# along with this program; if not, write to the Free Software
26+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27+
#
28+
# See COPYRIGHT and LICENSE files for more details.
29+
#++
30+
31+
# Rejects email addresses whose domain is listed in the `blocked_email_domains` setting.
32+
class BlockedEmailDomainValidator < ActiveModel::EachValidator
33+
def validate_each(record, attribute, value)
34+
return if value.blank?
35+
return unless OpenProject::BlockedEmailDomains.blocked?(value)
36+
37+
record.errors.add attribute, :blocked_domain
38+
end
39+
end

config/constants/settings/definition.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ class Definition
219219
bcc_recipients: {
220220
default: true
221221
},
222+
blocked_email_domains: {
223+
format: :array,
224+
description: "Email domains that may not be used for user accounts. Subdomains are blocked as well. " \
225+
"Recipients on these domains are also skipped when sending emails.",
226+
default: []
227+
},
222228
boards_demo_data_available: {
223229
description: "Internal setting determining availability of demo seed data",
224230
default: false

config/initializers/register_mail_interceptors.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
# Do this here, so they aren't registered multiple times due to reloading in development mode.
3333
Rails.application.reloader.to_prepare do
3434
ApplicationMailer.register_interceptor Interceptors::DefaultHeaders
35+
ApplicationMailer.register_interceptor Interceptors::RemoveBlockedRecipients
3536
# following needs to be the last interceptor
3637
ApplicationMailer.register_interceptor Interceptors::DoNotSendMailsWithoutRecipient
3738
end

config/locales/en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ en:
499499
before_or_equal_to: "must be before or equal to %{date}."
500500
blank: "can't be blank."
501501
blank_nested: "needs to have the property '%{property}' set."
502+
blocked_domain: "is not allowed. Please use an email address from a different domain."
502503
cannot_delete_mapping: "is required. Cannot be deleted."
503504
cant_link_a_work_package_with_a_descendant: "A work package cannot be linked to one of its subtasks."
504505
circular_dependency: "This relation would create a circular dependency."

docker/prod/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ ENV OPENPROJECT_RAILS__CACHE__STORE=memcache
146146
ENV DATABASE_URL=postgres://openproject:openproject@127.0.0.1/openproject
147147
ENV PGDATA=/var/openproject/pgdata
148148

149-
COPY --from=openproject/hocuspocus:17.7.1 --chown=$APP_USER:$APP_USER /app /opt/hocuspocus
149+
COPY --from=openproject/hocuspocus:17.7.2 --chown=$APP_USER:$APP_USER /app /opt/hocuspocus
150150
# Keep node/npm in all-in-one for bundled hocuspocus even when BIM support is disabled.
151151
COPY --from=build-base /usr/local/bin/node /usr/local/bin/node
152152
COPY --from=build-base /usr/local/lib/node_modules /usr/local/lib/node_modules

docs/installation-and-operations/configuration/environment/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ OPENPROJECT_BACKUP__INCLUDE__ATTACHMENTS (default=true) Allow inclusion of attac
162162
OPENPROJECT_BACKUP__INITIAL__WAITING__PERIOD (default=86400) Wait time before newly created backup tokens are usable
163163
OPENPROJECT_BCC__RECIPIENTS (default=true) Blind carbon copy recipients (bcc)
164164
OPENPROJECT_BLACKLISTED__ROUTES (default=[]) Blocked routes to prevent access to certain modules or pages
165+
OPENPROJECT_BLOCKED__EMAIL__DOMAINS (default=[]) Email domains that may not be used for user accounts. Subdomains are blocked as well. Recipients on these domains are also skipped when sending emails.
165166
OPENPROJECT_BOARDS__DEMO__DATA__AVAILABLE (default=false) Internal setting determining availability of demo seed data
166167
OPENPROJECT_BRUTE__FORCE__BLOCK__AFTER__FAILED__LOGINS (default=20) Number of login attempts per user before assuming brute force attack
167168
OPENPROJECT_BRUTE__FORCE__BLOCK__MINUTES (default=30) Number of minutes to block users after presumed brute force attack
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: OpenProject 17.7.2
3+
sidebar_navigation:
4+
title: 17.7.2
5+
release_version: 17.7.2
6+
release_date: 2026-08-13
7+
---
8+
9+
# OpenProject 17.7.2
10+
11+
Release date: 2026-08-13
12+
13+
We released [OpenProject 17.7.2](https://community.openproject.org/versions/2321).
14+
The release contains several bug fixes and we recommend updating to the newest version.
15+
Below you will find a complete list of all changes and bug fixes.
16+
<!-- BEGIN SECURITY FIXES AUTOMATED SECTION -->
17+
<!-- END SECURITY FIXES AUTOMATED SECTION -->
18+
<!--more-->
19+
20+
## Bug fixes and changes
21+
22+
<!-- Warning: Anything within the below lines will be automatically removed by the release script -->
23+
<!-- BEGIN AUTOMATED SECTION -->
24+
25+
- Bugfix: The hourly rate cannot be adjusted for individual projects \[[#78111](https://community.openproject.org/wp/78111)\]
26+
- Bugfix: Non-working days saved while reschedule job is running are not applied to work packages \[[#78219](https://community.openproject.org/wp/78219)\]
27+
- Bugfix: Bubble with + in timeline view does not make sense \[[#78284](https://community.openproject.org/wp/78284)\]
28+
- Bugfix: When using multiple seeded custom styles, most are lost \[[#78397](https://community.openproject.org/wp/78397)\]
29+
30+
<!-- END AUTOMATED SECTION -->
31+
<!-- Warning: Anything above this line will be automatically removed by the release script -->

docs/release-notes/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ Stay up to date and get an overview of the new features included in the releases
1313
<!--- New release notes are generated below. Do not remove comment. -->
1414
<!--- RELEASE MARKER -->
1515

16+
## 17.7.2
17+
18+
Release date: 2026-08-13
19+
20+
[Release Notes](17-7-2/)
21+
22+
1623
## 17.7.1
1724

1825
Release date: 2026-08-06

0 commit comments

Comments
 (0)