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

Fix 4952 read doctor email receiver from console #6014

Conversation

mustansirgodhrawala
Copy link

What is the issue? Where did it come from?

This issue arised because RFC 2606, does not allow sending emails to restricted domains such as example.com. This is why, even with a valid SMTP configuration, PHP Mailer will mark SMTP as disconnected.
A different fix, such as changing the default receiver to perhaps smtp-test[@]appwrite.io could also fix this issue. But perhaps this is a better fix?

What does this PR do?

This PR addresses the issue #4952, as @stnguyen90 mentions exposing the receiver email to the CLI would be the best approach I've implemented the same, with also added a interactive param.

The interactive param is defaulted to 'n', which allows our e2e tests to stay the same. But requires updating our documentation to recommend the user to run doctor in the following way-

docker exec appwrite sh -c 'doctor --interactive=y'

Test Plan

I've not made much changes, that would require adding extra tests. Since this is my first pull request, I'm not fully aware of what to fill in here.

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@stnguyen90 stnguyen90 added this to the 1.4.1 milestone Aug 18, 2023
@stnguyen90 stnguyen90 linked an issue Aug 18, 2023 that may be closed by this pull request
2 tasks
app/tasks/doctor.php Outdated Show resolved Hide resolved
app/tasks/doctor.php Outdated Show resolved Hide resolved
app/tasks/doctor.php Outdated Show resolved Hide resolved
app/tasks/doctor.php Outdated Show resolved Hide resolved
@fanatic75 fanatic75 self-requested a review August 18, 2023 19:19
app/tasks/doctor.php Outdated Show resolved Hide resolved
app/tasks/doctor.php Outdated Show resolved Hide resolved
Co-authored-by: Prateek Banga <[email protected]>
@fanatic75 fanatic75 self-requested a review August 18, 2023 19:26
@mustansirgodhrawala
Copy link
Author

@fanatic75 @stnguyen90 Could you please take a look and let me know anything else is needed to merge this pull?

Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you please also fix the merge conflicts? 🙏🏼


$cli
->task('doctor')
->desc('Validate server health')
->action(function () use ($register) {
->param('interactive', 'n', new Text(1), 'Run an interactive session', true)
->param('receiver', '', new Wildcard(), 'Send an email to this address to test SMTP', true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a validator for email so let's use that instead of wildcard

@stnguyen90 stnguyen90 removed this from the 1.4.1 milestone Oct 4, 2023
@stnguyen90
Copy link
Contributor

@mustansirgodhrawala, when will you be able to address the outstanding comments? Please be advised, I'll need to unassign you soon due to inactivity.

@stnguyen90
Copy link
Contributor

Closing due to inactivity.

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

Successfully merging this pull request may close these issues.

🐛 Bug Report: test email address cause SMTP disconnected
3 participants