mattermost-plugin-email-reply icon indicating copy to clipboard operation
mattermost-plugin-email-reply copied to clipboard

Post ID parse error in MIME mail

Open jprusch opened this issue 4 years ago • 1 comments

Hi, the plugin now connects to the IMAPS server & pulls the emails send to the reply-to address:

"IMAPD"	2176	1211247	"2020-05-07 13:11:31.153"	"192.168.2.88"	"SENT: * OK IMAPrev1"
"IMAPD"	2180	1211247	"2020-05-07 13:11:31.200"	"192.168.2.88"	"RECEIVED: WYGcsA CAPABILITY"
"IMAPD"	2180	1211247	"2020-05-07 13:11:31.200"	"192.168.2.88"	"SENT: * CAPABILITY IMAP4 IMAP4rev1 CHILDREN IDLE QUOTA SORT ACL NAMESPACE RIGHTS=texk[nl]WYGcsA OK CAPABILITY completed"
"IMAPD"	2184	1211247	"2020-05-07 13:11:31.200"	"192.168.2.88"	"RECEIVED: cJXhNQ LOGIN "mmreply@OURDOMAIN" ***"
"IMAPD"	2184	1211247	"2020-05-07 13:11:31.200"	"192.168.2.88"	"SENT: cJXhNQ OK LOGIN completed"
"IMAPD"	2216	1211247	"2020-05-07 13:11:31.200"	"192.168.2.88"	"RECEIVED: hYx1Kg SELECT INBOX"
"IMAPD"	2216	1211247	"2020-05-07 13:11:31.200"	"192.168.2.88"	"SENT: * 1 EXISTS[nl]* 0 RECENT[nl]* FLAGS (\Deleted \Seen \Draft \Answered \Flagged)[nl]* OK [UIDVALIDITY 1588169699] current uidvalidity[nl]* OK [UIDNEXT 3] next uid[nl]* OK [PERMANENTFLAGS (\Deleted \Seen \Draft \Answered \Flagged)] limited[nl]hYx1Kg OK [READ-WRITE] SELECT completed"
"IMAPD"	2184	1211247	"2020-05-07 13:11:31.215"	"192.168.2.88"	"RECEIVED: nC7ReQ FETCH 1 (BODY[] ENVELOPE)"
"IMAPD"	2184	1211247	"2020-05-07 13:11:31.215"	"192.168.2.88"	"SENT: * 1 FETCH (ENVELOPE ("Thu, 7 May 2020 11:03:32 +0000" "=?iso-8859-1?Q?Re=3A_=5BSch=E4ferbarthold_MM=5D_Neue_Direkt?= =?iso-8859-1?Q?nachricht_von_=40admin_am_7=2EMai=2E2020?=" (("=?iso-8859-1?Q?Rusch_Jan-Peter_=7C_Sch=E4ferbarthold_GmbH?=" NIL "j.rusch" "schaeferbarthold.de")) (("=?iso-8859-1?Q?Rusch_Jan-Peter_=7C_Sch=E4ferbarthold_GmbH?=" NIL "j.rusch" "schaeferbarthold.de")) (("=?iso-8859-1?Q?Rusch_Jan-Peter_=7C_Sch=E4ferbarthold_GmbH?=" NIL "j.rusch" "schaeferbarthold.de")) (("[email protected]" NIL "mmreply" "jira.schaeferbarthold.de")) NIL NIL NIL "<DIIE.0000BE320122E144@OURMAILEXCHANGER>") BODY[] {10324}"
"IMAPD"	2184	1211247	"2020-05-07 13:11:31.215"	"192.168.2.88"	"SENT: )"
"IMAPD"	2184	1211247	"2020-05-07 13:11:31.215"	"192.168.2.88"	"SENT: nC7ReQ OK FETCH completed"
"IMAPD"	2184	1211247	"2020-05-07 13:11:31.215"	"192.168.2.88"	"RECEIVED: XpXPyw STORE 1 +FLAGS.SILENT (\Deleted)"
"IMAPD"	2184	1211247	"2020-05-07 13:11:31.215"	"192.168.2.88"	"SENT: XpXPyw OK STORE completed"
"IMAPD"	2216	1211247	"2020-05-07 13:11:31.262"	"192.168.2.88"	"RECEIVED: AXKwJg LOGOUT"

The mail body is then parsed, but this fails with:

2020-05-07T13:06:20.979+0200    error   mlog/sugar.go:23        post id parse error in email <[email protected]>: failed to find postID in email body: This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

I included the email base64 encoded body in the attached file: mailermost_parse_error.txt

The first part of the mime message is actually the answer of the received mail, which is encoded in the second part of the mime message.

Is this an error on my side or is the plugin not able to identify the post id in the second mime part?

Best JP

jprusch avatar May 07 '20 11:05 jprusch