Skip to content

feat: PROXY protocol support - #347

Open
cole wants to merge 1 commit into
mainfrom
proxy
Open

feat: PROXY protocol support#347
cole wants to merge 1 commit into
mainfrom
proxy

Conversation

@cole

@cole cole commented May 1, 2026

Copy link
Copy Markdown
Owner

No description provided.

@codecov

codecov Bot commented May 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c918bd7) to head (8e9ef02).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #347   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        13    +1     
  Lines          886       960   +74     
  Branches       151       163   +12     
=========================================
+ Hits           886       960   +74     
Flag Coverage Δ
asyncio 100.00% <100.00%> (ø)
cpython3.10 99.89% <100.00%> (+<0.01%) ⬆️
cpython3.11 99.89% <100.00%> (+<0.01%) ⬆️
cpython3.12 100.00% <100.00%> (+0.22%) ⬆️
cpython3.13 100.00% <100.00%> (+0.22%) ⬆️
cpython3.14 100.00% <100.00%> (+0.22%) ⬆️
pypy3.11 100.00% <100.00%> (ø)
uvloop 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Add a ProxyProtocol config class and a proxy_protocol keyword on SMTP,
SMTP.connect, and send. Supports v1 (text) and v2 (binary) headers,
with v2 the default; the header is written before the SMTP banner is
read, including ahead of the TLS handshake when use_tls=True.

Also fixes SMTP.quit() hanging until the read timeout when the peer
drops the transport after QUIT is sent but before the 221 reply is
parsed, and factors the TLS transport upgrade into
SMTPProtocol.upgrade_transport, shared by STARTTLS and the deferred
proxy+TLS connect path.
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.

1 participant