Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Serhii_Yaholnyt
Contributor

How to remove postfix warning?

We had to change our hostname in SMPT header, so we used sk101870. After installing policy when we are looking at postfix queue with command "[Expert@HostName:0]# /opt/postfix/usr/sbin/postqueue -c /opt/postfix/etc/postfix/ -p", we have a warning: "Jul  3 17:59:53 2018 TEST-HOST postfix/smtpd[6608]: warning: /opt/postfix/CTX/CTX00003/etc/postfix/main.cf, line 55: overriding earlier entry: myhostname=TEST-HOST". We can see multiple records "myhostname=..." in file /opt/postfix/CTX/CTX00003/etc/postfix/main.cf. If we would remove and leave only one, the problem is gone. But these records are recreated every time we install policy. Is there any way to remove them permanently or make that warning not appear?

0 Kudos
5 Replies
Serhii_Yaholnyt
Contributor

I know that we can redirect STDERR to /dev/null but I am looking for possibility to remove it permanently.

0 Kudos
PhoneBoy
Admin
Admin

Is it the same entry multiple times in the file?

That sounds like a bug and I would recommend consulting with the TAC: Contact Support | Check Point Software 

0 Kudos
Danny
Champion Champion
Champion

/opt/postfix/usr/sbin/postqueue -c /opt/postfix/etc/postfix/ -p 2>/dev/null‍
0 Kudos
lbcadenco10
Contributor

Did you ever find a solution? I'm seeing a similar error below, however, the config_directory line only appears once in main.cf

 

warning: /opt/postfix/etc/postfix//main.cf, line 679: overriding earlier entry: config_directory=/opt/postfix/etc/postfix/

 

[Expert@FW:0]# cat -n /opt/postfix/etc/postfix/main.cf | grep config_directory
280 #mynetworks = $config_directory/mynetworks
623 # >$config_directory/$process_name.$process_id.log & sleep 5
679 config_directory = /opt/postfix/etc/postfix

0 Kudos
Steve_Spohn
Participant

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.

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events