I have a fairly standard Exim setup for inbound and outbound mail. Recently our development team has put together a PHP app that allows us to send out bulk mails to our clients. The PHP app uses standard PEAR libraries to initiate an SMTP connection to localhost (application and mail server are on the same box). The idea here is that the application will send out roughly 10'000 emails in a very short time period (60 seconds or so) which Exim will then hold in its queue for delivery.
The problem comes in where after about 50 emails, Exim stops accepting mail and loggs the following error in the exim_main.log file:
SMTP command timeout on connection from localhost [127.0.0.1]
Could it be that this is because Exim immediately starts delivering the mail and then stops accepting new incoming connections? I thought that increasing the SMTP limits may be the problem here, but even after setting new values in the exim.conf file to the following, I still get the same problem:
queue_run_max = 5000
smtp_accept_max = 5000
smtp_accept_queue = 5000
This begs two questions:
- How do I resolve this?
- What is the best way for configuring Exim to accept a huge amount of mail into the queue in a very short time period, but then gradually delivery it once it's all in the queue? I've seen some people run separate Exim daemons for incoming and outgoing mail; is this a good solution?