flask-mailman
flask-mailman copied to clipboard
Support specifying the source IP address and/or port
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 Report
Attention: 2 lines
in your changes are missing coverage. Please review.
Comparison is base (
cfaf774
) 63.10% compared to head (5b9eb88
) 63.13%.
:exclamation: 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%) |
:arrow_up: |
flask_mailman/backends/smtp.py | 32.58% <50.00%> (+0.81%) |
:arrow_up: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I'm not sure why one of the checks has failed. If I'm not mistaken, the unit tests themselves passed.
I'll check it later, thanks for your contribution! 🌹
@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.
Please add unit tests for the new API.