Skip to content

feat(application): dissect POP3 over TCP port 110 (#2964) - #3206

Merged
JarryShaw merged 1 commit into
developfrom
feat/2964-pop3
Nov 29, 2026
Merged

JarryShaw merged 1 commit into
developfrom
feat/2964-pop3

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

  • Put an x into every box [ ] that applies to your pull request (like this: [x])

  • Use the Preview tab to see how your pull request will look

  • Searched for similar pull requests

  • Followed the coding style (make pylint, make mypy, make isort)

  • make test passes, and a test case covers the change

  • Described the user-visible change below and left its changelog entry to the maintainer, keeping docs/source/changelog/ and CHANGELOG.md out of the diff, if the change is user-visible: N/A — centralised

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect

  • feat — adds a feature

  • perf — changes performance, not behaviour

  • refactor — changes neither behaviour nor performance

  • test — tests only

  • docs — documentation only

  • ci — workflows or build tooling

  • release — bumps the version or rolls up a distribution

  • chore — anything else

  • Also tick if it regenerates constant or registry tables, members keeping their numeric values (the const label)


Description of your pull request and other information

Closes #2964.

POP3 at TCP 110 (RFC 1939; RFC 2449), read through pcapkit.utilities.lines (#2960). A segment is a response (a status line alone, or a whole multi-line response), an AUTH server challenge (RFC 5034 section 4), a command, or the end of a multi-line response. A status line with more lines but no end stays Raw, as it may be pipelined responses (RFC 2449 section 6.6), as do status lines over 512 octets and commands over 255 (section 4).

Scope: status, text, and code, the response code the text opens with (section 8), resolved by its longest registered prefix of levels. Text is UTF-8 (RFC 6856); parameters are ASCII but for USER, PASS and APOP (section 2.2). RFC 2449's text grammar admits no SP, so other text stays free text, as RFC 1939 has it.

Naming: the package is pop3, not the issue's pop: RFC 1939 and IANA's port 110 name it POP3, and POP2 (TCP 109) is another protocol.

Consts: Command from a DATA literal (RFC 1939 section 9, CAPA, and the commands IANA's POP3 Capabilities registry adds); ResponseCode crawled from IANA's POP3 Response Codes CSV.

Pins: TCP ports in test_dispatch_bindings_unit.py (110 only), the index-registry table, EXCLUDED_FROM_INTENUM_CENSUS and the cut-header OCTETS. The new tests fail on origin/develop.

- POP3 (RFC 1939, RFC 2449) at TCP port 110: a segment reads as a
  response (single-line, or a whole multi-line one), an AUTH server
  challenge (RFC 5034), a command, or the end of a multi-line response,
  through the shared line reader, and rebuilds byte for byte.
- A response code opening the text (RFC 2449 section 8) is decoded;
  text is UTF-8 (RFC 6856), parameters ASCII but for USER, PASS, APOP.
- pcapkit.const.pop3: Command from a DATA literal (RFC 1939 section 9,
  CAPA, and the commands IANA's POP3 Capabilities registry adds), and
  ResponseCode crawled from IANA's POP3 Response Codes registry.
- Registry entry, TCP dispatch family, docs pages and pins.
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Nov 29, 2026
@github-actions github-actions Bot added this to the PyPCAPKit v1.10 milestone Nov 29, 2026
@JarryShaw JarryShaw added feat Pull requests that add a new capability (feat: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Nov 29, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Good to go at f77b36b31, after a Sonnet cross-review plus my check of the one open point.

  • 40k mutated payloads all rebuilt byte-exact. The 255- and 512-octet limits and the RFC 2449 §8 response-code ABNF match the RFC text. IANA's POP3 response-code CSV is byte-identical to the crawled table.
  • Naming it pop3 with no family base is right: RFC 1939 and IANA's port 110 call it POP3, and POP2 is TCP 109.
  • make() ignores a raw_cmmd that disagrees with cmmd on purpose. SMTP and FTP pin the same rule (an edited command wins over stale casing), so this is not a defect.
  • With the venv first on PATH, all of tests/project passes, including the shipped-names test that covers the deleted NotImplemented/pop.py stub.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Nov 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 94.95% (unit tier, Python 3.15, f77b36b31, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 116 4 20 2 95.59%
pcapkit/const 22386 224 3186 191 98.28%
pcapkit/corekit 3160 83 1058 40 96.85%
pcapkit/dumpkit 423 3 148 5 98.60%
pcapkit/foundation 4341 24 1362 26 99.12%
pcapkit/interface 112 4 40 3 95.39%
pcapkit/protocols 28831 154 7622 128 99.22%
pcapkit/toolkit 1136 35 406 9 96.24%
pcapkit/utilities 638 7 176 5 98.53%
pcapkit/vendor 6575 2396 1478 258 60.24%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw
JarryShaw merged commit 8cffeba into develop Nov 29, 2026
77 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Nov 29, 2026
@JarryShaw
JarryShaw deleted the feat/2964-pop3 branch November 29, 2026 07:16
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat Pull requests that add a new capability (feat: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant