Defect #5698

redmine:email:receive_imap fails silently for mails with subject longer than 255 characters

Added by Alexander Malfait 3 months ago. Updated 2 months ago.

Status:Closed Start:2010-06-16
Priority:Normal Due date:
Assigned to:Eric Davis % Done:

100%

Category:Email receiving
Target version:1.0.0 (RC)
Affected version: Resolution:Fixed

Description

The automatic issue creation from mailbox silently ignores emails which have a subject longer than 255 characters - the model validation for Issue fails, and the mail is ignored.

We ran into this problem while automatically importing exceptions from client sites into Redmine via e-mail (exception messages would sometimes amount to more than 255 characters).

It would be better to just chop the subject off at 255 characters and create the issue like that. Can be modified this way:

in app/models/mail_handler.rb at line 137:
issue.subject = email.subject.chomp[0..254]

5698.diff (3.9 KB) Jan from www.plan.io, 2010-06-20 16:01

Associated revisions

Revision 3801
Added by Eric Davis 2 months ago

Truncate incoming email subject lines to 255 characters. #5698

Contributed by Jan

History

Updated by Eric Davis 3 months ago

  • Category set to Email receiving

Updated by Jan from www.plan.io 2 months ago

here's a patch with tests. mails with subject lines that are longer than 255 chars will get chopped off.

Updated by Jan from www.plan.io 2 months ago

  • % Done changed from 0 to 90

somebody should look over it and then commit...

Updated by Eric Davis 2 months ago

  • Status changed from New to Closed
  • Assigned to set to Eric Davis
  • Target version set to 1.0.0 (RC)
  • % Done changed from 90 to 100
  • Resolution set to Fixed

Committed in r3801, thank you for the bug report and patch.

Also available in: Atom PDF