Skip to content

Conversation

@ggranjus
Copy link
Contributor

Fix #255

The SMTP url is used in shoutrrr.Send(url, msg).
When a password contains char #, it can not be parsed by url.Parse in https://github.com/containrrr/shoutrrr/blob/main/pkg/router/router.go#LL150.

Escaping the password part fixes it. Tests are added to verify that there is no regression, hence the refacto to extract the buildUrl function to test it easily.

Without escaping

=== RUN   TestBuildUrl/with_octohorpe_in_password
    smtp_test.go:29: Failed to parse url: parse "smtp://[email protected]:passwordwith": invalid port ":passwordwith" after host

With escaping

 --- PASS: TestBuildUrl/with_octohorpe_in_password (0.00s)

dependabot bot and others added 4 commits March 11, 2023 23:15
…bot/go_modules/golang.org/x/net-0.7.0

chore(deps): bump golang.org/x/net from 0.0.0-20220909164309-bea034e7d591 to 0.7.0
Refactor smtp.Send by extracting the build of url to better test this part
@ehsandeep ehsandeep changed the base branch from master to dev May 21, 2023 19:59
@ehsandeep
Copy link
Member

@ggranjus Thank you for fixing this out, I've pointed the PR to dev branch, Can you please resolve the merge conflict?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ehsandeep ehsandeep requested a review from ShubhamRasal May 22, 2023 07:36
Copy link

@ShubhamRasal ShubhamRasal left a comment

Choose a reason for hiding this comment

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

lgtm - 😄

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.

SMTP fails when password contains octothorpe ("#") character

4 participants