Incoming Mail Server Setup

Posted on 2012-08-28
Last Modified: 2012-09-05

As part of an Alfresco setup, I have enabled the incoming mail server. I'm having some issues with the configuration that I hope someone can help me with. I am new the the work of mail servers, so please bear with any stupid questions!

Setup is on a CentOS box hosted by Rackspace.

I have run the following tests. Part of my domain name has been changed to 'example' for the purpose of this post.

My alfresco mail server configuration:

If I telnet the following:
"telnet localhost 25" I get the following message which indicates (to me at least) that the server is up and running.
"220 EXAMPLE-ALFRESCO.localdomain ESMTP Postfix"

However, if I telnet the following:
"telnet 25" from the server then I get the following:
"telnet: connect to address Connection refused

I also cannot establish the connection if I telnet the above from my PC over the internet although I can telnet the FTP service running on port 21.

I have created a MX DNS record as follows:

Domain Name:
TTL: 300 seconds
Type: MX
(Priority set to 10)

I realise that there are probably multiple places where I could have gone wrong with the setup and configuration, but it would be good if someone can point me in the right direction on how I can solve this connection issue.

Question by:joust888
    LVL 24

    Expert Comment

    You've created the MX record - have you created a matching A record?

    This line
    telnet: connect to address Connection refused

    The xxx part - does the name resolve correctly to the IP that your server is running on?

    Author Comment

    Yes it does. I run an instance of alfresco on the server which I access through

    Also, if I do the following:
    "telnet 21" I get the following:

    "220 FTP Server Ready" (which is the port that the FTP server has been set up)

    My thinking is that it could possibly be port 25 that is refusing connections.

    If I run NetStat -l I get the following difference between FTP and SMTP, which I think might be a clue?

    Local Address:

    That indicates that it is only listening on the localhost and not anything else. If my assumptions are correct - how would I go about enabling it to listen to the outside?
    LVL 24

    Expert Comment

    Yep, sounds like it for sure...

    Ok I'm not familiar with the mail server you are running, but somewhere in the config section will be an option to either 'listen' on an interface in which case you need to select the correct IP

    Or maybe the email domain is not correct?

    According to that doc you should have

    and not

    like you have?

    Sorry I'm not up to speed on that mail server, but yes based on your output from netstat it looks like its not listening to anything other than localhost

    Author Comment

    Having switched the configuration of the Alfresco mail server to port 2525 I can now telnet to the mail server externally by "telnet 2525". I get the "220 ESMTP SubEthaSMTP 3.1.6" message.

    Thus, it does not seem to be the mail server setup that is preventing access to port 25. Could it be a CentOS issue that I need to resolve?

    Also - is there a way of using port 2525 instead of port 25? Even though I can reach port 2525 via telnet - my mail server still does not seem to receive e-mail when I e-mail to it from an external mail addres such as gmail.
    LVL 24

    Accepted Solution

    Well that tells me either port 25 is blocked on your router/firewall, or your ISP doesn't allow traffic on port 25 - have you confirmed the settings on the router? changed to port 2525 - did you make changes to the router at all? Normally you need to open ports and do the NAT mapping to make these things work...or what type of broadband are you on? 1 public IP? Or a range of public IP's?

    CentOS - I assume this is your router? Then yes its probably a setting on that

    No, you'll need port 25(as all mail servers worldwide use this by default), so switching this isn't going to help - we need to get port 25 responding to make this work

    When you switched to 2525 - what does the netstat output show?
    Also when you switched to 2525 - what other changes to your router/firewall did you make?

    Author Comment

    I have this working now. I decided to let this lie for a little while as I was making some other major changes to the installation and thought I'd see if the problem fixes itself in some way.

    Initially the alfresco mail server was installed on a CentOS  (linux operating system) on rackspace and they allow communication through port 25.

    I have since changed the operating system of my server and am now rolling out alfresco on an Ubuntu server. It also seems that the mail server is now working 100% so I am assuming that it is:
    1) a CentOS default firewall thing which does not allow comms through port 25 - I assume someone with the same problem could get around it by altering the port settings on the iptables...
    2) The only real other difference to the 2 installations was that I had SSL enabled and set up on the CentOS server. I can't really think that that would have been the issue though as the SSL was configured to run through port 8443.

    I am about 95% sure that the issues relate to CentOS and the default security settings that comes with it. The question, to answer this question, would therefore be how to open port 25 on a CentOS machine to allow communication from other sources than localhost.

    Thanks for all the help.

    Author Closing Comment

    I was unable to solve the problem on the CentOS server, but the firewall was set up differently on the UBUNTU box and got around the issue.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Suggested Solutions

    Title # Comments Views Activity
    Linux alternative boot CD? 28 77
    Emergency IT Handover document template 2 72
    Inventory 1 42
    How to Edit Files in Linux 6 71
    If you require IT professional services from consultants, do you know that you can often have the choice between obtaining the services on a Time and Materials basis (T&M) or on a Fixed Priced basis?  One of them can be much better for you.  Or, sai…
    Introduction As my business expands, I need a standard set of criteria for helping customers and myself see the best approach for managing their networks. To this end I have created a list of questions that I use to establish future goals, identify…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now