(I'm a newbie here, so apologies if I'm teaching you all to suck eggs, but I didn't find this problem documented here).
In the past few months I've developed a couple of small applications using DokuWiki (in one case integrating with Nagios, one with a proprietary information system). I love the flexibility and modularity of it.
Unfortunately one of these applications (they run on different servers) was taking a very long time to save changes, 30 - 45 seconds at a time. I have now fixed it, and given the amount of bad information availalbe on the internet regarding the problem, I thought I'd share what I found in my case (YMMV!).
I isolated the slow bit as a call to the php mail() function. And sure enough, building a test rig for this confirmed it was the problem.
Looking at Google, I could see this was occurring for lots of people but most of the solutions were to switch to a different MTA - the other proposed solutions I read about had no impact.
By investigating the issue further, I found that the cause was:
1) my sendmail configuration used a smart relay host (DS in sendmail.cf)
2) the first nameserver configured for my server was defunct
Not an obvious cause since
- I would have expected the local sendmail to enqueue mails regardless of the state of the relay
- indeed, using 'mail'/'mailx' command from the shell was nearly instantaeneous, this proves not to be the case for sendmail -t -i.
- I was not seeing DNS problems elsewhere
I'm having the same problem. I am using ssmtp as a mailserver. I have checked that the smtp host in the config is correct, and it still takes 20-30 seconds to save a page. Page read is as snappy as ever.
This started when I moved the wiki from a Gentoo server to a Centos server. I was unable to get sendmail to work at all on Centos, I installed ssmtp and mail started working, except for this problem.
I can ping the mailserver, everything looks ok to me (but I'm no expert, by any measurement). I've removed the email addy from the config, and now page write is as snappy as page read.
Any ideas on what to check next?
You could use the swiftmail plugin to configure a different mail server.
I installed the plugin, and set the config as below:
Your outgoing SMTP server. sendmail
The port your SMTP server listens on. Usually 25. 465 for SSL. 25
What kind of encryption is used when communicating with your SMTP Server? none
All other settings have been left blank.
The page write still takes a long time to complete. Have I got something wrong or mabe a more serious mail problem? All this machine does is backup our windows boxen and serve wiki pages.