2020-07-23 08:09:23 -04:00
---
stage: Plan
2020-11-13 16:09:31 -05:00
group: Certify
2022-09-21 17:13:33 -04:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2020-07-23 08:09:23 -04:00
---
2021-06-22 11:06:55 -04:00
# Reply by email **(FREE SELF)**
2020-07-23 08:09:23 -04:00
2016-09-25 05:55:14 -04:00
GitLab can be set up to allow users to comment on issues and merge requests by
replying to notification emails.
## Requirement
2018-09-19 12:03:00 -04:00
Make sure [incoming email ](incoming_email.md ) is set up.
2016-09-25 05:55:14 -04:00
2020-12-03 10:09:46 -05:00
## How it works
2016-09-25 05:55:14 -04:00
2020-12-03 10:09:46 -05:00
Replying by email happens in three steps:
1. GitLab sends a notification email.
1. You reply to the notification email.
1. GitLab receives your reply to the notification email.
### GitLab sends a notification email
2016-09-25 05:55:14 -04:00
When GitLab sends a notification and Reply by email is enabled, the `Reply-To`
header is set to the address defined in your GitLab configuration, with the
`%{key}` placeholder (if present) replaced by a specific "reply key". In
addition, this "reply key" is also added to the `References` header.
2020-12-03 10:09:46 -05:00
### You reply to the notification email
2016-09-25 05:55:14 -04:00
2020-12-03 10:09:46 -05:00
When you reply to the notification email, your email client:
2016-09-25 05:55:14 -04:00
2021-06-22 11:06:55 -04:00
- Sends the email to the `Reply-To` address it got from the notification email
- Sets the `In-Reply-To` header to the value of the `Message-ID` header from the
2016-09-25 05:55:14 -04:00
notification email
2021-06-22 11:06:55 -04:00
- Sets the `References` header to the value of the `Message-ID` plus the value of
2016-09-25 05:55:14 -04:00
the notification email's `References` header.
2020-12-03 10:09:46 -05:00
### GitLab receives your reply to the notification email
2016-09-25 05:55:14 -04:00
2020-12-03 10:09:46 -05:00
When GitLab receives your reply, it looks for the "reply key" in the
2016-09-25 05:55:14 -04:00
following headers, in this order:
2021-06-22 11:06:55 -04:00
1. `To` header
1. `References` header
2021-10-01 08:13:32 -04:00
1. `Delivered-To` header
1. `Envelope-To` header
2022-03-02 10:16:07 -05:00
1. `X-Envelope-To` header
1. `Received` header
2016-09-25 05:55:14 -04:00
2020-12-03 10:09:46 -05:00
If it finds a reply key, it leaves your reply as a comment on
2016-09-25 05:55:14 -04:00
the entity the notification was about (issue, merge request, commit...).
For more details about the `Message-ID` , `In-Reply-To` , and `References headers` ,
2022-09-29 14:08:16 -04:00
see [RFC 5322 ](https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4 ).