Came across this post after I had a similar issue tonight. I found that CP documentation often leaves the trailing slash in the -c switch of the postqueue command, like this:
/opt/postfix/usr/sbin/postqueue -c /opt/postfix/etc/postfix/ -p
However, by default, the config_directory parameter in the postfix config file omits that trailing slash:
config_directory = /opt/postfix/etc/postfix
I think the warning is pointing out the mismatch between what's in the command (a slash) and the config file itself (no slash). I've found that if I run the postqueue command without the trailing slash, I don't get the warning in my output, which makes it much easier to parse out single values. This came in very handy when trying to tweak the suggested script in the Threat Emulation ATRG for monitoring the MTA queue:
#!/bin/bash
# Extract Postfix queue size value
MAILQ=$(/opt/postfix/usr/sbin/postqueue -c /opt/postfix/etc/postfix/ -p | egrep '^--.*Request|^Mail.*empty')
if [[ $MAILQ =~ "empty" ]] ; then
RESPONSE=0
echo $RESPONSE
elif [[ $MAILQ =~ "Request" ]] ; then
RESPONSE=$(echo $MAILQ|awk '{print $5}')
echo $RESPONSE
else
RESPONSE=error
fi
With the trailing slash left in the script, I would get that warning, which would introduce additional output. Taking out the trailing switch left me with just the number I wanted.