Configure A Mail Server in Linux
Configure A Mail Server in Linux
Page | 2
1) Install BIND and Setup a DNS Server $ yum install bind $ yum install system-config-bind $ system-config-bind Add a Zone with the domain name (i.e. kkarachistan.com) Add an A record for the host (i.e. khan) Add an MX record for the domain. Final Configuration should look like this.
$ vi /etc/resolve.conf Add: nameserver 192.168.2.100 make sure it is the first nameserver in the list. $ service named start $ chkconfig --add named
Page | 3
2) Install & Configure Postfix SMTP Server $ yum install postfix Set default MTA using following command $ alternatives --config mta $ vi /etc/postfix/main.cf Set: inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain home_mailbox = Maildir/ $ service postfix start $ chkconfig --add postfix
Page | 4
3) Install & Configure Dovecot IMAP/POP3 Server $ yum install dovecot $ vi /etc/dovecot.conf Find and update following settings protocols = pop3 pop3s imap imaps mail_location = maildir:~/Maildir/ pop3_uidl_format = %08Xu%08Xv imap_client_workarounds = delay-newmail outlook-idle netscape-eoh pop3_client_workarounds = outlook-no-nuls oe-ns-eoh For 64-bit users: Add the line login_process_size = 64 $ service dovecot start $ chkconfig --add dovecot
Page | 5
4) Create Mail User Accounts $ groupadd kkarachistan Create users by using the following commands $ useradd irfan -g kkarachistan -s /sbin/nologin $ passwd irfan
Page | 6
5) Install & Configure Apache Web Server $ yum install httpd $ service httpd start $ chkconfig --add httpd
Page | 7
6) Install & Configure Squirrel Webmail Server $ yum install squirrelmail $ cd /usr/share/squirrelmail/config/ $ ./conf.pl Select 'C' if you cannot see options Select 'D' to set predefined Settings select dovecot From Main Screen Select 2 (Server Settings) set domain to kkarachistan.com Save Settings and Exit. Open your Browser and access http://khan.kkarachistan.com/webmail MUA like thunderbird, outlook, etc. can be configure to use this Server.
Page | 8