Defect #16619

Mailer.token_for generates invalid message_id when using from address with full name

Added by David Robinson almost 4 years ago. Updated over 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Email notifications
Target version:2.5.2
Resolution:Fixed Affected version:2.4.4

Description

The token generator in Mailer.rb (Mailer.token_for) has the following code:

host = Setting.mail_from.to_s.gsub(%r{^.*@}, '')

If you have configured Redmine to send from an address with both name and email, (f.ex. "Redmine Mailer<>") this results in a Message-id like the following being created:
<redmine.journal-2421.20140408113649@redmine.org>>

the double ">" at the end is considered illegal by some mail servers, and results in them rejecting it.

A possible solution could be the following:

host = Setting.mail_from.to_s.gsub(%r{(^.*@)|>}, '')

Associated revisions

Revision 13126
Added by Jean-Philippe Lang over 3 years ago

Mailer.token_for generates invalid message_id when using from address with full name (#16619).

History

#1 Updated by Jean-Philippe Lang over 3 years ago

  • Subject changed from Mailer.rb token generator to Mailer.token_for generates invalid message_id when using from address with full name
  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.5.2
  • Resolution set to Fixed

Fixed in r13126, thanks for pointing this out.

#2 Updated by Jean-Philippe Lang over 3 years ago

  • Status changed from Resolved to Closed

Merged.

Also available in: Atom PDF