Gitlab-CE omnibus installation -- wrong "FROM:" and "REPLY-TO:" email address used in email notification
Summary
The values used for "FROM:" and "REPLY-TO:" do not use the email address from the user that commented in email notifications. Users reply to those emails, do not check the address, and sent email to the wrong person.
Steps to reproduce
- perform Gitlab-CE omnibus installation
- connect GitLab-CE to Microsoft Active-Directory user directory via LDAP
- create a file
- comment on commit either with a different user OR enable notifications for your own actions prior to commenting
- user received the email and replied; which sent the email to the wrong person
Example Project
Project in GitLab-CE omnibus-installation is not available without authentication. More information about problem is available at: https://forum.gitlab.com/t/from-email-address-sometimes-wrong/8138
I am not sure whether this GitLab.com example project helps: realsobek/testprojectname@3d2e5903
What is the current bug behavior?
On GitLab.com example project header is (with notification for own action active):
Subject: Re: testprojectname | Add new file (3d2e5903)
Date: Mon, 23 Jul 2018 16:42:21 +0000
From: René Genz <gitlab@mg.gitlab.com>
Reply-To: René Genz / testprojectname
<incoming+7806652bad8bd63d4bdb3252f4926b39@incoming.gitlab.com>
To: CORRECT@EMAIL.ADDRESS
On Gitlab-CE omnibus installation the header is (with notification for own action active):
From: MYNAME gitlab@EXTERNALDNSNAME
Reply-To: GitLab noreply@EXTERNALDNSNAME
To: CORRECT@EMAIL.ADDRESS
What is the expected correct behavior?
Values from LDAP should be used for REPLY-TO display name and email address. If possible also for FROM.
On Gitlab-CE omnibus installation the header should be (with notification for own action active):
From: CORRECTNAME <CORRECT@EMAIL.ADDRESS>
Reply-To: CORRECTNAME <CORRECT@EMAIL.ADDRESS>
To: CORRECT@EMAIL.ADDRESS
CORRECT@EMAIL.ADDRESS is the email address of the user as taken from LDAP. CORRECTNAME is the display name taken from LDAP.
Relevant logs and/or screenshots
Nothing to show. If you need files, let me know and I will provide.
Output of checks
(I am more concerned about the local GitLab instance, hence leaving gitlab.com comment out)
root@gitlab:/opt/gitlab # gitlab-rake gitlab:check
Checking GitLab Shell ...
GitLab Shell version >= 7.1.4 ? ... OK (7.1.4)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:root, or git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
<project> / <name> ... ok
<user> / <name> ... repository is empty
<cut other lines>
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK
Access to /mnt/gitlab-ce/home/.ssh/authorized_keys: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Reply by email is disabled in config/gitlab.yml
Checking LDAP ...
Server: ldapmain
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results)
<cut 99 other items>
DN: cn=FIRSTNAME LASTNAME,ou=OU,ou=people,dc=DNSNAME,dc=local sAMAccountName: LOGINNAME
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes
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
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
Projects have namespace: ...
<project> / <name> ... yes
<cut other items>
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.5 ? ... yes (2.4.4)
Git version >= 2.9.5 ? ... yes (2.17.1)
Git user has default SSH configuration? ... yes
Active users: ... 26
Checking GitLab ... Finished
Results of GitLab environment info
Expand for output related to GitLab environment info
root@gitlab:~ # gitlab-rake gitlab:env:infoSystem information System: Current User: git Using RVM: no Ruby Version: 2.4.4p296 Gem Version: 2.7.6 Bundler Version:1.16.2 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.17.1 Sidekiq Version:5.1.3 Go Version: unknown
GitLab information Version: 11.0.4 Revision: edb037c Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://gitlab.DNSNAME.de HTTP Clone URL: https://gitlab.DNSNAME.de/some-group/some-project.git SSH Clone URL: git@gitlab.DNSNAME.de:some-group/some-project.git Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 7.1.4 Repository storage paths:
- default: /mnt/gitlab-ce/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
root@gitlab:~ # gitlab-rake gitlab:check SANITIZE=true Checking GitLab Shell ...GitLab Shell version >= 7.1.4 ? ... OK (7.1.4) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 4/2 ... ok 4/3 ... ok 5/4 ... ok 6/5 ... ok 8/6 ... repository is empty 8/7 ... repository is empty 11/8 ... ok 12/9 ... ok 7/10 ... ok 18/11 ... repository is empty 16/14 ... ok 16/15 ... ok 12/16 ... ok 11/17 ... ok 16/18 ... ok 19/19 ... ok 19/20 ... ok 4/21 ... ok 6/22 ... ok 23/24 ... ok 23/25 ... ok 23/26 ... ok 23/27 ... ok 23/28 ... ok 23/29 ... ok 23/30 ... ok 16/31 ... ok 12/38 ... ok 29/39 ... ok 27/40 ... ok 29/43 ... repository is empty 7/44 ... ok 7/45 ... ok 7/46 ... ok 7/47 ... ok 29/48 ... ok 6/49 ... ok 7/51 ... ok 7/52 ... repository is empty 21/53 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /mnt/gitlab-ce/home/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Reply by email is disabled in config/gitlab.yml Checking LDAP ...
Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) <cut 99 other items) DN: cn=FIRSTNAME LASTNAME,ou=OUT,ou=OU,dc=DNSNAME,dc=local sAMAccountName: LOGINNAME
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes 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 Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 4/2 ... yes 4/3 ... yes 5/4 ... yes 6/5 ... yes 8/6 ... yes 8/7 ... yes 11/8 ... yes 12/9 ... yes 7/10 ... yes 18/11 ... yes 16/14 ... yes 16/15 ... yes 12/16 ... yes 11/17 ... yes 16/18 ... yes 19/19 ... yes 19/20 ... yes 4/21 ... yes 6/22 ... yes 23/24 ... yes 23/25 ... yes 23/26 ... yes 23/27 ... yes 23/28 ... yes 23/29 ... yes 23/30 ... yes 16/31 ... yes 12/38 ... yes 29/39 ... yes 27/40 ... yes 29/43 ... yes 7/44 ... yes 7/45 ... yes 7/46 ... yes 7/47 ... yes 29/48 ... yes 6/49 ... yes 7/51 ... yes 7/52 ... yes 21/53 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.4.4) Git version >= 2.9.5 ? ... yes (2.17.1) Git user has default SSH configuration? ... yes Active users: ... 26
Checking GitLab ... Finished
More information
I do not know whether this is correct behaviour or a bug. Would it be better to use feature proposal template for this?