Skip to content

Reads mail-key from CC in general email receiver

Marc Saleiko requested to merge ms-read-mail-key-from-cc into master

What does this MR do and why?

Solves Allow CC'ing incoming_email and service_desk_email (#348572 - closed)

Contributes to Use minimal inline email bodies in specs instea... (#426973)

Allows Service Desk and notification email reply addresses to be present in the CC header.

For example, you want to send an email to someone and also raise a new issue in Service Desk.

Screenshots or screen recordings

🚫 backend only

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Set up incoming_email. Feel free to fully set it up. For this MR you can also stub it by adding this to your gitlab.yml under development:
      incoming_email:
        enabled: true
        address: "incoming+%{key}@example.com"
  2. In the rails console, pick a project and get the service desk incoming address:
    project = Project.find(7)
    service_desk_address = project.service_desk_incoming_address
  3. Prepare an email body and simulate ingesting the email using the EmailReceiverWorker:
    email_raw = <<~EMAIL
    To: dontcare@example.com
    From: marc@example.com
    Cc: #{service_desk_address}
    Subject: Test SD issue
    
    Email content
    EMAIL
    
    EmailReceiverWorker.new.perform(email_raw)
  4. This should create a new issue (see the INSERT statement). You can also browse to you projects issue list or Service Desk issue list and find and issue with the title "Test SD issue".

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Marc Saleiko

Merge request reports