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

host parsed from user login (if present) for Emails #1095

Merged
merged 2 commits into from
Apr 7, 2024

Conversation

caronc
Copy link
Owner

@caronc caronc commented Apr 7, 2024

Description:

Related issue (if applicable): n/a

This was a report made on Discord where the URL should have worked (imo):

  • mailtos://?smtp=mobile.charter.net&pass=password&user=name@spectrum.net

Apprise wasn't smart enough to pull the spectrum.net hostname from the user login for the host until this PR. The user above can still use the URL:

  • mailtos://spectrum.net?smtp=mobile.charter.net&pass=password&user=name@spectrum.net

After this PR, the first URL will work. To avoid ambiguity, emails can now also be specified in the hostname if content was parsed elsewhere; hence the following URL is also valid now:

  • mailtos://Jason Smith<jsmith%40yahoo.ca>?smtp=mobile.charter.net&pass=password&user=name@spectrum.net
    • Note: %40 == @. The idea is if you don't specify a hostname, you're not restricted from putting in your emails you want to transmit to. This becomes the to and flows with current design.

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use flake8)
  • 100% test coverage

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@email-host-detection-from-source

# Test out the changes with the following command:
apprise -t "Test Title" -b "Test Message" \
  "mailtos://?smtp=mobile.charter.net&pass=password&user=name@spectrum.net"

@codecov-commenter
Copy link

codecov-commenter commented Apr 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.27%. Comparing base (6cd528c) to head (ffb2dfd).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1095   +/-   ##
=======================================
  Coverage   99.27%   99.27%           
=======================================
  Files         138      138           
  Lines       17954    17964   +10     
  Branches     3663     3667    +4     
=======================================
+ Hits        17824    17834   +10     
  Misses        121      121           
  Partials        9        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caronc caronc merged commit 1cef49e into master Apr 7, 2024
12 checks passed
@caronc caronc deleted the email-host-detection-from-source branch April 8, 2024 21:24
caronc added a commit that referenced this pull request Apr 20, 2024
@caronc caronc mentioned this pull request Apr 20, 2024
4 tasks
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.

2 participants