Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm not exactly 'new' to Linux but here's where I'm at. I recently upgraded the server in my house to Centos 6.3, 64bit (from Windoze) and it's taken a bit of getting used to. Basically the machine is used for a handful of purposes, including storing backups for all of my machines but more importantly it serves up my website. I'm using Apache 2.2 and PHP 5.3 (same setup I had on windows). I use a php script "FormToEmail" so users can submit requests via my website and they are sent to my gmail account (main email for that specific purpose). On the previous windows install, I used a simple program called Free SMTP Server. My question is, what is the easiest way for me to setup an outgoing only mail server just to handle the php script and deliver messages input into the html form. I've read some on ssmtp but can't seem to get it working. Suggestions anyone? I'd like to keep it as simple as possible as all it has to accomplish is to send the form information (which is gathered by the php script) to a single address, which is the same every single time.
Last edited by ostrosky.jeremiah; 03-08-2013 at 10:44 PM.
I've installed Postfix and configured it using this tutorial: http://www.unixmen.com/activate-and-...ntos-and-rhel/ and can successfully send emails from the command line using something like this: echo "test email" | mail myemailaddress@gmail.com I've also set (in the php.ini file) sendmail=/usr/sbin/sendmail -t -i and 'sendmail' is a symlink that points to /usr/sbin/sendmail.postfix, yet it appears the emails are still not being delivered via the web form. Again, they are successfully delivered when testing via the command line, but not when sent through the web form. Here is a link to the php FormToEmail that I'm using (and I've used before on other sites, hosted elsewhere).
http://formtoemail.com/FormToEmail.txt (text file of the actual code, I'm using it as-is, but of course with my email address, etc inserted (same php file I used when hosting the site on windows machine, so I know it's not faulty)
AWESOME. I figured it out with some help from our good friend Google, and a lot of reading. Turns out (as I'm very new to using SELINUX) that is was actually selinux preventing apache from sending the emails. I simply set 'setsebool -P httpd_can_sendmail 1' and VOILA! All is well and I'm now receiving emails from the web form. Can't believe it took me so long to realize the issue but like I said, this is the first distro I've used that uses selinux so... lesson learned, and mental note taken
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.