Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have Kayako helpdesk running on our WHM Linux server.

When e-mails come in from customers, notifications are sent out by Kayako to a number of staff whose mailboxes are hosted on Rackspace mail servers.

I noticed a large queue in the Exim queued message viewer of WHM - when looking in Exim logs I can see many lines 2012-10-13 20:06:56 1TN72s-0007Cw-1l SMTP error from remote mail server after initial connection: host mx2.emailsrvr.com [173.203.2.32]: 421 Too many concurrent connections from this client.

One client email results in about 5 emails to rackspace servers, perhaps 60 emails per 1 hour on average - not a huge amount but enough to cause messages to be rejected when sent in short bursts.

In this case ideally if we can limit the connections sent to the rackspace server we can comply with their limit. For our requirements if we send 1 email every10 seconds or so, this would be OK.

Messages to all other servers should go through a normal rates, only mx1.emailsrvr.com and mx2.emailsrvr.com should have this connection limit policy applied.

Is this possible?

share|improve this question
2  
No solution will scale. If you reach the point where you get 5 emails a minute, your support staff might not get emails for hours - are you willing to let that happen? Talk to Rackspace, and get them to whilelist your IP, or get your support people to move elsewhere. –  Jay Oct 13 '12 at 23:12
add comment

1 Answer

up vote 2 down vote accepted

The problem is not with how many or how fast you are sending emails, but with the fact that exim by default can open multiple parallel connections to the same destination host. The administrators of the receiving servers have decided that they do not want multiple connections from the same ip address as that could more easily lead to a single sender using up too much resources at their end.

You want to use the serialize_hosts option on the smtp router in your exim configuration, as that will limit exim to not open more than one connection for any host listed in the serialize_hosts option. Something like this:

begin transports

# This transport is used for delivering messages over SMTP connections.

remote_smtp:
  driver = smtp
  serialize_hosts = mx1.emailsrvr.com : mx2.emailsrvr.com
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.