Reply by email not working when replying using iPhone's email application
Summary
Reply by email not working when email sent using iphone's stock mail client
Steps to reproduce
Reply to an issue notification email using an iphone's email client. The reply doesn't appear as issue comment. An error message is emailed back to the user.
What is the current bug behavior?
The new comment never appears under the issue, and Gitlab emails the user back explaining there was an error: The comment could not be created for the following reasons: ...
What is the expected correct behavior?
Gitlab finds the text inside the email and adds it to the issue as comment
Relevant logs and/or screenshots
Here's what gets logged in /var/log/gitlab/gitlab-rails/production.log
. I removed sensitive information...
Email can not be processed: The comment could not be created for the following reasons:
- Note can't be blank
- Project can't be blank
- Noteable type can't be blank
- Noteable can't be blank
- Author can't be blank
Return-Path: <user@somegitlabinstall.net>
X-Original-To: gitlab+78c267d40e922980d61eb9cd69105cc4@somegitlabinstall.net
Delivered-To: ...
Received: ...
References: <issue_1405@somegitlabinstall.net> <reply-78c267d40e922980d61eb9cd69105cc4@somegitlabinstall.net> <7daddf1caa091788670c588bc491e684@somegitlabinstall.net>
In-Reply-To: <7daddf1caa091788670c588bc491e684@somegitlabinstall.net>
Mime-Version: 1.0 (1.0)
Content-Transfer-Encoding: 7bit
Content-Type: multipart/alternative;
boundary=Apple-Mail-9420E429-5ECD-4631-814B-68C42A337597
Message-Id: <BFD7ABE0-7515-4786-AEFE-7768F4C485CB@somegitlabinstall.net>
X-Mailer: iPhone Mail (14G60)
From: =?utf-8?Q?xxx?= <user@somegitlabinstall.net>
Subject: ...
Date: Thu, 21 Sep 2017
To: xxx <gitlab+78c267d40e922980d61eb9cd69105cc4@somegitlabinstall.net>
--Apple-Mail-9420E429-5ECD-4631-814B-68C42A337597
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
Some comment to include in the issue
> On Sep 21, 2017, xxx <gitlab@somegitlabinstall.net> wrote:
>=20
> xxx commented:
>=20
> xxx
> Reply to this email directly or view it on GitLab.=20
> You're receiving this email because of your account on somegitlabinstall.=
net. If you'd like to receive fewer emails, you can unsubscribe from this th=
read or adjust your notification settings.
--Apple-Mail-9420E429-5ECD-4631-814B-68C42A337597
Content-Type: text/html;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div>Some comment to include in the issue</=
div>xxx<div>
<meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type">
<title>
GitLab
</title>
<style>img {
max-width: 100%; height: auto;
}
</style>
xxx
</div></blockquote></body></html>=
--Apple-Mail-9420E429-5ECD-4631-814B-68C42A337597--
Results of GitLab environment info
the reply by email works perfectly fine using other mailers
Possible cause
I think this problem happens because the iphone email client, as can be seen in the logs above, includes the text/plain
in a message part rather than as plain email body. There's also another part for the text/html
.
Other mailers I use don't do that, they include the text/plain
version in the body and create a separate message part for the text/html
.