What if email server is someplace else?

Discussion in 'Installation/Configuration' started by bg011ca, May 16, 2008.

  1. bg011ca

    bg011ca New Member

    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.

    Last edited: May 16, 2008
  2. flipkick

    flipkick ISPConfig Developer ISPConfig Developer

    which method uses the script to send an email? is it a php-email script using sendmail?
  3. bg011ca

    bg011ca New Member

    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.
  4. flipkick

    flipkick ISPConfig Developer ISPConfig Developer

    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?
    Last edited: May 17, 2008
  5. bg011ca

    bg011ca New Member

    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.
  6. bg011ca

    bg011ca New Member

    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?
  7. bg011ca

    bg011ca New Member

    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.
  8. flipkick

    flipkick ISPConfig Developer ISPConfig Developer

    :confused: i repeat myself:

  9. flipkick

    flipkick ISPConfig Developer ISPConfig Developer

    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:

    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.
    Last edited: May 17, 2008

Share This Page