Email signature not being stripped out when user write new topic or reply to a topic

Yes, it is checked. Is there any other setting needed?

It should be unchecked if you don’t want to show trimmed content.

1 Like

Hmm - that is the setting I started with, that was also not trimming out signatures for me.

I wonder if it is only the very first post by email, and not any subsequent posts that get trimmed?

Does it happen on all incoming emails? The email signature trimmer works well on the majority of mine, but a few random ones get through, along with a persistent one sent from X-Mailer: Microsoft Outlook 16.0.

No, all posts by email get the trimmer treatment.

3 Likes

I was just able to send a message using a gmail address and using the web based gmail app - this had an image signature that was successfully trimmed

The same email account when sending a message using my local Outlook 2016 app on PC however did not get its signature stripped (same signature image, but set up in Outlook)

Realistically, the largest proportion of users of the forum will be using Microsoft Outlook app, so that would have to be a benchmark for ‘success’ of the trimming process.

Is it only one Outlook 2016 email source giving you trouble with signatures, or all of them?

Is Outlook 2016 known to insert stuff that is resistant to trimming? or was Outlook 2016 perhaps not deemed to be one of the popular apps that should be included in the email_reply_trimmer library?
Has anyone come up with a strategy for dealing with this? (other than asking users to remember to switch off automatic signatures whenever emailing the forum - which I know will elicit grumbles!)

I see also that while not trimmed, signatures in Outlook 2016 messages are not being parsed properly, in my case with messed up text formatting and fonts, as well as a couple of added text characters and an over scaled image - or is this the result of an unsuccessful trimming effort?

It’s one Outlook 16 user’s signature that always gets through the trimmer, and another with an unknown client (but sent through outlook.com and/or MS-Exchange) that has some white square image files at the bottom, like this:

![~WRD000.jpg|100x100](upload://bONwCMToQaefS5MCaw6ckHjvG5z.jpg)

![image001.jpg|45x45](upload://yS0BlfXTqaPhoqyF6LaZLwt7xJv.jpg)

There are other occasional signatures that get past the trimmer, but they don’t happen often or with any consistency.

1 Like

Hmm - what is best strategy from here?

Is this email_reply_trimmer library something that any idiot (such as myself) can mess around with to see if they can identify the patterns in the script as applied for other email apps and add a filter for Outlook 2016 signatures? I think I read this script is now part of core for Discourse? Or am I kidding myself?

I have never messed around with GitHub, and would not want to potentially mess anyone else up in the process of experimenting, or even inflict irreparable harm on my own forum.

You could send me a PM with the source of an email that doesn’t get trimmed properly. I’ll have a look.

3 Likes

We are using a web form to generate an email to create new topics in a Category.

The web form includes this by default:

This email was sent to [category email] as a result of a form being completed.
Click here to report unwanted email.

Is there a way to trim out a message like this?

Try changing the web form software to place the message below a -‍-  (two dashes and a space) to make it look more like a signature.

Blah blah
Form: Content

-- 

This email was sent to [category email] as a result of a form being completed.
Click here to report unwanted email.

don’t actually copy my two dashes and a space above, it has some unicode trickery in there

3 Likes

Thanks, I’ll see if that’s something we can add into the web form template!

This feature would be tremendously useful - being able to add offending signatures to a ‘strip this out if you see it again’ list. Matching could be a little more straightforward since it would just remove that text verbatim, rather than having to speculatively try to match all signatures.

5 Likes

I second this. Though I will try asking people to use "-- ".

1 Like

That isn’t quite right - it should have the space in the middle, so: “- -”

Personally, I have found it pretty difficult to get users to put that into their signatures. It is okay if you can look over their shoulder to set it up for them, but they struggle on their own!! Maybe yours are more tech savvy.

I’m pretty certain the convention is hyphen-hyphen-space, as set out above. See also the introductory comments and line 144 here: https://github.com/discourse/discourse_email_parser/blob/master/lib/discourse_email_parser.rb

Those comments and code have “- -”. Take a closer look.

They really don’t. If you cut and paste the regex in line 144 into https://rubular.com/ you’ll see that it matches -- (hyphen-hyphen-space) but not - - (hyphen-space-hyphen).

3 Likes

Ah, I see. It sure looks as though there is a space in between, unless you cut and paste it into something else (from line 144):
"--/s" - looks like a space in between the hyphens to me when presented as code.
“–/s” cut and pasted into markdown directly, clearly no space.

This might explain why I’ve struggled to have any success with this! Thank you for holding the line.

3 Likes

You’re welcome :slight_smile:

I don’t know Ruby but \s seems to match a line return as well as a space - if that’s right then -- on its own line, without the space, should be OK too.

1 Like

Markdown uses a bunch of hyphens for a horizontal rule. We have messages that include meeting details below a horizontal rule. Is there an alternative that we can use to make a separator without causing trimming?

For example, an example incoming email might contain the following:


This is the content of an example email. It might contain meeting details. If this post were sent via email, then this part - and everything after it - would be trimmed.


Thanks!