Unable to create attachment with Email attribute = HTML
Moderators: Developer, Contributor
Re: Unable to create attachment with Email attribute = HTML
So the attachments are added correctly but we have 1 out of 2 where the attachments and notes are split into 2 parts.
It probably happened because your webserver took longer to process the request and the timestamps were too far apart for the note and the attachments to be merged
I have a solution for this: https://github.com/mantisbt-plugins/Ema ... 1602907c3d
Please test
It probably happened because your webserver took longer to process the request and the timestamps were too far apart for the note and the attachments to be merged
I have a solution for this: https://github.com/mantisbt-plugins/Ema ... 1602907c3d
Please test
Re: Unable to create attachment with Email attribute = HTML
If your webserver takes exceptionally long to process a request it's even possible that the note gets added but the attachment does not. This is because attachments are generally bigger and therefore require more processing power
Re: Unable to create attachment with Email attribute = HTML
Thanks SL-Gundam
applying latest fixes on mail_api.php seems working after sending 2 emails. changelog also updated for future reference
core/mail_api.php
doc/CHANGELOG.txt
will continue with some regression and update accordingly. many thanks
applying latest fixes on mail_api.php seems working after sending 2 emails. changelog also updated for future reference
core/mail_api.php
doc/CHANGELOG.txt
will continue with some regression and update accordingly. many thanks
- Attachments
-
- test4-C.JPG (70.68 KiB) Viewed 13086 times
-
- test3-C.JPG (67.26 KiB) Viewed 13086 times
Re: Unable to create attachment with Email attribute = HTML
SL-Gundam,
Previous issue seemed OK. But now, new symptom observed. Looks the email cannot be parsed accordingly hence not able to create note with the latest reply. Refer attachments.
Previous issue seemed OK. But now, new symptom observed. Looks the email cannot be parsed accordingly hence not able to create note with the latest reply. Refer attachments.
- Attachments
-
- Test5-A.JPG (47.31 KiB) Viewed 13071 times
-
- test5-raw_msg_shared.txt
- (14.74 KiB) Downloaded 1001 times
Re: Unable to create attachment with Email attribute = HTML
I think i've found the reason
Your mail client for test 1 and test 2 handle the from-sent-to-subject part a little bit differently (see below)
What mail client are you using?
The ** around it makes MantisBT show that text in bold. EmailReplyParser does not like that because it does not expect it.
We have 2 options.
1. Find out the idiosyncrasy in your mail client and see what we can do to deal with it
2. Turn off markdown support in MantisBT. EmailReporting will then convert HTML to plaintext instead of Markdown and therefore this will not be an issue
Your mail client for test 1 and test 2 handle the from-sent-to-subject part a little bit differently (see below)
What mail client are you using?
The ** around it makes MantisBT show that text in bold. EmailReplyParser does not like that because it does not expect it.
We have 2 options.
1. Find out the idiosyncrasy in your mail client and see what we can do to deal with it
2. Turn off markdown support in MantisBT. EmailReporting will then convert HTML to plaintext instead of Markdown and therefore this will not be an issue
Code: Select all
Html on. Test 2. Reply email
**From:** Mohammad Zairi Othman
**Sent:** Saturday, 2 May, 2020 9:48 PM
**To:** ticket.mantis
**Subject:** RE: [## ITSM ## BAU Issues 2020 0002808]: Create ticket and note
Html on. Test 1. Reply email
\-----Original Message\-----
From: ticket.mantis@muamalat.com.my [mailto:ticket.mantis@muamalat.com.my]
Sent: Saturday, 2 May, 2020 9:47 PM
To: Mohammad Zairi Othman
Subject: [## ITSM ## BAU Issues 2020 0002808]: Create ticket and note
Re: Unable to create attachment with Email attribute = HTML
Outlook 2010.
Let me try to find out the idiosyncrasy by trying other email client.
Let me try to find out the idiosyncrasy by trying other email client.
Re: Unable to create attachment with Email attribute = HTML
Just to update, option 2 not an options because the result was messy. whole chunk of xmls were put in the note
Re: Unable to create attachment with Email attribute = HTML
If markdown is not a big requirement for you we can try to work on a better html -> plaintext conversion
Re: Unable to create attachment with Email attribute = HTML
i'm ok with that. while at the same time, im suspecting this has to do with Exchange server and checking on it
Re: Unable to create attachment with Email attribute = HTML
If you are running on-premise Exchange it might be best to look at this:
https://www.mantisbt.org/wiki/doku.php/ ... parse_html
There is a note here for Exchange users and 2 links to Microsoft help.
https://www.mantisbt.org/wiki/doku.php/ ... parse_html
There is a note here for Exchange users and 2 links to Microsoft help.
Re: Unable to create attachment with Email attribute = HTML
Thanks SL-Gundam. Will take a look
Any dirty code idea that I can apply to strip the ** sign at from-sent-to-subject?
Any dirty code idea that I can apply to strip the ** sign at from-sent-to-subject?
Re: Unable to create attachment with Email attribute = HTML
SL-Gundam,
Update:
These were my setup on the reply. However, not satisfactory. Refer attached
Html on
Markdown off
Imap html & alternative text
Debug on
Update:
These were my setup on the reply. However, not satisfactory. Refer attached
Html on
Markdown off
Imap html & alternative text
Debug on
- Attachments
-
- 06052020 Capture.JPG (62.37 KiB) Viewed 12893 times
-
- raw_msg_06052020.txt
- (29.41 KiB) Downloaded 1033 times
Re: Unable to create attachment with Email attribute = HTML
SL-Gundam
I think i understood the flow and reason for such behavior.
It was because, I'm replying to my own reply instead of replying to mantis's notification email. In mantis's notification, there's a string "-----Original Message-----" that I believed parser use to identify the start of a reply. Similar to mail_remove_replies_after, I guess
So wild idea for scenario "replying to mail/reply other than Mantis notification email", is there possibility for you to default/create default element in the array for " "-----Original Message-----"" on top for From element or something like that which I think by doing so, parser should be able to parser > create note accordingly.
This would benefit for environment that email is constantly use for communication while at the same time those email's communication would be capture accordingly in the respective mantis ticket by creating note accordingly.
just to my cent.
I think i understood the flow and reason for such behavior.
It was because, I'm replying to my own reply instead of replying to mantis's notification email. In mantis's notification, there's a string "-----Original Message-----" that I believed parser use to identify the start of a reply. Similar to mail_remove_replies_after, I guess
So wild idea for scenario "replying to mail/reply other than Mantis notification email", is there possibility for you to default/create default element in the array for " "-----Original Message-----"" on top for From element or something like that which I think by doing so, parser should be able to parser > create note accordingly.
This would benefit for environment that email is constantly use for communication while at the same time those email's communication would be capture accordingly in the respective mantis ticket by creating note accordingly.
just to my cent.
Re: Unable to create attachment with Email attribute = HTML
If you are running the latest 0.11.0-DEV EmailReplyParser should look for the "from" line and set that as the start of a reply.
It expects the from line to look like this: "From: NAME <EMAIL>"
Your from lines are only showing the name, no email address
"-----Original Message-----" are usually added only for plaintext emails. MantisBT notification are plaintext so any replies on those emails are usually in plaintext aswell
It expects the from line to look like this: "From: NAME <EMAIL>"
Your from lines are only showing the name, no email address
"-----Original Message-----" are usually added only for plaintext emails. MantisBT notification are plaintext so any replies on those emails are usually in plaintext aswell
Re: Unable to create attachment with Email attribute = HTML
SL- Gundam,
Thanks for your clarification. Finally, I'm able to get things working with last hiccup (so far)
Now, mantis able to parse the email correctly. however, it will re-add images pasted in previous email. flow like this,
1) send first html email with attachment and image pasted on it
2) send second html email with no attachment and image > mantis able able to parse 2nd email accordingly however when creating note, image from first email for added as well.
Thanks for your clarification. Finally, I'm able to get things working with last hiccup (so far)
Now, mantis able to parse the email correctly. however, it will re-add images pasted in previous email. flow like this,
1) send first html email with attachment and image pasted on it
2) send second html email with no attachment and image > mantis able able to parse 2nd email accordingly however when creating note, image from first email for added as well.
- Attachments
-
- Reply30-Outlook screenshot.JPG (43.86 KiB) Viewed 12807 times
-
- Reply30-Mantis screenshot.JPG (37.91 KiB) Viewed 12808 times