Contact Forms slow - not php mail issue
I've got a problem with the Contact Forms module - it is very slow (Taking 25s or more to complete) - I first figured it might be a DNS or mail server problem - so I checked DNS - no problems resolving, I checked the php mail function itself through the server - no problem, less than 1 second to execute.
Anybody have any idea what this module does behind the scenes besides send an email? It seems to take a very very long time.
I _know_ it's not mail configuration. Here's my php.ini snippet for sendmail_path:
sendmail_path = /usr/sbin/sendmail -t -i -odbthe -odb sets the deliverymode to asynchronous - so it returns very fast from the function.
Here's an example of me sending an email outside of drupal contact forms:
php -e mailtest.php
1253639930
1253639930As you can see, it takes less than 1s to execute and return.
The code looks like such:
<?php
print time() . "\n";
mail('mail@mail.here',"Subject: dur",'dur',"From: mail@mail.here", "-fmail@mail.here" )
or die('FAILED');
print time() . "\n";
?>So - I have pretty much proved it is NOT the mail function the module calls itself... any ideas?

Still not sure why this
Still not sure why this happens yet - it seems to take the bulk of the time processing things before attempting to mail
In this instance, increasing
In this instance, increasing the php memory limit fixed this issue. I went as far as installing the apd pear module and profiling.