Skip to content

Service desk unsubscribe link does not actually unsubscribe the e-mail address.

Summary

When sending e-mail to the service desk, it replies with a thank you e-mail that contains an unsubscribe link. Clicking the link will show the user a prompt stating that they are unsubscribed, but will not actually unsubscribe them.

Steps to reproduce

  • Create an issue by e-mailing the service desk.
  • Click on the unsubscribe link in the thank you e-mail
  • Reply to the issue from another account
  • Observe that you still receive an e-mail notification

Alternatively

  • Create an issue by e-mailing the service desk.
  • Log into the database and find the internal issue id from the issues column
  • Click on the unsubscribe link in the thank you e-mail
  • select * from issue_email_participants where issue_id='ID'
  • Observe that there is still a row for the issue + participant combination

Example Project

I've replicated the problem on GitLab.com:

The user that send this issue has clicked the unsubscribe link:

https://gitlab.com/test-group456/testproject/-/issues/2

image

But the user is still subscribed and still receives updates.

What is the current bug behavior?

User still receives e-mail after unsubscribing from an issue.

What is the expected correct behavior?

User should no longer receive e-mail after unsubscribing from an issue.

Relevant logs and/or screenshots

No relevant errors found in logs

production.log Started GET "/-/sent_notifications/REDACTED/unsubscribe?force=true" for X.X.X.X at 2022-11-18 13:51:53 +0100 Processing by SentNotificationsController#unsubscribe as HTML Parameters: {"force"=>"true", "id"=>"48e99f5567525000ec00411a114ee005"} Redirected to https://redacted.gitlab.host/users/sign_in Completed 302 Found in 48ms (ActiveRecord: 7.0ms | Elasticsearch: 0.0ms | Allocations: 8421)

Output of checks

This bug happens on GitLab.com /label reproduced on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info
root@redacted:/var/log/gitlab/gitlab-rails# gitlab-rake gitlab:env:info

System information System: Debian 10 Proxy: no Current User: git Using RVM: no Ruby Version: 2.7.5p203 Gem Version: 3.1.6 Bundler Version:2.3.15 Rake Version: 13.0.6 Redis Version: 6.2.7 Sidekiq Version:6.4.2 Go Version: unknown

GitLab information Version: 15.5.4-ee Revision: d3dda7548e0 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 12.10 URL: https://redacted.gitlab.host HTTP Clone URL: https://redacted.gitlab.host/some-group/some-project.git SSH Clone URL: git@redacted.gitlab.host:some-group/some-project.git Elasticsearch: yes Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: gitlab, saml

GitLab Shell Version: 14.12.0 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell

Results of GitLab application Check

Expand for output related to the GitLab application check

root@redacted:~# gitlab-rake gitlab:check SANITIZE=true Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 14.12.0 ? ... OK (14.12.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Checking Reply by email ...

IMAP server credentials are correct? ... Checking incoming@redacted.gitlab.host yes Mailroom enabled? ... skipped MailRoom running? ... skipped

Checking Reply by email ... Finished

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 2/1 ... yes 5/2 ... yes 7/3 ... yes 10/4 ... yes 15/5 ... yes 19/6 ... yes 36/7 ... yes 36/8 ... yes 36/9 ... yes 36/10 ... yes 19/11 ... yes 52/18 ... yes 36/19 ... yes 36/20 ... yes 58/21 ... yes 36/22 ... yes 15/23 ... yes 19/24 ... yes 3/25 ... yes 3/26 ... yes 3/27 ... yes 19/28 ... yes 58/29 ... yes 14/30 ... yes 71/31 ... yes Redis version >= 6.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.5) Git user has default SSH configuration? ... yes Active users: ... 6 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Elasticsearch version 7.x-8.x or OpenSearch version 1.x ... yes (elasticsearch 7.17.7)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes