Hi Guys. I am on version 2.2.18 My setup is that web services are on ISP box and email services are hosted on other system. Both systems manages separately. I have not done anuthing with DNS services as DNS records are not managed on ISP box. When setting up domains on ISP I have always selected that email server is "External". As it happens, i am trying to implement script that will send email to aa email address whose WWW is hosted on ISP box. Script is xecuted but email end up being looped localy instead send to a valid mx record. Script is succesful sending emails to domains that are not hosted on ISP bix. I would be gratefull if someone would point me it to the right direction to resolve this issue. Thanks.
It is php mail function: mail( "To", "Subject", $message, "From: $email" ); SMTP part of php.ini is not changed. it is how ISPconfig has set it up.
do you use the mail server at the isp box at all or do you only use the external email server for several sites? smtp-configuration of php doesn't matter. it's for windows only. php's mail() will use sendmail which maybe has to be configured to run correctly with your system. if you don't use the mail server at the isp box at all, you could define a so-called "smart_host" in sendmail. so, is the external mail server for all domains and sites connected to the isp box?
Email server on ISP box is not used for domains. External email server is used for all sites. However, I see that root account does receive emails like notifications, and also faled delivery emails reports, as there are attemts to deliver email to that box even if mx records for domains are someplaceelse. trough command line, nslookup command does resolve things properly. nslookup -type=mx example.tld shows proper DNS servers, easydns.com in this case and resolves mx record to mail.domain.tld, and list proper public IP for the mail.example.tld I have also noticed another thing. I use webmin to do menagement. Without any configuration of it's modules, it shows that both Sendmail and Postfix are runnning. OS is CentOS. Sendmail is there by default. Postfix i sadded as part of ISPconfig. ISPConfig is installed as per instructiions, no customization of anu kind. I do not care which of those two is used to manage SMTP traffic. I would like that email destined for domains, whose web presentations are on ISP box, is delivered to real, external mail server, first one listed in MX record list. For now, that email ends up in root accout of ISP box as not deliverable note, as mailbox does not exist.
I do not think that modifying SMTP line php.ini on system level will do good, as that might be used for ISP config to deliver local emails. But, problem might be solved if I would configure example.tld with such settings. So the question is, where and how do I make a change, to overwrite system wide SMTP line in php.ini, and to apply smart host for SMTP only for example.tld? Can it be done trough Apache Directives? As ISP admin, as directives are not available for domain admin?
From http://docs.ispconfig.org/en-sandbox-dynamic-site/?page=faq Is it possible to have a php.ini per website? You can do this with SuPHP. Install SuPHP on your server, then enable it in ISPConfig in the config.inc.php file and then you can add a directive for a custom php.ini file in the apache directives field of the website in ISPConfig. This sound OK. Brings up some questions though. 1. Does installing SuPHP create some security risks? Should it not be a part of ISPconfig setup as it looks like importan functionality? 2. Is enabling it in config.inc.php just comment/uncomment action? 3. What is the syntax for directive? It shoud say that php mail scripts, for example.tld, should use smarthost from my provider, smtp,myprovider.tld.
if you don't use the email server of the isp box at all, use the "smart_host" option of sendmail. you'll need to install the sendmail-cf package and create a config file if there's none yet, adding: Code: dnl define('SMART_HOST', 'your.mail.server') so sendmail will put the mails there. and because php uses sendmail as default in all linux systems, and NOT smtp, everything will be fine. there are some tutorials how to do it, maybe http://www.howtoforge.com/configuring-sendmail-to-act-as-a-smarthost-and-to-rewrite-from-address will help you or another one. google will help you.