Page MenuHomePhabricator

Name used for the "from" email address when incident reports are emailed should be set
Closed, ResolvedPublic

Description

A incident report when submitted is emailed to the configured email addresses. The email that is sent uses the customisable wgReportIncidentEmailFromAddress to specify what email address the email that is sent appears to have come from. However, no name is set.

Most places that send emails specify the name as the value of the message emailsender. Something configurable may be wanted, but by default the value of emailsender could be used.

Acceptance criteria
  • Make emails sent for incident reports be sent with a name defined for the "from" email.
Steps to verify
  1. Use MediaWiki-Docker
  2. Follow steps on https://www.mediawiki.org/wiki/MediaWiki-Docker/Configuration_recipes/Mail_handling to setup a mail server
  3. Rebuild the docker containers to apply the changes to the docker override file (docker compose down and then docker compose up -d)
  4. Install the ReportIncident extension
  5. Add the following to your LocalSettings.php:
$wgReportIncidentRecipientEmails = [ 'test@test.com' ];
$wgReportIncidentEmailFromAddress = 'test@localhost';
  1. Go to a user talk page
  2. Click on the "Report" button
  3. Click through to submit a report
  4. Fill out the form with test data
  5. Submit the form
  6. Load http://localhost:8025/

This patch has worked if you see an email and the email has the sender name as "mediawiki". Before this patch the email sender did not have a name defined.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 959853 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/ReportIncident@master] emailer: Specify name used with 'from' address

https://gerrit.wikimedia.org/r/959853

Change 959853 merged by jenkins-bot:

[mediawiki/extensions/ReportIncident@master] emailer: Specify name used with 'from' address

https://gerrit.wikimedia.org/r/959853

Not for sure why this was pushed to QA...
I have no way to verify this because not enough information is listed in the ticket Description (such as specific QA Steps) involving how or where to verify the code changes for this ticket.

Added some steps that can be used to test this.

Dreamy_Jazz updated the task description. (Show Details)
Dreamy_Jazz updated the task description. (Show Details)

Test wiki created on Patch demo by DJacksonA using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/c8fdc95ff1/w

I will need to put this ticket into the Hold / Blocked column until the email group is created...
For more information see comments regarding the creation of an email group for incident-report-system-beta (ticket https://phabricator.wikimedia.org/T339275)

This remains blocked for now as the Inbox extension does not store the name used for the sender of the email or recipients. This ticket is defining this for the sender, so for now this cannot be QA'd on Patch Demo.

Suggested QA steps for patch demo:

  1. Install the ReportIncident extension
  2. Open a user talk page
  3. Open DevTools and have the network tab open
  4. Click on Report in the Tools menu in the browser window
  5. Click file a report button, and then fill in the form
  6. Submit the form
  7. Find the API request that sent the form
  8. Inspect the response
  9. In the response JSON should be "from":{"name":"Patch demo (master)","realName":"","address":"b@example.com"}.

I have verified the new code has been implemented and is functioning and displaying with "from":{"name":"Patch demo (master)","realName":"","address":"b@example.com"}
Testing was executed at https://patchdemo.wmflabs.org/wikis/70e76793db/wiki/User_talk:Bob
As always @Dreamy_Jazz thank you for the great work and the QA Steps.

image.png (988×1 px, 721 KB)

image.png (410×1 px, 69 KB)

This ticket has already been QA'd and has passed QA as of Oct 27th so I am moving this to Done.

Test wiki on Patch demo by DJacksonA using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/c8fdc95ff1/w/