About Me

My photo
Hi Friends, I am Sandeep CC and some people know me as System Administrator. I have started my professional career from 2008. I have been working as System Administrator on Linux Server and Windows Client. I am here to share my Knowledge in which I have experienced and which I have come across till now, It could be help to you people. In case anything wrong or any improvements in my post steps, Please comment to the post, Feel free to contact me by posting comments on this blog. Thanks and Regards, Sandeep CC

Tuesday, August 14, 2012

Configuration Mail Server On REDHAT LINUX-5

MAIL SERVER WITH REDHAT LINUX AND WINDOWS CLIENTS:




Server Setup:


Server: freedom-web.sandeepc.com
Domain Name: sandeepc.com
Server IP: 192.168.1.1
Client: Linux and Windows XP/2003

Requirement PACKAGE AND SERVICES:

1. PACKAGE:

DOVECOT (For Incoming Mail)
Sendmail (For Outgoing Mail)

2. SERVICES:

DNS (named) service (Click here to check Installation steps of DNS SERVER)
APACHE (httpd) service (This is optional service)(Click here to check Installation steps of APACHE/WEBSERVER)


INSTALL DOVECOT RPM FOR INCOMING MAILS

[root@freedom-web Server]# rpm -i dovecot-1.0-1.2.rc15.el5.i386.rpm
warning: dovecot-1.0-1.2.rc15.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
[root@freedom-web Server]#

[root@freedom-web Server]# cd /etc/
[root@freedom-web etc]# ls -ltr |grep dov
-rw-r--r-- 1 root root 39849 Dec 22 2006 dovecot.conf
[root@freedom-web etc]# cp dovecot.conf dovecot.conf.org
[root@freedom-web etc]# vi dovecot.conf

(Line No 17 Remove "#")
protocols = imap imaps pop3 pop3s

INSTALL SENDMAIL & SENDMAIL.CF FOR OUTGOING MAILS

[root@freedom-web etc]# rpm -qa |grep sendmail
sendmail-8.13.8-2.el5
[root@freedom-web etc]#

[root@freedom-web Server]# rpm -i sendmail-cf-8.13.8-2.el5.i386.rpm
warning: sendmail-cf-8.13.8-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
[root@freedom-web Server]#

[root@freedom-web mail]# cd /etc/mail
[root@freedom-web mail]# vi sendmail.mc

(#####Line no 116 look like this#####)
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

(#####Line no 155 look like this#####)

dnl LOCAL_DOMAIN(`localhost.localdomain')dnl
#dnl LOCAL_DOMAIN(`sandeepc.com')dnl

[root@freedom-web mail]# m4 sendmail.mc > sendmail.cf
[root@freedom-web mail]#

[root@freedom-web mail]# vi access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
#sandeepc.com RELAY
connect station: sandeepc.com ----> add this line
connect: sandeepc.com -----> add this line
connect: 192.168.1.1 -----> add this line

:wq save and exit

[root@freedom-web mail]# make
make: Nothing to be done for `all'.
[root@freedom-web mail]#

DNS CONFIGURATION FOR FQDN

[root@freedom-web mail]# cd /var/named/chroot/var/named/
[root@freedom-web named]#

[root@freedom-web named]# vi sandeepc.com.zone
$TTL 86400
@ SOA sandeepc.com. root(
42 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

sandeepc.com MX 10 mail ;primary mail exchanger -----> add this line
@ NS freedom-web.sandeepc.com.
@ NS client1.client.com.
freedom-web A 192.168.1.1
mail A 192.168.1.1 ----------> add this line


:wq & Save Exit

Note: Finally Restart dovecot & sendmail service (After modifying anything in config file restart the both service once)

Client Setup With Windows:


I have tried mail server with windows client,Configured client in XP & Win-2k3 with outlook express...
STEP-1


STEP-2


STEP-3


STEP-4


STEP-5

Now User have added to Outlook Express, now try to synchronize, if get any problem with synchronize, check with user and pass, check with firewall in server and client too, if iptables is on then enable port no 53 for tcp & utp. then again try to synchronize...


Thanks and Regards,
Sandeep CC

5 comments:

  1. Hi,
    I wonder if you can help me. This is a great tutorial which is hard to come by. Thanks for it. But when I try to compile the sendmail.mc with m4 I get a permission denied error and I am currently stumped for an answer. See the code below;
    m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
    Error is
    bash /etc/mail/sendmail.cf permission denied

    I tried using sudo but did not work. Please let me if I am missing something. Thanks

    ReplyDelete
    Replies
    1. Hello Chandra Thanks for your reply,

      Can you check where m4 rpm has installed or not? ( rpm -qa |grep m4) if its installed then only m4 command will work...

      please check you are in root level user, for compile file you must required root level permission only...

      try by stopping sendmail service 1st then compile with m4 then start the service (This is optional trobleshooting...)

      Regards,
      Sandeep CC

      Delete
  2. Hii sandeep...i am syamsundar.i Configured dovecot,sendmail,squirrelmail.dns,http in one Server.I can access webmail with normal user account,but i cannot access the mail server by using root account.getting this ERROR: Connection dropped by IMAP server.

    I cannot access mail server by using url:http://192.168.1.2/webmail.but i can access with this url:http://192.168.1.2/webmail/src/redirect.php.

    can u expalin how to access url with http://192.168.1.2/webmail

    ReplyDelete
  3. Hello Syamsundar,

    for root login: The dovecot binary does not allow root logins. You can't do this unless you hack the source code...

    for your mail accessing what you have used to open with webmail?

    Can you check how you configured squirrelmail? check steps given below link...

    "http://ccsandeep.blogspot.in/2012/09/squirrelmail-with-sendmail-dovecot-how.html"

    Regards,
    Sandeep CC

    ReplyDelete
    Replies
    1. Sundar,

      Even if my link wont help you means you can check the below files,

      1. Check index.php is available on /usr/share/squirrelmail/ path,
      2. If its available check the code (given header location, header('Location: src/login.php');)
      3. Then check with login.php page which is available on /usr/share/squirrelmail/src/ path...
      4. also check with /usr/share/squirrelmail/config/config.php file

      Regards,
      Sandeep CC

      Delete