<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Michael!</p>
    <p>thank you for your reply.</p>
    <p>The issue seems to be network related, expecially bandwith
      related.</p>
    <p>I have modified the /usr/sausalito/sbin/phpsendmail to fork and
      not to wait the email being sent...</p>
    <p>Here it is:<br>
    </p>
    <p>my $pid = fork();<br>
      if (defined $pid && $pid == 0) {<br>
          # child<br>
      <br>
          # Log the activity into /var/log/maillog with all the info we
      have gathered:<br>
          system("/usr/bin/logger -p mail.info sendmail-wrapper-php:
      site=$HTTP_HOST, client=$REMOTE_ADDR, script=$PWD$SCRIPT_NAME,
      uid=$UID, user=$OWNER");<br>
      <br>
          # Actually send the email by passing it to Sendmail:<br>
          system("/usr/sbin/sendmail -t -i $options");<br>
          exit 0;<br>
      }<br>
    </p>
    <p>Regards</p>
    <pre class="moz-signature" cols="72">Simone Capra

Problemi con le configurazioni di posta elettronica?

<a class="moz-txt-link-freetext" href="http://assistenza.erweb.it/">http://assistenza.erweb.it/</a>
<a class="moz-txt-link-freetext" href="http://www.dnsqueries.com">http://www.dnsqueries.com</a>
</pre>
    <div class="moz-cite-prefix">Il 26/04/2016 19.50, Michael Stauber ha
      scritto:<br>
    </div>
    <blockquote cite="mid:571FAA6D.9080909@blueonyx.it" type="cite">
      <pre wrap="">Hi Simone,

</pre>
      <blockquote type="cite">
        <pre wrap="">i am experiencing a problem with all my boxes. When a php script calls
the mail() function, it actually takes more than 30 seconds to send out
the email (and the page loading waits that time).

i have measured it with this script
<?php

echo ini_get('sendmail_path').'<br />'.PHP_EOL;
echo date('H:i:s').'<br />'.PHP_EOL;
mail('<a class="moz-txt-link-abbreviated" href="mailto:capra@erweb.it">capra@erweb.it</a>','Hi','How are you?');
echo date('H:i:s').'<br />'.PHP_EOL;
</pre>
      </blockquote>
      <pre wrap="">
Could you please try out this command?

time /usr/sbin/sendmail <a class="moz-txt-link-abbreviated" href="mailto:capra@erweb.it">capra@erweb.it</a> </root/.bashrc

That will send the file /root/.bashrc to your own email address and
shows you how long it took to complete that command. The response would
be something like this:

real    0m0.731s
user    0m0.023s
sys     0m0.016s

See if that's considerably slower, faster or similar to what you see
when you email from PHP.

If it's equally slow, then the slowdown affects all email related
transactions. Which would point to a general problem. Such as your
/etc/resolv.conf containing DNS name servers that no longer work. Email
depends heavily on DNS and that could cause this problem.

</pre>
    </blockquote>
    <br>
  </body>
</html>