Help improve email reply detection
Posted: 18 Sep 2026, 00:44
Can someone sticky this thread?
Since 0.11.0 we started using EmailReplyParser.
That library uses the first few lines of the start of the reply to detect whether a new reply starts. (https://github.com/SL-Gundam/EmailReply ... er.php#L38)
Problem is most of these lines are language specific and/or mail program specific.
Please report here if your variation (language or mail program) is missing so that we can add it.
Please provide a copy of he first few lines of the start of the reply so that we know what conditions need to be added.
Currently we've covered
We also have signature detection in the same library
It currently covers this for signature detection. The same applies here.
Since 0.11.0 we started using EmailReplyParser.
That library uses the first few lines of the start of the reply to detect whether a new reply starts. (https://github.com/SL-Gundam/EmailReply ... er.php#L38)
Problem is most of these lines are language specific and/or mail program specific.
Please report here if your variation (language or mail program) is missing so that we can add it.
Please provide a copy of he first few lines of the start of the reply so that we know what conditions need to be added.
Currently we've covered
Code: Select all
'/^.{0,5}(On(?:(?!\bOn\b|\bwrote(\s|\xc2\xa0)?:).){0,1000}wrote(\s|\xc2\xa0)?:)$/ms', // On DATE, NAME <EMAIL> wrote:
'/^.{0,5}(Le\b(?:(?!\bLe\b|\bécrit(\s|\xc2\xa0)?:).){0,1000}écrit(\s|\xc2\xa0)?:)$/ms', // Le DATE, NAME <EMAIL> a écrit :
'/^.{0,5}(El(?:(?!\bEl\b|\bescribió\s?:).){0,1000}escribió\s?:)$/ms', // El DATE, NAME <EMAIL> escribió:
'/^.{0,5}(El(?:(?!\bEl\b|\bha escrit\s?:).){0,1000}ha escrit\s?:)$/ms', // El DATE, NAME <EMAIL> ha escrit:
'/^.{0,5}(Il(?:(?!\bIl\b|\bscritto(\s|\xc2\xa0)?:).){0,1000}scritto(\s|\xc2\xa0)?:)$/ms', // Il DATE, NAME <EMAIL> ha scritto:
'/^[\S\s]+ (написа(л|ла|в)+)+:$/msu', // Everything before написал: not ending on wrote:
'/^\s*(Op\s.+?(schreef|geschreven).+:)$/ms', // Op DATE schreef NAME <EMAIL>:, Op DATE heeft NAME <EMAIL> het volgende geschreven:
'/^\s*((W\sdniu|Dnia)\s.+?(pisze|napisał(\(a\))?):)$/msu', // W dniu DATE, NAME <EMAIL> pisze|napisał:
'/^\s*(Den\s.+\sskrev\s.+:)$/m', // Den DATE skrev NAME <EMAIL>:
'/^\s*(Am\s.+\sum\s.+\sschrieb\s.+:)$/m', // Am DATE um TIME schrieb NAME:
'/^(在.+写道:)$/ms', // > 在 DATE, TIME, NAME 写道:
'/^(20[0-9]{2}\..+\s작성:)$/m', // DATE TIME NAME 작성:
'/^(20[0-9]{2}\/.+のメッセージ:)$/m', // DATE TIME、NAME のメッセージ:
'/^(.+\s<.+>\sschrieb:)$/m', // NAME <EMAIL> schrieb:
'/^\s*(\*{0,2}From\*{0,2}\s?:.+\s?(\[|<).+(\]|>))/mu', // "From: NAME <EMAIL>" OR "From : NAME <EMAIL>" OR "From : NAME<EMAIL>"(With support whitespace before start and before <) (with support two ** around first word)
'/^\s*(\*{0,2}发件人\*{0,2}\s?:.+\s?(\[|<).+(\]|>))/mu', // "发件人: NAME <EMAIL>" OR "发件人 : NAME <EMAIL>" OR "发件人 : NAME<EMAIL>"(With support whitespace before start and before <) (with support two ** around first word)
'/^\s*(\*{0,2}De\*{0,2}\s?:.+\s?(\[|<).+(\]|>))/mu', // "De: NAME <EMAIL>" OR "De : NAME <EMAIL>" OR "De : NAME<EMAIL>" (With support whitespace before start and before <) (with support two ** around first word)
'/^\s*(\*{0,2}Van\*{0,2}\s?:.+\s?(\[|<).+(\]|>))/mu', // "Van: NAME <EMAIL>" OR "Van : NAME <EMAIL>" OR "Van : NAME<EMAIL>" (With support whitespace before start and before <) (with support two ** around first word)
'/^\s*(\*{0,2}Da\*{0,2}\s?:.+\s?(\[|<).+(\]|>))/mu', // "Da: NAME <EMAIL>" OR "Da : NAME <EMAIL>" OR "Da : NAME<EMAIL>" (With support whitespace before start and before <) (with support two ** around first word)
'/^\s*(\*{0,2}Von\*{0,2}\s?:.+\s?(\[|<).+(\]|>))/mu', // "Von: NAME <EMAIL>" OR "Von : NAME <EMAIL>" OR "Von : NAME<EMAIL>" (With support whitespace before start and before <) (with support two ** around first word)
'/^(20[0-9]{2}\-(?:0?[1-9]|1[012])\-(?:0?[0-9]|[1-2][0-9]|3[01]|[1-9])\s[0-2]?[0-9]:\d{2}\s.+?:)$/ms', // 20YY-MM-DD HH:II GMT+01:00 NAME <EMAIL>:
'/^\s*([a-z]{3,4}\.\s.+\sskrev\s.+:)$/ms', // DATE skrev NAME <EMAIL>:
It currently covers this for signature detection. The same applies here.
Code: Select all
'/(?:^\s*--|^\s*__|^-\w|^-- $)/s', // --, __, -w
'/(?:^Sent (from|via) (my|Mail|the) (?:\s*\w+){1,4}$)/s', // English: Sent (from|via) (my|Mail|the)
'/(?:^Verstuurd vanaf mijn (?:\s*\w+){1,4}$)/s', // Dutch: Verstuurd vanaf mijn
'/(?:^={30,}$)$/s',