@@ -45,7 +45,7 @@ func jsonEscape(i string) string {
45
45
log .Println (err )
46
46
}
47
47
s := string (b )
48
- return s [1 : len (s )- 1 ]
48
+ return s [1 : len (s )- 1 ]
49
49
}
50
50
51
51
func getAddIssueResponse (resp * http.Response ) AddIssueResponse {
@@ -158,6 +158,12 @@ func makeGetRequest(endpoint string) *http.Response {
158
158
return resp
159
159
}
160
160
161
+ func replaceQuotationMarks (value string ) string {
162
+ value = strings .Replace (value , "\" " , "'" , - 1 )
163
+
164
+ return value
165
+ }
166
+
161
167
func setMailAsSeenForService (c * client.Client , currentMail uint32 ) {
162
168
seqSet := new (imap.SeqSet )
163
169
seqSet .AddRange (currentMail , currentMail )
@@ -232,7 +238,7 @@ func run() {
232
238
currentUid := uids [currentMessage ]
233
239
234
240
r := message .GetBody (& section )
235
- subject := message .Envelope .Subject
241
+ subject := replaceQuotationMarks ( message .Envelope .Subject )
236
242
237
243
isMessageWithIssueNumber , _ := regexp .MatchString ("^.*\\ [.*-\\ d+]$" , subject )
238
244
@@ -264,7 +270,7 @@ func run() {
264
270
265
271
switch h := p .Header .(type ) {
266
272
case * mail.InlineHeader :
267
- sanitizedBody := getMailBody (p )
273
+ sanitizedBody := replaceQuotationMarks ( getMailBody (p ) )
268
274
contentType , _ , _ := h .ContentType ()
269
275
270
276
if contentType != "text/plain" {
0 commit comments