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

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 and/or MS-Exchange) that has some white square image files at the bottom, like this:



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.


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


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.