roehling / postsrsd

Postfix Sender Rewriting Scheme daemon
324 stars 39 forks source link

2.x supports CLI args but dropped `-h` #142

Closed polarathene closed 1 year ago

polarathene commented 1 year ago

I understand that with 2.x the intent is to focus on config via an actual configuration file, but I found it a little odd that -v worked at reporting the version (which it should), but -h was no longer available to communicate anything such as the CLI flags still supported:

https://github.com/roehling/postsrsd/blob/bca3ec80698341a61ee0d0145c8d7be586a18bb8/src/config.c#L145-L173

v1.x `postsrsd -h` (no longer valid in 2.x) ``` Sender Rewriting Scheme implementation for Postfix. Implements two TCP lookup tables to rewrite mail addresses as needed. The forward SRS is for sender envelope addresses to prevent SPF-related bounces. The reverse SRS is for recipient envelope addresses so that bounced mails can be routed back to their original sender. Usage: postsrsd -s -d [other options] Options: -s read secrets from file (required) -d set domain name for rewrite (required) -a set first separator character which can be one of: -=+ (default: =) -n length of hash to be used in rewritten addresses (default: 4) -N minimum length of hash to accept for validation (default: 4) -l set socket listen address (default: 127.0.0.1) -f set port for the forward SRS lookup (default: 10001) -r set port for the reverse SRS lookup (default: 10002) -p write process ID to pidfile (default: none) -c chroot to (default: none) -u switch user id after port bind (default: none) -t timeout for idle client connections (default: 1800) -X exclude additional domain from address rewriting -A always rewrite addresses -e attempt to read above parameters from environment -D fork into background -4 force IPv4 socket (default: any) -6 force IPv6 socket (default: any) -h show this help -v show version ```

I understand if you'd rather not support -h.

I was only looking into this due to noticing when run in a Debian container the upstart script run in /etc/init.d/postsrsd was not compatible with our process supervisor (supervisord) which requires keeping the command running in the foreground (so we either use a wrapper script as a workaround, or call postsrsd directly).

I noticed the 2.x release and changes that'd entail, specifically that it dropped the Upstart service support so when 2.x eventually arrives in Debian that's probably going to require us to run postsrsd directly anyway :+1: (since systemd doesn't seem to play too well when run within a Docker container)

roehling commented 1 year ago

Dropping -h was not a deliberate decision, I postponed it during the initial 2.x development because I was still unsure which options are required and useful, and then forgot about it before the release.