Postfixadmin errors executing /usr/local/bin/postfixadmin-*

If you have followed the tutorials on howtoforge to install Postfixadmin and Postfix + CourierIMAP + Maildrop on a CentOS server for virtual domains you may have stumbled upon this problem when trying to add a new mailbox for a virtual domain:

[DATE] [error] [client XX.XX.XX.XX] Running sudo -u vmail /usr/local/bin/ 'user@domain.tld' 'domain.tld' 'domain.tld/user/' '0' yielded return value=1, first line of output=, referer: http://server/postfixadmin/create-mailbox.php?domain=domain.tld

Above this error message you may or you may have not noticed(like I did) this error message:

sudo: sorry, you must have a tty to run sudo

The solution is simple, just run visudo and comment the line containing:

Defaults    requiretty

Hope it will help someone!

Your email address will not be published. Required fields are marked *