Created attachment 175324 [details]
Patch to mail/postfix/files/pkg-install.in adding the "-t 0" test to the ask() function
I'm having some trouble automating the deployment of Postfix on FreeBSD, and it comes down to the mailer.conf activation prompt in the pkg-install script. The behavior I want is for pkg-install to check whether standard input is open and connected to a terminal, a la the "-t 0" argument to /bin/test. If standard input is not connected to a terminal, then the "ask()" function in the script should return the default value. This makes it possible to install Postfix non-interactively. The attached patch implements this behavior, and I've tested both cases, when stdin is a terminal and when it is not.
Nice one. Thanks for sharing https://www.upsers.live/