プロジェクト

全般

プロフィール

Vote #76284

未完了

Redmine does not honnor RFC822 4.4.3 reply-to field in incoming emails

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Email receiving_29
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
29
version_id:
0
issue_org_id:
19599
author_id:
125665
assigned_to_id:
0
comments:
1
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Many modern (or just well-configured) SMTP servers will block a user from impersonating another email address by re-writing the 'from' header into the 'reply-to' header and setting 'from' as the actual sending account name. This caused a problem for me when creating tickets from the email issued by a website contact form. The notifications would go to the wrong address and the user account would not be created.

I'm not clear on weather the responsibility for this should lie with Redmine or Mail::Message but I've patched my Redmine installation with the following code at the start of the receive(email) method in app/models/mail_handler.rb.

If I knew more about Redmine I'd try to make a plugin that solved the issue, perhaps someone else can.

I've verified this problem exists in trunk and 2.6.3.stable.

This is my fix:


  # Processes incoming emails
  # Returns the created object (eg. an issue, a message) or false
  def receive(email)
    @email = email
    sender_email = email.from.to_a.first.to_s.strip

    #RFC822 Sections 4.4.3 and 4.4.4 say that if the reply-to field exists, mail should not be sent to the address in the 'from' field.
    #Correct handling of 'reply-to' is required for SMTP servers that do not allow senders to fake the 'from' field.
    #Website contact forms transmitted through a gmail SMTP server are a good example.
    if email['reply-to'].present?
        replyto_email = email['reply_to'].to_s.strip
        logger.info "Email contains a reply-to field. Will attempt to use '" + replyto_email + "' instead of '" + sender_email + "'"
        sender_email = replyto_email
    end

journals

--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリEmail receiving_29 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0