sockstat
The FreeBSD tool that answers "which process is listening on port 25?" without detours.
It lists open sockets along with user, command, process ID and addresses. sockstat -4l shows everything listening on IPv4; sockstat -j web narrows it to a single jail. Where netstat describes the state of the network stack, sockstat starts from the processes, which is usually what you actually wanted to know.
The tool arrived in FreeBSD in the early 2000s as a Perl script and was later rewritten in C so it would work on systems without Perl. Linux got an equivalent overview with ss and lsof, and anyone who switches between the two types the wrong command at least once a day.