Patch #34794

Allow newlines and quote characters within mail body delimiters

Added by Holger Just 8 days ago. Updated 6 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:


Category:Email receiving
Target version:Candidate for next major release


When processing incoming emails, there is the possibility to define body delimiters after which no further content should be read from the mail body.

When defining long delimiters (e.g. commonly in Setting.emails_header), the delimiter may break into multiple lines in replies with (nested) quote characters at the beginning of lines.

With the attached patch, we extend the handling of "normal" delimiters (i.e. delimiters not defined as regular expressions) so that any space within the delimiter can also span multiple lines with optional quote characters at the front. This ensures that even delimiters broken over multiple lines in incoming mails will be recognized as such.

The patch is against current trunk (r20752) and can be applied with patch -p1 < 0001-Allow-newlines-and-quote-characters-within-mail-body.patch.

0001-Allow-newlines-and-quote-characters-within-mail-body.patch Magnifier (2.33 KB) Holger Just, 2021-02-23 11:47


#1 Updated by Go MAEDA 8 days ago

  • Target version set to Candidate for next major release

#2 Updated by Marius BALTEANU 7 days ago

  • Target version changed from Candidate for next major release to 4.2.0

This is a nice improvement because certain clients are sending the reply on two lines. Below an example from Gmail:

On Wed, Feb 24, 2021 at 6:13 PM John Doe <>

#3 Updated by Marius BALTEANU 7 days ago

  • Target version changed from 4.2.0 to Candidate for next major release

#4 Updated by Holger Just 6 days ago

Please note though that the change only applies to non-regex delimiters. To match this delimiter, you would still need to define a regex manually (and enable the Enable regular expressions checkbox) similar to:

On .* at .* wrote:

The patch does not touch those defined regular expressions. It merely improves the situation for static delimiters.

Thos static delimiters are most useful along with a static email header which is added on top of all notification mails, e.g. something like

--- Please write your response above this line and omit any large signatures ---

You can then define this static mail header as a delimiter to omit the quoted text from the notification if someone replies to it.

#5 Updated by Marius BALTEANU 6 days ago

Thanks Holger for clarifications, I totally missed that mention.

Also available in: Atom PDF