Project

General

Profile

Actions

Patch #10069

closed

delimiter improvments

Patch #10069: delimiter improvments

Added by Peter Kalvin almost 15 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-

Description

hi guys,

I have two suggestions for the email delimiter setting, which I think should be improved:

1. It should accept regex expression, because some email clients like web gmail will attach the signature after the quoted reply text, so it won't be cropped.

2. If not regexp, then it should not match the whole delimiter line, only the beginning of it. Here is a patch for that:

Index: app/models/mail_handler.rb
===================================================================
--- app/models/mail_handler.rb    (revision 8414)
+++ app/models/mail_handler.rb    (working copy)
@@ -378,7 +378,8 @@
   def cleanup_body(body)
     delimiters = Setting.mail_handler_body_delimiters.to_s.split(/[\r\n]+/).reject(&:blank?).map {|s| Regexp.escape(s)}
     unless delimiters.empty?
-      regex = Regexp.new("^[> ]*(#{ delimiters.join('|') })\s*[\r\n].*", Regexp::MULTILINE)
+      regex = Regexp.new("^[> ]*(#{ delimiters.join('|') }).*", Regexp::MULTILINE)
       body = body.gsub(regex, '')
     end
     body.strip

What do you guys think?


Related issues 1 (0 open — 1 closed)

Is duplicate of Redmine - Feature #5864: Regex Text on Receiver EmailClosedJean-Philippe LangActions

Updated by Filou Centrinov over 13 years ago Actions #1

Category: Email reveiving

Updated by Toshi MARUYAMA over 13 years ago Actions #2

  • Category set to Email receiving

Updated by Go MAEDA almost 10 years ago Actions #3

  • Is duplicate of Feature #5864: Regex Text on Receiver Email added

Updated by Go MAEDA almost 10 years ago Actions #4

  • Status changed from New to Closed

Regular expression delimiter has been implemented by #5864.
It will be available in upcoming Redmine 3.4.0.

Updated by Toshi MARUYAMA almost 10 years ago Actions #5

  • Description updated (diff)
Actions

Also available in: PDF Atom