Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MIvanIsten opened this issue May 17, 2024 · 2 comments

Comments

@MIvanIsten
Copy link

MIvanIsten commented May 17, 2024

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: from@example.org 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

@MatTheCat
Copy link
Contributor

I don’t think this is an issue: as the command description says, its purpose is to test transports.

@MIvanIsten
Copy link
Author

I don’t think this is an issue: as the command description says, its purpose is to test transports.

Not respecting configuration makes test results irrelevant / unreliable. I think this is an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants