oldford Posted September 29, 2006 Posted September 29, 2006 I recently needed to make a security change in WHM to not allows "nobody" to send emails from my server. However, now my store is not sending any email notifications. Is phpsuexec the solution to this? Or is there another solution? Thank you!
Brown Knight Posted September 30, 2006 Posted September 30, 2006 you can not do this on your site, as osC does send things as nobody. only way to do this, is if your site is the only site on the server. and other programs may fail too. until code changes are made (and lots of work to do this) not much you can do.
pyramids Posted September 30, 2006 Posted September 30, 2006 in includes/classes/mail.php This mod will add a Return_Path: to all emails being sent from the catalog server, for the admin you will need to update it's email.php find: if (EMAIL_TRANSPORT == 'smtp') { return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers)); } else { return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers)); } } change to $ReturnPath = '-f' . STORE_OWNER_EMAIL_ADDRESS; if (EMAIL_TRANSPORT == 'smtp') { return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers), $ReturnPath); } else { return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers), $ReturnPath); } } if this doesn't work then you may need to hard code it like... For an email address of admin @ mydomain.com it would be: ***Note no spaces between the '' $ReturnPath = '[email protected]';// hard coded if (EMAIL_TRANSPORT == 'smtp') { return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers), $ReturnPath); } else { return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers), $ReturnPath); } }
oldford Posted September 30, 2006 Author Posted September 30, 2006 Thank you pyramids. So the mod you suggested should work with phpsuexec installed? Also, I would need to change my OSC email setting to SMTP, correct? I had been using sendmail previous to this problem.
pyramids Posted September 30, 2006 Posted September 30, 2006 Thank you pyramids. So the mod you suggested should work with phpsuexec installed? Also, I would need to change my OSC email setting to SMTP, correct? I had been using sendmail previous to this problem. I don't know about if it will work with phpsuexec installed. You will need to research it more at http://forums.cpanel.net/index.php? You are aware if you install phpsuexec that you will need tweak the scripts - for ex: replace all .htaccess files with ini files. Meanwhile, what is it exactly you want to do by turning off "nobody" as an email user? (I would assume it was to stop spammers, if so there are other options, see the link in this post and do a search there on the forums)
oldford Posted October 2, 2006 Author Posted October 2, 2006 Luckily it turns out the problem is solved without needing to modify the code. My server management company made a change in phpsuexec and emails now work. You are aware if you install phpsuexec that you will need tweak the scripts - for ex: replace all .htaccess files with ini files.Yes, that was a bit of a pain, but overall not too bad. Meanwhile, what is it exactly you want to do by turning off "nobody" as an email user?(I would assume it was to stop spammers, if so there are other options, see the link in this post and do a search there on the forums) Yes, security from spam, and more importantly the ability to track down the script allowing the spam to be sent. I didn't spend hours at cpanel forums, but from what I did read most people are in favor of phpsuexec. If you could point me to some of those other options I'd appreciate it.
pyramids Posted October 2, 2006 Posted October 2, 2006 For more info - Try a search at http://forums.cpanel.net/index.php? search for: phpsuexec, nobody, spam or phpsuexec, spammers, email or phpsuexec, nobody, email
acb Posted October 3, 2006 Posted October 3, 2006 Does the solution above only work if you are using SMTP as the transport method? ACb
acb Posted October 3, 2006 Posted October 3, 2006 By the way, does this solution still work? (Post one on this thread: http://www.oscommerce.com/forums/index.php?showtopic=23392
Recommended Posts
Archived
This topic is now archived and is closed to further replies.