opnsense / opnsense/plugins

service postfix restart can't handle postmap executable

Open Beginner friendly
#5,570 0 comments 0 reactions 0 assignees View on GitHub

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:

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:

  1. Install postfix plugin in stable OPNsense
  2. configure it. (I used a smarthost setup)
  3. try sending mails: works
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.