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

Support specifying the source IP address and/or port #36

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ECrosland
Copy link

A source_address argument is accepted by the smtplib.SMTP and smtplib.SMTP_SSL constructors. The argument is a pair comprising an IP address and a port number. Providing this argument is useful when more than one network interface is available to the app, but one in particular must be used when connecting to the SMTP server.

I propose to add support for this connection option to Flask-Mailman in the form of two new config properties, MAIL_SOURCE_ADDRESS and MAIL_SOURCE_PORT.

Apologies that I have not added mention of this feature to README.md as the contributing guidelines request, but I could not find a section in that file where it seemed to belong. I did add documentation for the two config properties to docs/index.md, however.

@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (cfaf774) 63.10% compared to head (5b9eb88) 63.13%.

❗ Current head 5b9eb88 differs from pull request most recent head d01cd43. Consider uploading reports for the commit d01cd43 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   63.10%   63.13%   +0.03%     
==========================================
  Files           9        9              
  Lines         580      586       +6     
==========================================
+ Hits          366      370       +4     
- Misses        214      216       +2     
Files Coverage Δ
flask_mailman/__init__.py 94.44% <100.00%> (+0.12%) ⬆️
flask_mailman/backends/smtp.py 32.58% <50.00%> (+0.81%) ⬆️

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

@ECrosland
Copy link
Author

I'm not sure why one of the checks has failed. If I'm not mistaken, the unit tests themselves passed.

@waynerv
Copy link
Owner

waynerv commented May 26, 2022

I'll check it later, thanks for your contribution! 🌹

@sr-verde
Copy link
Contributor

sr-verde commented Jun 17, 2022

@ECrosland, there is no unittest that checks the behavior when source_address or source_port aren't None. So, the CI complains about the fact that lines 77 and 78 are not covered.

@greyli
Copy link
Collaborator

greyli commented Nov 4, 2023

Please add unit tests for the new API.

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.

None yet

4 participants