mail2most icon indicating copy to clipboard operation
mail2most copied to clipboard

Content filter to prevent mail text from being stripped

Open nicolasguenther opened this issue 4 years ago • 12 comments

When using mail2most i encounter problems where mail content is stripped when it contains certain combinations of characters which are interpreted as markdown (colon, hyphen, pipe etc.).

I propose a new setting for a profile that enables me to specify certain characters which will be filtered out before posting the text in a mattermost channel.

An alternative would be to start/end escaping using the prefix/suffix settings. But it seems mattermost is lacking support for such an escape block. Using "```" blocks doesn't fix the problem for me.

nicolasguenther avatar May 27 '21 07:05 nicolasguenther

hello @nicolasguenther thank you for opening an issue here. I'll take a look into this.

Is this only a problem with markdown interpreted characters? Maybe a StripMarkdown analog to StripHTML would be easier instead of a filter list.

c-seeger avatar May 27 '21 08:05 c-seeger

Thanks @c-seeger. StripMarkdown looks convenient. I'm not sure it would solve my problem though. The problem occurs especially when the mail body contains colon characters which are used as control characters to enter emojis. I'll prepare and post an example later.

nicolasguenther avatar May 27 '21 09:05 nicolasguenther

Example mail body 1:

test.
test: 123456

Result: Non printable characters are shown in the mattermost channe M�-

Example mail body 2:

test 
test: 123456

Result: Second line is stripped and not displayed in mattermost channel. Note: There is a space character at the end of the first line.

nicolasguenther avatar May 27 '21 10:05 nicolasguenther

@nicolasguenther i actually can't reproduce the issue both mail bodys work correctly on the latest build.

c-seeger avatar Jun 01 '21 12:06 c-seeger

Hi,

I also see some text stripped from email, for example this email (in Plain Text Mode in Gmail):

The oncall rotation for ladder 'http://test' has been updated at 2021/09/28
13:30:00-0700:
Oncall until: 2021/10/05 13:30:00-0700

Oncall list (level -> contacts):
Level 1: quidam
Level 2: quidam_bis


May the queries flow and the pagers remain silent.

renders like this in Mattermost:

The oncall rotation for ladder 'http://test' has been updated at 2021/09/28
13:30:00-0700:

Oncall list (level -> contacts):


May the queries flow and the pagers remain silent.

In the mail2most config, we use StripHTML = false and ConvertToMarkdown = false.

It seems like the lines after a :\n go missing?

Any idea how to fix it?

Thanks

Philmod avatar Sep 28 '21 22:09 Philmod

Thanks @Philmod for bringing this up. Interesting behavior, I'll take a look on this and check if I can reproduce this.

c-seeger avatar Sep 29 '21 05:09 c-seeger

Thanks @Philmod for bringing this up. Interesting behavior, I'll take a look on this and check if I can reproduce this.

Hey @c-seeger, were you able to reproduce this bug?

Philmod avatar Oct 18 '21 12:10 Philmod

Hi @c-seeger, any update on this bug?

Philmod avatar Dec 06 '21 13:12 Philmod

Hey @c-seeger, any update on this issue?

Philmod avatar Feb 16 '22 21:02 Philmod

hello @Philmod sorry not atm will take a look as soon as i find some time

c-seeger avatar Feb 20 '22 14:02 c-seeger