Skip to content

Conversation

@andy-bower
Copy link

Hi,

I promise I don't have a backlog of other PRs planned... I have been contributing to a refresh of the Debian package and this is the other change I would be interested in getting in if there were another release!

This PR takes the v0.5.1 IPv6 support patch by Jun-ichiro itojun Hagino from the popa3d download page, fixes it up for the latest codebase and adds the following:

  1. Updates the man page.
  2. Uses a dual-stack socket if -46 is specified.
  3. Lets the OS choose if neither is specified. The only consideration here is if some OSs (not Linux) don't either offer an IPv4 socket first from getaddrinfo() or default to IPV6_V6ONLY off. Happy to rework the PR without this behaviour if preferred.

I take no offence if you decide not to include this patch in a prospective upstream release and you are welcome just to put a squashed version of the patch in the contrib section if you like (happy to prepare such a patch by e-mail).

Thanks!

Andrew

@solardiz
Copy link
Member

Thanks. I haven't looked at this closely yet, but some initial thoughts:

  1. We shouldn't have a "Merge branch 'ipv6' into main" commit - instead have the merged commit appear in here directly.
  2. I'd also check latest popa3d code in OpenBSD as of just before popa3d was dropped from there for any related fixes.
  3. Are you actually testing the IPv6 support?

@andy-bower
Copy link
Author

Thanks. I haven't looked at this closely yet, but some initial thoughts:

1. We shouldn't have a "Merge branch 'ipv6' into main" commit - instead have the merged commit appear in here directly.

I applied the original commit against the version it was written for but yes this type of work doesn't translate well to a PR. We could coordinate on that or I could redo as a rebased version of the original commit with the conflict resolution squashed into it!

2. I'd also check latest popa3d code in OpenBSD as of just before popa3d was dropped from there for any related fixes.

Oh did they Have IPv6 support included? Sounds like a good idea!

3. Are you actually testing the IPv6 support?

Yes, I tested all modes!

@andy-bower
Copy link
Author

andy-bower commented Aug 21, 2025

If you look at https://github.com/openwall/popa3d/network you can see the merge graph!

Actually that doesn't look right, will check later.

@andy-bower andy-bower force-pushed the ipv6-patch-enhanced branch from 7e55d2f to 10b30d9 Compare August 21, 2025 22:45
@andy-bower
Copy link
Author

Hi, on a proper computer again. Previous graph looks as it was meant to (apply original patch on intended base version then merge forward to current) to me but I've rebased the original patch onto main now so the delta from the original patch is now squashed into the original patch to get you a linear history!

Here's an example transcript for popa3d -D46:

$ fetchmail -vvv -N --bsmtp -
Old UID list from localhost:
 <empty>

Scratch list of UIDs:
 <empty>

Enter password for ajb85@localhost: 
fetchmail: 6.4.39 querying localhost (protocol POP3) at Thu 21 Aug 2025 23:51:06 BST: poll started
Trying to connect to ::1/110...connected.
fetchmail: POP3< +OK
fetchmail: POP3> CAPA
fetchmail: POP3< -ERR
fetchmail: Repoll immediately on ajb85@localhost
Trying to connect to ::1/110...connected.
fetchmail: POP3< +OK
fetchmail: POP3> USER ajb85
fetchmail: POP3< +OK
fetchmail: POP3> PASS *
fetchmail: POP3< +OK
fetchmail: selecting or re-polling default folder
fetchmail: POP3> STAT
fetchmail: POP3< +OK 2 1306
fetchmail: POP3> LAST
fetchmail: POP3< +OK 0
2 messages for ajb85 at localhost (1306 octets).
fetchmail: POP3> LIST 1
fetchmail: POP3< +OK 1 596
fetchmail: POP3> RETR 1
fetchmail: POP3< +OK
reading message ajb85@localhost:1 of 2 (596 octets) About to rewrite Return-path: <[email protected]>...
...rewritten version//// is Return-path: <[email protected]>.

I'm afraid I don't see the IPv6 support in the OpenBSD patches although I do see it in their man pages, so I must be looking in the wrong place!

I am pretty confident with my update of the patch for Linux (IPv6 used to be an obsession of mine...) but it is other OS compatibility that is the risk area, I agree.

@solardiz
Copy link
Member

I'm afraid I don't see the IPv6 support in the OpenBSD patches although I do see it in their man pages, so I must be looking in the wrong place!

You're looking at ports, but popa3d was for some years in OpenBSD base system. They dropped it from there as part of removal of services that accept plaintext communication and especially passwords. Maybe I could have avoided that by introducing built-in TLS support in time, or maybe not.

I am pretty confident with my update of the patch for Linux (IPv6 used to be an obsession of mine...) but it is other OS compatibility that is the risk area, I agree.

I meant not so much compatibility, but just general improvements, bug fixes, and cleanups, since itojun was contributing to OpenBSD.

@andy-bower andy-bower marked this pull request as draft August 23, 2025 09:18
@andy-bower
Copy link
Author

Converted to draft: I don't think this is ready; I don't like the change to tracking sessions by textual version of remote address, generously fitted into 500 * NI_MAXHOST (1025) bytes. I'll rework and probably squash the result, or rewrite. USP of this server is minimalism so better keep to that!

@andy-bower andy-bower marked this pull request as ready for review August 24, 2025 15:43
@andy-bower
Copy link
Author

I meant not so much compatibility, but just general improvements, bug fixes, and cleanups, since itojun was contributing to OpenBSD.

For easy future reference for me or anyone else, here's a link to the old OpenBSD code. It doesn't look like it got synced to 'upstream' since 0.6.2.

FYI The Debian package has now been refreshed.

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