service postfix restart can't handle postmap executable
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 863
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 10
Description
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- The title contains the plugin to which this issue belongs
Describe the bug
Running service postfix restart as root leads to following error on shell
/usr/local/opnsense/scripts/OPNsense/Postfix/setup.sh: postmap: not found
/usr/local/opnsense/scripts/OPNsense/Postfix/setup.sh: postmap: not found
/usr/local/opnsense/scripts/OPNsense/Postfix/setup.sh: postmap: not found
/usr/local/opnsense/scripts/OPNsense/Postfix/setup.sh: postmap: not found
/usr/local/opnsense/scripts/OPNsense/Postfix/setup.sh: postmap: not found
/usr/local/opnsense/scripts/OPNsense/Postfix/setup.sh: postmap: not found
/usr/local/opnsense/scripts/OPNsense/Postfix/setup.sh: postmap: not found
/usr/local/opnsense/scripts/OPNsense/Postfix/setup.sh: postmap: not found
Updating aliases
Certificates generated /usr/local/etc/postfix/cert_opn.pem
Certificates generated /usr/local/etc/postfix/ca_opn.pem
postfix: Postfix is using backwards-compatible default settings
postfix: See https://www.postfix.org/COMPATIBILITY_README.html for details
postfix: To disable backwards compatibility use "postconf compatibility_level=3.11" and "postfix reload"
postfix/postfix-script: stopping the Postfix mail system
postfix: Postfix is using backwards-compatible default settings
postfix: See https://www.postfix.org/COMPATIBILITY_README.html for details
postfix: To disable backwards compatibility use "postconf compatibility_level=3.11" and "postfix reload"
/usr/local/sbin/postconf: warning: /usr/local/etc/postfix/main.cf: support for parameter "smtpd_tls_dh1024_param_file" will be removed; instead, do not specify (leave at default)
/usr/local/sbin/postconf: warning: See https://www.postfix.org/DEPRECATION_README.html for details
/usr/local/sbin/postconf: warning: /usr/local/etc/postfix/main.cf: support for parameter "smtpd_tls_dh1024_param_file" will be removed; instead, do not specify (leave at default)
/usr/local/sbin/postconf: warning: See https://www.postfix.org/DEPRECATION_README.html for details
postfix/postfix-script: starting the Postfix mail system
To Reproduce
Steps to reproduce the behavior:
- Install postfix plugin in stable OPNsense
- configure it. (I used a smarthost setup)
- try sending mails: works
- if you restart the service on cli the reported output is shown
info: the $PATH variable shows following content: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
Also a test running the script with custom env does not change anything: env PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin service postfix restart
However, mails are sent via postfix.
Expected behavior
I assume that a standard service restart doesn't typically result in certain binaries not being found, like Postmap in this case.
Environment
26.7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with /usr/local/opnsense/scripts/OPNsense/Postfix/setup.sh and inspect how it invokes postmap during a service restart. Reproduce the issue with service postfix restart in the described OPNsense 26.7 environment, then verify that the restart completes without repeated “postmap: not found” errors and that mail delivery still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100