230 likes | 668 Vues
Mail Server. Presented By Jawad -Ur- Rehman 037 Noman Iqbal 012. Mail Server. We want to configure the send mail server for your local LAN. By default sendmail server allows to connect to local host only.
E N D
Mail Server Presented By Jawad-Ur-Rehman 037 NomanIqbal012
Mail Server • We want to configure the send mail server for your local LAN. • By default sendmail server allows to connect to local host only. • So we should edit the /etc/mail/sendmail.mc file to allow connect to other hosts.
Mail Server • The sendmail daemon is configured from a directory of files in /etc/mail and a directory of configuration files in/usr/share/sendmail-cf. • There are two basic configuration files: • sendmail.cf The main sendmail configuration file. • sendmail.mc A macro that's easier to edit, which can be used to generate a new sendmail.cf file.
Configuration • # rpm –qasendmail • # rpm –qa postfix • # rpm –qasendmail-cf • # rpm –qasendmail-doc • # rpm –qasendmail-devel
Configuration • yum install sendmailsendmail-cfsendmail-doc • yum install sendmail-devel telnet mailx • Yum install postfix • service sendmail start • Service postfix start • chkconfigsendmail on • netstat -lnp | grep 25
Configuration • # vi /etc/mail/sendmail.mc • dnl# DAEMON_OPTIONS('Port=stmp,Addr=127.0.0.1,Name=MTA')dnl • m4 sendmail.mc > sendmail.cf
Configuration • open /etc/mail/sendmail.mc for editing • By default, the following line limits sendmail access to connect local host only [line no 116] • dnl# DAEMON_OPTIONS('Port=stmp,Addr=127.0.0.1,Name=MTA')dnl • You can allow other computers to use your sendmail server by commenting out this line.
Configuration • In the sendmail.mc file , lines that begin with dnl, which stands for delete to new line, are considered comments. Some lines end with dnl, but lines ending in dnl are not comments • comment this line with dnl keyword followed by # sign • save this file with :wq and exit. • Now generate new sendmail.cf file by using m4 command as shown here.
Configuration • Now restart sendmail service and also set it on with chkconfig • if sendmail service restart without any error means you have configured sendmail successfully. • Now create one user on each system noman on server • and umar on client system
Configuration • Now send mail from user noman to umar and from umar to user noman and also check each others mail by mail command. • Use full user name to send mail. For example to send mail to umar use umar@client1.
myhostname=server.jawad.com • Mydomain=jawad.com • # service postfix start • # sunoman • [noman]$ mail umar@server.jawad.com • $ ls • Maildir
CdMaildir • Noman [Maildir ]$ ls • New cur tmp • Noman [Maildir]$ cd new • Noman [new]$ ls • Noman[new]$ cat 13456.f23654.localhost.localdomain
iRedmail server • First we need to download the package of iRedmail from www.iredmail.org then we need to tar this file or unzip it. • Hostname setting: /etc/sysconfig/network • We can check our host through • $ hostname –f • demo.iredmail.org • Jawad.iredmail.org
Enable all default yum repositories in • /etc/yum.repos.d/CentOS-Base.repo • "enabled=1"
# cd/root/ • # tar xjf iRedMail-x.y.z.tar.bz2 • # cd /root/iRedMail-x.y.z/ • # bash iRedMail.sh
Webmail: http://your_server/mail/ • Admin panel: httpS://your_server/iredadmin/ • phpMyAdmin: httpS://your_server/phpmyadmin/