Installing a new email server

Posted on 2011-04-28
Last Modified: 2012-05-11
I have RHEL5.4 server
I want to install a new mail server which has:
   1) Support for both smtp, and webmail.
   2) Can limit the number of messages per user.
   3) Can monitor the mail content for spaming and parental control
   And of course a free one.
   Any advice please?
Question by:Ashraf-Hassan
    LVL 31

    Assisted Solution

    Use sendmail.  It comes with RHEL release.  The other native MTA is postfix which also comes with RHEL.
    For webmail you can use Squirrel mail with it
    For spam etc, there are numerous was, spam assassin is one.

    All of this is free.
    LVL 76

    Expert Comment

    I'd recommend againt using sendmail.
    Postfix/qmail I think are more modular and easier to manage/configure.


    Author Comment

    I have installed the postfix 2.3.3 from redhat site, but how shall I configure it?
    LVL 76

    Expert Comment

    How are you planing on managing the server?
    webmin is one option?
    Are you planing on using virtualdomain?
    Are you looking at using an LDAP directory to manage the users as well as their email addresses, etc.
    How many domains do you have for which this mail server will be used? How many users per domain are you looking to have?
    /etc/postfix is the location for the configuration files.
    Depending on the number of users, domains, mailboxes there are different ways to deal with it.  The link has install/configuration instruction.
    Mysql backend?

    spamassassin, and other tools are options to deal with anti-spam mechanism ...

    Author Comment

    Well for my web server, I would like to :
        1- Manage it with with webadmin, and mysql dab.
        2- I have 5 domains each has 20 users.
        3- No I am not using the LDAP, but mysqpl DB.
    So what do you advise?
    LVL 76

    Expert Comment

    Please see the links for which provide a step by step guide including the various options.
    Postfix admin is the tool referenced to manage he virtual users with mysql as the user/email database.

    Author Comment

    I have installed the postfix, and configured mysql as well installing the squirrelmail, and the mysql configuration, and when runing configtest.php, I get the following error:
    Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:25 (Connection refused) in /squirrelmail/src/configtest.php on line 386

    ERROR: Error connecting to SMTP server "localhost:25".Server error: (111) Connection refused

    Any Help please?
    LVL 76

    Expert Comment

    Did you configure and start postfix?
    is postfix running?
    /etc/init.d/postfix status
    /sbin/service postfix status?
    lsof -i:25


    Author Comment

    It seems that postfix is running, but I can not find any log for it, I did the checks you asked and they are:
    1- I have rebooted the server to make sure that everything is ok.
    2- I checked all the mail agents running
    # service postfix status
    master is stopped
    # service sendmail status
    sendmail is stopped
    3- I checked the that nothing is listening on port 25:
    # netstat -a|grep smtp
    4- I started the postfix
    # service postfix start
    Starting postfix:                                          [  OK  ]

    # service postfix status
    master (pid 3983) is running...
    5- I checked now that there is something is listening on port 25:
    # netstat -a|grep smtp
    unix  2      [ ACC ]     STREAM     LISTENING     14694  private/smtp
    unix  2      [ ACC ]     STREAM     LISTENING     14754  private/bsmtp
    # lsof -i:25
    6- I ran the squirrelmail configtest, but I got the same error:
    Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:25 (Connection refused) in /squirrelmail/src/configtest.php on line 386

    ERROR: Error connecting to SMTP server "localhost:25".Server error: (111) Connection refused
    7- I tried from postfixadmin to send an email to an outside email server, but it failed

    Any Help?
    LVL 76

    Accepted Solution

    tail /var/log/maillog
    You may have something else that is preventing postfix from binding to the port.

    Squirelmail is an interface to access data, it is not a mail server configuration tools.

    You need to configure sendmail or postfix, but pick one to be installed on the system (uninstall sendmail).
    If you keep both, you have to make sure that /usr/sbin/sendmail points to the one that you want i.e. /usr/sbin/ or /usr/sbin/sendmail.postfix.
    ls -l /etc/alternatives/mta

    get the process id for the running postfix:
    lsof -p <process ID>
    see what ports it is bound to.

    this is where the port was/is altered

    LVL 10

    Assisted Solution

    Check out Zimbra

    Zimbra Collaboration Server is the most capable open source email and collaboration suite available today. Far outstripping what is possible with simple open source mail servers, Zimbra provides organizations major productivity boosts with global address lists, shared calendars and document management on the web or offline with Zimbra Desktop. Support for standard protocols enables use of virtually any desktop client or device for added end user flexibility.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    758 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

    10 Experts available now in Live!

    Get 1:1 Help Now