2

I have a simple Wordpress site with the Contact Form 7 plugin. When submitting a form via the site it can takes in excess of 30 seconds to process.

Contact 7 uses Sendmail to deliver the emails (to an external address). Form submission never fails (but is very slow), the rest of the site is fine speed-wise.

Is there a way to profile Sendmail to find out what is taking so long?

The address it its sending to is a Google Mail account and always gets through.

Richard Stelling
  • 1,467
  • 2
  • 19
  • 25
  • First question is - are you 100% sure that it's sendmail that's being slow? Can/have you perform some debugging on the plugin script to see that it's not hanging on a DB reference or something? – Mark Henderson Aug 24 '09 at 21:27

3 Answers3

2

Please see this answer, it was a FQDN problem.

Richard Stelling
  • 1,467
  • 2
  • 19
  • 25
1

if you can watch the mail logs in real time, you will see the time between the mail gets into queue and it is actually sent and be sure it is a MTA problem or not

quaie
  • 1,124
  • 6
  • 13
0

I have had this problem. It was taking 5 minutes to send a e-mail (timeout limit). I changed the name of the machine from "new-host" to his real dns name. Then it tooks only 90 seconds to send the e-mail. After that, I add to the /etc/resolv.conf (line "nameserver xx:xx:xx:xx:xx:xx", in place of xx... put the IPv6 IP from your DNS). Then the e-mail was sent in 3 seconds. A curious fact is: if I send a mail using sendmail from command line, the e-mail is sent quickly always. But from phpmail, the problem appear.

For more debug info (change timeout, etc), see the /opt/lampp/apps/wordpress/htdocs/wp-includes/class-phpmailer.php

Alan
  • 9
  • 1