Patch #10069

delimiter improvments

Added by Peter Kalvin over 10 years ago. Updated over 5 years ago.

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


Category:Email receiving
Target version:-


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 ="^[> ]*(#{ delimiters.join('|') })\s*[\r\n].*", Regexp::MULTILINE)
+      regex ="^[> ]*(#{ delimiters.join('|') }).*", Regexp::MULTILINE)
       body = body.gsub(regex, '')

What do you guys think?

Related issues

Duplicates Redmine - Feature #5864: Regex Text on Receiver Email Closed 2010-07-10


#1 Updated by Filou Centrinov about 9 years ago

Category: Email reveiving

#2 Updated by Toshi MARUYAMA about 9 years ago

  • Category set to Email receiving

#3 Updated by Go MAEDA over 5 years ago

#4 Updated by Go MAEDA over 5 years ago

  • Status changed from New to Closed

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

#5 Updated by Toshi MARUYAMA over 5 years ago

  • Description updated (diff)

Also available in: Atom PDF