My Linux operating system is Ubuntu 10.10. I have a website with an online store developed in PHP ready to go into Production with the exception of being able to automatically send an email with the details of the order to the customer. The default and recommended send mail program for Ubuntu 10.10 is Postfix. According to the Postfix online manual, when Postfix is installed, it should work without changing any of the configuration files. But it hasn't worked even once for me, not even after uninstalling it, and re-installing it. I used the command 'sudo apt-get install postfix' in the Terminal window to install it initially, and that is a standard and correct syntax for Ubuntu 10.10. There was a display on the screen saying that Postfix was successfully installed. Also I successfully installed Apache2 successfully, and is working quite well for my test website. I have uninstalled postfix and re-installed it via the Synaptic Package Manager (SPM). I get the same result. The output in the /var/log/apache2/error.log file is 'sh: usr/sbin/postfix: not found'. To see what output I would get when I uninstalled Postfix, the output was the same. So, I am thinking that Postfix isn't working at all, even when it is properly and successfully installed.
The only other possible cause of this problem that I can think of is if some of the configuration values in etc/postfix/main.cf may need to be changed. I have searched the Internet extensively for help with this problem. Also I have spent about $50 on two books that have only a few pages each on Postfix, and they have not been any help. I simply can't seem to find enough information to help me resolve this problem.
Another possible factor of this problem is that I am not trying to set up a full-fledged server environment, such as example.com; my host provider will furnish the server. I am using 'localhost' as a test environment, and I have some confusion about how I need to use that in the Postfix configuration file. When initially installing Postfix, it asked for the domain name and hostname. Upon subsequent re-installations of Postfix, those values were not requested again, so I assume they remained the same. I think the domain name defaulted to '127.0.0.1', and I left it that way. The hostname originally defaulted to 'user-System-Product-Name', but I changed it to 'PC1HostName' for brevity, and to have a more meaningful name. If you know how to make Postfix work, I would immensely appreciate your help. I have copied and pasted the /etc/postfix/main.cf below since that is a very important file for Postfix.
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
That sounds wrong to me. i would expect something like:
/usr/sbin/postfix not found
That leading slash is important.
Once you have installed Postfix, first find the location of the postfix executable (it will be in /usr/bin, /usr/sbin, /usr/local/bin, or /usr/local/sbin). Then you need to find the configuration file in your application that defines where postfix is to be found and make sure that it is set up for the correct location.
As the program is not even finding the postfix executable the error is nothing to do with the postfix configuration file.
I'm with Ijack, leading slash is important and you really, really should test bits-n-pieces to make sure that the components of the system are working as expected (e.g. after installation, use the sendmail that's installed with postfix to send a test email to yourself. As a bonus, it gives you some experience such that when you want to write that script that will email you when something or other occurs (e.g. a script that will email you when a website changes) you'll already have gone through the steps that you'll need for the script)