Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using exim4. I have configured and run it. But it only works for localhost. When i try to do something like this exim4 -v, it gives me the error of connection time out.

What is wrong in sending emails to remote location?

this is the error i get [] Connection timed out

share|improve this question

Here is my guess.. You are doing this from a home internet connection. Most ISPs block outbound connections to port 25 to all other hosts but their own email server(s) to stop people from sending spam from their home connections or to stop spam bots.

share|improve this answer
so whats the solution for this??? – usmanali Jan 21 '11 at 10:30
Usually they will offer a relay server which you can use. Check with them, and then look at remote_smtp_smarthost in Exim. – Niall Donegan Jan 21 '11 at 11:17
I checked my exim access and it says 550 relay not permitted. Now can I set up the relay. I don't have much experience with email configurations so please tell if there is a solution. Thanks – usmanali Jan 21 '11 at 11:53

The default EXIM config does not allow relaying.

  # Insist that any other recipient address that we accept is either in one of
  # our local domains, or is in a domain for which we explicitly allow
  # relaying. Any other domain is rejected as being unacceptable for relaying.

  require message = relay not permitted
          domains = +local_domains : +relay_to_domains

If you remove the above argument (line 455 in my /etc/exim/exim.conf) then open relaying will be permitted through EXIM, which is bad. However, you can give it shot for testing purposes. Understand first though that ANYONE will be able to relay mail through your MTA at that point - eventually SPAM will disseminate from your server, your domain will end up on blacklists, etc. if you don't restore it shortly.

In order to make EXIM function like a modern relay server you must read up on the topic of authentication. EXIM's default config will permit relaying for authenticated email clients. Here's the official book:

Are you, or do you intend to use LDAP to store usernames and passwords - as it pertains to authenticating your email users?

Here's also a pretty good article. It should give you a holistic idea of what it takes to setup an EXIM MTA based email server - with LDAP I should add. The howto is Debian specific:

share|improve this answer
You've identified the problem, but offer no solution! I need to enable relaying for connections from localhost. I'll post here if I find it. – Rich Oct 12 '12 at 17:53
Maybe I have a slightly different problem from @usmanali -- I found that the default exim config will relay anything from "", but if you connect to exim as "localhost" on an IPv6 machine, it will refuse to relay. I solved it by changing "relay_from_hosts" to include "localhost" – Rich Oct 12 '12 at 17:59
See – Rich Oct 12 '12 at 18:05

If your ISP is blocking outgoing traffic on port 25, it's possible that they have a relay server you are allowed to use. Talk to them to find out and if they do, you should configure exim to send all outgoing mail via a smarthost, where the smarthost ip address is the ISP's relay server.

share|improve this answer

Your Answer


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.