Plesk: /etc/init.d/qmail: line 25: [: =: unary operator expected

Re: qmail restart error, plesk qmail error,  [: =: unary operator expected

You have installed Plesk, updated all your modules, upgrade PHP, mysql, everything looks great. Then, you realise that you have Plesk with the Postfix MTA but you want Qmail MTA – so you go ahead and select Qmail MTA in the Plesk Upgrade Manager.

Install is fine, until you try to start qmail.

[root@server ~]# service qmail restart
/etc/init.d/qmail: line 25: [: =: unary operator expected

Before you panic, check this file:

# cat /etc/sysconfig/network
HOSTNAME=server.yourhostname.com
NETWORKING=yes

If you are missing the NETWORKING line, simply insert it.

# [root@server ~]# service qmail start
Starting qmail:                                            [  OK  ]

Your qmail service is now functioning as required. Panic over 🙂