Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Mailer] Command mailer:test seting fake 'From' header by default, gives misleading test results #54969

Open
@MIvanIsten

Description

@MIvanIsten

Symfony version(s) affected

7.0.7

Description

If no framework.mailer.headers.From parameter is set, and no from option is given in command line, the command should fail, indicating incomplete configuration.
Forcing a fake From header hides this information.

How to reproduce

comment out framework.mailer.headers.From in mailer.yaml
send a test email with bin/console mailer:test without using --from option
received email contains a From: [email protected] header

Possible Solution

remove default value from from input option
set $message->from() only if from input option is given in command line

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions