Recompile PHP after Sendmail reconfigured ?

Discussion in 'Installation/Configuration' started by Roman, Aug 26, 2005.

  1. Roman

    Roman New Member


    Initially couldn't send out mail through my website (php), because sendmail smtp settings default to Thought I fixed that and was confident that sendmail works fine. Now I can send emails out using Evolution, but still can't send out emails through my website.
    In I changed
    DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl
    and did m4 /etc/mail/ > /etc/ after that.
    Do I need to recompile PHP to make it work? If yes, are there any special things I need to add to --with options to make this work.

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Recompilation of PHP is not nescessary. Have you checked you php.ini for the correct mail settings?
  3. falko

    falko Super Moderator Howtoforge Staff

    Was sendmail installed when you compiled PHP? If not, PHP's mail() function doesn't work, and you have to re-compile PHP.
  4. Roman

    Roman New Member


    Thanks for the answer. As you remember a week or so ago I was struggling with PayFlow Pro and you've been a great help to fix it. Since I reconfigured and recompiled php so many times, I am not really sure if Sendmail was installed or not. Is it possible to see this in phpinfo.php?
    Can you please take a look at
    Hope I don't have some really weird stuff in there.


  5. falko

    falko Super Moderator Howtoforge Staff

    Looks ok. And it also shows the path to sendmail so I guess it had been installed when you compiled PHP. Your problem must be somewhere else... :confused:
  6. Roman

    Roman New Member


    Sendmail was initially installed as a part of FC4 installation where you only have to check "Mail server". Then I recompiled PHP, removed sendmail using yum(because wasn't working) and installed it back using yum.
    Is it possible that something was kept from initial install and is now kicking my ass?


  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats unlikely, but you can try to recompile php now with your working sendmail setup.

    Have you tried to set error reporting in PHP to E_ALL, did you get any
    PHP errors when you try to send mail? Are there any errors or messages
    in the mail log, when you try to send an email with PHP?
  8. Roman

    Roman New Member

    Now I am really confused. I went to /var/spool/mail/root and found ALL the emails. But all of them had this text::
    "The original message was received at Sun, 21 Aug 2005 18:54:11 -0500
    from localhost.localdomain []

    ----- The following addresses had permanent fatal errors -----
    <[email protected]>

    ----- Transcript of session follows -----
    <[email protected]>... Deferred: Connection timed out with
    Message could not be delivered for 5 days
    Message will be deleted from queue

    Content-Type: message/delivery-status

    Reporting-MTA: dns;
    Arrival-Date: Sun, 21 Aug 2005 18:54:11 -0500

    Final-Recipient: RFC822; [email protected]
    Action: failed
    Status: 4.4.7
    Remote-MTA: DNS;
    Last-Attempt-Date: Fri, 26 Aug 2005 20:26:03 -0500

    Content-Type: message/rfc822

    Return-Path: <[email protected]>
    Received: from (localhost.localdomain [])
    by (8.13.4/8.13.4) with ESMTP id j7LNsB88024885
    for <[email protected]>; Sun, 21 Aug 2005 18:54:11 -0500
    Received: (from nobody@localhost)
    by (8.13.4/8.13.4/Submit) id j7LNsBF0024884;
    Sun, 21 Aug 2005 18:54:11 -0500
    Date: Sun, 21 Aug 2005 18:54:11 -0500
    Message-Id: <[email protected]>
    To: [email protected]
    Subject: roman recommends this site
    MIME-Version: 1.0
    From: "[email protected]" <[email protected]>
    Content-type: text/plain; charset=iso-8859-1

    Your friend roman ([email protected]) has recommended this site to you. "

    Hope I understand this correctly. On my website I collect Name, fromEmail, toEmail and the message. When I click send email, which should be sent from "fromEmail" to "toEmail", all I get is a new entry in /var/spool/mail/root.
    I would appreciate your help.

  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, this is the spool directory of your MTA (sendmail) where PHP puts your email messages for delivery. This shows us that PHP is working correctly. The errors above show you that yahoo is not accepting the messages from your MTA. Maybe your server is on a DSL line with a dynamic IP? Many large email providers did not accept emails from dynamic IP's anymore.
  10. Roman

    Roman New Member

    I have a router sitting on a static IP ( and server connected to the router and assigned the In order to see my website inside the firewall (router) I have to type and not Linksys told me that this is OK, but I really think there must be a way to work around this. Our mail accounts are hosted outside our intranet with a web hosting company, which is also holding our DNS record.
    Is it possible that all the problems with sendmail are actually DNS problems and how can I test this?

    Appreciate you help !

  11. till

    till Super Moderator Staff Member ISPConfig Developer

    You can test if this are DNS or routing problems:

    Please try to connect to the yahoo mailserver via telnet on the shell of your server. Enter the command:

    telnet 25
    When you got an answer from the serve, you can close the connection by typing "quit".

    The testsession should look similar like this:

    # telnet 25
    Connected to
    Escape character is '^]'.
    220 ESMTP YSmtp service ready
    Connection closed by foreign host.
    If not, please post the output in the forum.
  12. Roman

    Roman New Member

    It only comes to:

    [root@www ~]# telnet 25

    and then stays there. On my router I have both ports 25 and 110 TCP enabled.
    I guess we are getting closer to the real problem.

  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Name resolution works on your server, beacuse it resolves to the correct IP

    Yes were getting closer :) It seems you have firewall or something like that in your router enabled, that blocks outbound connections (YourServer => Internet) on Port 25.
  14. Roman

    Roman New Member

    Since I don't have a DNS running on my machine, does it mean that yahoo gets resolved externally? If so, than it does go out through 25, right? Is it possible that some of the settings I made in Evolution have messed up the sendmail?


  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes. But in many cases you set the nmeserver simply to the IP of your router and the router (gateway) resolves the names for you.

    No, nameservice is port 53.

    No, your problems have nothing to do with sendmail. We tried to connect via telnet on port 25, telnet is independant from sendmail, and the connection was not possible. It is a problem with your router or another firewall or maybe your internet provider blocks connections on port 25 to other servers that the mailrelay of your provider.
  16. Roman

    Roman New Member

    Very impressive. I would have never expected my ISP provider to block traffic on port 25.
    As soon as I called them and they changed the setting, everything worked like a champ.

    Thank you very much

  17. falko

    falko Super Moderator Howtoforge Staff

    I have the same problem here in my Internetcafé that I have to use during my holidays. I hope some day an internet connection will be as common as a shower in an accommodation... :(

Share This Page