Presentation is loading. Please wait.

Presentation is loading. Please wait.

has many aspects that work together to give people almost instant communication from any computer on the internet to any other computer There.

Similar presentations


Presentation on theme: "has many aspects that work together to give people almost instant communication from any computer on the internet to any other computer There."— Presentation transcript:

1 Setting up email servers.

2 has many aspects that work together to give people almost instant communication from any computer on the internet to any other computer There are three main parts that we will look at: sending on a server, receiving on a server and receiving as a client The simplest is to receive as a client. You merely put in the name of the server that holds your and download it.

3 Cont.. On Linux, you can view your through many different programs. There are graphical programs like Mozilla, Ximian Evolution and Kmail You can also use programs from the command line like 'pine' and 'mutt'

4 on the Server Getting and reading is simple on a client, but setting up a server to get and send requires a little more understanding of how works There are three parts to have an server The MTA – Mail Transport Agent (most people use the program called 'sendmail') The LDA – Local Delivery Agent (most people use the program procmail)

5 Cont… IMAP and POP3 servers – these are two ways to get from a server. When a client connects to a server to get , they will use one of these servers

6 Setting up Sendmail Sendmail normally runs with all RedHat distributions, so you won't need to start any service. Sendmail is a Mail Transport Agent – this means that it is a program which moves mail from one computer to another computer. It is estimated that 80% of all is handled by Sendmail today. With Sendmail, you can do many things, like block spam, relay mail, have forwarders and configure ways to route mail automatically across networks.

7 Setting up Sendmail Setting up Sendmail can be an enormous task if you want to do complicated things, but if we just want it to accept , we can keep it simple. First change into /etc/mail where the sendmail files are saved Sendmail has a different configuration, where you edit files and then compile them into a form that Sendmail accepts.

8 Cont… First open the file “access” - This is the file that contains all the domains to which the Send mail is allowed to send s. You’ll also want to make a file called “relay-domains” and put your domain in there. This is to stop people from outside using your server to send spam You need to add your domain here and any domains that might be owned by your network

9 Setting up Sendmail You'll also want to open up the file “local-host-names” - This will contain other names for your computer, so that Send mail will still accept mail from these domains. This file should contain any other names you have for your computer Now your sendmail will know from whom it can accept mail from and whom it must not.

10 Setting up Sendmail The actual sendmail configuration file is “sendmail.cf” to which the changes are made, which you then compile to make into the “sendmail.mc” In RedHat, they use this program called “m4” to generate the sendmail.cf file So after we edit the “sendmail.mc” file, we use m4 to change it, like root]# m4 sendmail.mc > sendmail.cf

11 Setting up Sendmail Now that you have the configuration set up for Sendmail, you can restart the service if you want to take the new changes into affect So we use the service command to restart sendmail root]# service sendmail restart And you can check to see if it's running by using 'ps -aux' and you'll see an entry that says, “sendmail: accepting connections” This means that it is up and running and people can send to your server

12 MX Records MX Records – Mail Exchange records are part of the DNS system for the entire Internet. In order for other computers to know where to send you , you need to have the correct MX records set up on some Name Server on the internet. They use a numerical priority determines the order in which servers should be used. The server with the lowest priority is the primary.

13 Local Delivery Agents In most RedHat distributions, Sendmail will get the mail from some server on the Internet and then pass it off to another program for local delivery This means there is another layer of handling before an will reach your inbox. Procmail is usually the program that is chosen to do the local delivery. The reason that there is another layer is that it is easy to do things to mail after it has come in with procmail. For example, you could sort mail into different folders, delete it if it is spam or make copies of everybody's

14 Procmail When a new message comes in, Procmail will start automatically and deliver the mail to the correct folder for the person to read it You can change how mail is delivered through a procmail configuration file. Initially, there is no configuration file for procmail, because it will just give whatever mail comes in to the person who should receive it

15 Cont… You can make one yourself though by creating a file called “/etc/procmail.rc” This is the file where you can put rules that will change how mail is delivered

16 Cont… For example, if you want to make a copy of everyone's so you can read it yourself: :0c /home/mycopy- The ':0' part says that a new rule is starting. The 'c' says copy all and the following line says where to copy it.

17 Procmail Example: If you wanted to delete all that came from a certain domain :0 * /dev/null The first line says a new rule is starting. The next line checks if the 'From' field is from

18 Cont… The last line says move that message to /dev/null if the is from that person /dev/null is like the trash bin for linux. If you move something there, it delete's it automatically.

19 IMAP and POP3 The last part of setting on the server is to have a way for users to get that . The most popular way is through to services called IMAP and POP3 IMAP - Internet Message Access Protocol It permits a "client" program to access remote message stores as if they were local.

20 Cont… For example, stored on an IMAP server can be manipulated from a desktop computer at home, a workstation at the office, and a notebook computer while traveling, without the need to transfer messages or files back and forth between these computers.

21 Turning on IMAP To get IMAP and POP3 working on your server or to get them started, you need to edit a file called “/etc/inetd.conf” This file has a list of all the services that are running and what ports they are connected on.

22 Cont.. Look down the list until you see the info for port “139” – pop3 and “143” – IMAP. Uncomment those lines and the next time you restart the server, IMAP and pop3 should be started

23 POP3 The other way to get email is through the POP3 service
POP – Post Office Protocol It was the first way to get from a server. POP3 is the latest version, which has replaced POP2.

24 Cont… POP is different from IMAP in that everything is downloaded to the client machine. Thus, if you make a change to your mail, it will only be changed on the client machine and not the server You can turn it on using the same procedures from IMAP

25 Cont… A good way to see if it is running, try
root]# telnet localhost 25 What this command will do is use the telnet program to connect to port 25 on the computer you are using. You will then be able to see the protocol and server messages coming from the SMTP server

26 IMAP and POP You can also see how the IMAP and POP servers work by using the same telnet idea IMAP runs on port 143 POP3 runs on port 110 root]# telnet localhost 143 root]# telnet localhost 110


Download ppt "has many aspects that work together to give people almost instant communication from any computer on the internet to any other computer There."

Similar presentations


Ads by Google