Apache/PHP sendmail configuration

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Benjamin

    Apache/PHP sendmail configuration

    Hi

    I have a standalone machine running Mandrake 10 with apache server and
    PHP installed.

    The PHP mail() function is working but very slowly. It takes about
    10-20 seconds to send a single email. Can anyone advise me on what
    could be causing this? I have tried using mail() on other apache
    setups and the response time has been much faster.

    Below is the relevant section from my php.ini:

    TIA

    Andrew

    php.ini
    =======
    [mail function]
    ; For Win32 only.
    SMTP = localhost

    ; For Win32 only.
    sendmail_from = me@localhost.co m

    ; For Unix only. You may supply arguments as well (default: "sendmail
    -t -i").
    ;sendmail_path =
  • Ruben van Engelenburg

    #2
    Re: Apache/PHP sendmail configuration

    Andrew Benjamin wrote:
    [color=blue]
    > Hi
    >
    > I have a standalone machine running Mandrake 10 with apache server and
    > PHP installed.
    >
    > The PHP mail() function is working but very slowly. It takes about
    > 10-20 seconds to send a single email. Can anyone advise me on what
    > could be causing this? I have tried using mail() on other apache
    > setups and the response time has been much faster.[/color]

    Andres,

    It sounds like a DNS problem to me. It seems like sendmail is trying to
    resolve your client computer's ip.
    You could solve this by adding it to /etc/hosts on the server or hacking
    the sendmail configuration.

    Regards,
    Ruben.

    Comment

    • Manuel Lemos

      #3
      Re: Apache/PHP sendmail configuration

      Hello,

      On 07/12/2004 07:12 AM, Andrew Benjamin wrote:[color=blue]
      > I have a standalone machine running Mandrake 10 with apache server and
      > PHP installed.
      >
      > The PHP mail() function is working but very slowly. It takes about
      > 10-20 seconds to send a single email. Can anyone advise me on what
      > could be causing this? I have tried using mail() on other apache
      > setups and the response time has been much faster.[/color]

      How slowly? Does it wait like 1 minute before delivering?

      Or it waits some time but less than 1 minute?

      If it waits one minute, that is likely a missing reverse DNS register
      for your IP.

      If it is not that much, it may be because sendmail by default attempts
      to deliver messages immediately and depending on your destination it may
      take a while to have your message accepted.

      In this case the solution is to use the appropriate message delivery
      mode, which is certainly not the immediate/interactive mode. Take a look
      at this class that comes with a sub-class specialized in deliverying via
      sendmail. It lets you configure the sendmail delivery mode before
      sending. Take a look at the documentation of the class for mode details.




      --

      Regards,
      Manuel Lemos

      PHP Classes - Free ready to use OOP components written in PHP
      Free PHP Classes and Objects 2026 Versions with PHP Example Scripts, PHP Tutorials, Download PHP Scripts, PHP articles, Remote PHP Jobs, Hire PHP Developers, PHP Book Reviews, PHP Language OOP Materials


      PHP Reviews - Reviews of PHP books and other products


      Metastorage - Data object relational mapping layer generator

      Comment

      • Andrew Benjamin

        #4
        Re: Apache/PHP sendmail configuration

        Manuel,

        It waits about 1 minute. I think it is a DNS problem.

        I've added the following line to my /etc/hosts:
        "127.0.0.1 localhost.co.uk "
        But this hasn't made a difference.

        Is there a HOW-TO setup apache and sendmail for a standalone machine?

        Thanks

        Andrew

        Manuel Lemos <mlemos@acm.org > wrote in message news:<40F3114E. 6000405@acm.org >...[color=blue]
        > Hello,
        >
        > On 07/12/2004 07:12 AM, Andrew Benjamin wrote:[color=green]
        > > I have a standalone machine running Mandrake 10 with apache server and
        > > PHP installed.
        > >
        > > The PHP mail() function is working but very slowly. It takes about
        > > 10-20 seconds to send a single email. Can anyone advise me on what
        > > could be causing this? I have tried using mail() on other apache
        > > setups and the response time has been much faster.[/color]
        >
        > How slowly? Does it wait like 1 minute before delivering?
        >
        > Or it waits some time but less than 1 minute?
        >
        > If it waits one minute, that is likely a missing reverse DNS register
        > for your IP.
        >
        > If it is not that much, it may be because sendmail by default attempts
        > to deliver messages immediately and depending on your destination it may
        > take a while to have your message accepted.
        >
        > In this case the solution is to use the appropriate message delivery
        > mode, which is certainly not the immediate/interactive mode. Take a look
        > at this class that comes with a sub-class specialized in deliverying via
        > sendmail. It lets you configure the sendmail delivery mode before
        > sending. Take a look at the documentation of the class for mode details.
        >
        > http://www.phpclasses.org/mimemessage
        >
        >
        > --
        >
        > Regards,
        > Manuel Lemos
        >
        > PHP Classes - Free ready to use OOP components written in PHP
        > http://www.phpclasses.org/
        >
        > PHP Reviews - Reviews of PHP books and other products
        > http://www.phpclasses.org/reviews/
        >
        > Metastorage - Data object relational mapping layer generator
        > http://www.meta-language.net/metastorage.html[/color]

        Comment

        Working...