How sendmail works?

Discussion dans 'Support informatique' créé par le3fou, 21 Mars 2006.

  1. le3fou

    le3fou Visiteur

    J'aime reçus:
    The funny thing about email is that it generally takes more than one type of server to effectively serve email. SMTP is the email protocol, it is responsible for making sure that hundreds of email messages that are sent daily make their way around the world and end up in your mailbox. The Unix-based sendmail is the father of all email servers and is included in all copies of Linux versions. To find out if you have it installed or not, type in: rpm -q sendmail

    Other than registering your mail with a DNS, SMTP handles receiving an incoming message and passing it on to its final destination. It runs on port 25 and can easily be demonstrated simply by telneting to your mail server and trying a few commands in the SMTP vocabulary. If you install only SMTP service, you'll need to allow users to log in to your system and use Linux-hosted email software such as mail, elm, or pine to check your messages.

    POP – Post Office Protocol: the POP3 protocol is used to move email from the server that holds the user's mailbox onto their computer. But it has its strength and has its weakness. Its weakness here is that if you check your emails that are stored on the server from your office, you can't see them when you go to your home. Because even though POP clients offer a leave on server check box, this is a less than perfect solution and requires you to actually remember to use the leave on server setting wherever you happen to be. Another protocol called IMAP solves this problem. POP uses port 110, so you can also test this client by telneting to the port 110. example: telnet 110 and use its commands to retrieve the messages and read them and also delete them. So far, we understood that SMTP is for sending emails to its destination. POP is for reading and retrieving emails from the server. So POP is, by far, the most common means for delivering email to client computers.

    IMAP addresses the "Where is my mail?" issues of the POP protocol. IMAP returns the idea of keeping mail on the server, not on the client machine. Only the header information for a message is downloaded to the client – the rest of the message is left on the server until the user explicitly tries to read that message, after that message is read, it is tagged as read on the server. When a message is deleted from the client, it is deleted from the server.

    Another type of mail service is the web based service which is basically a GUI such as hotmail or yahoo mail. Most web-based software is proprietary and is not based on any particular protocol. You can use CGI programming to write your own web email client.

    If you are running a mail server on the host and you want messages that are sent to the domain ( to go to your mail server, make sure the you have an MX record set in your DNS.

    Securing your POP or IMAP server:

    in Linux, and exactly in a file called inetd.conf, there is something called /usr/sbin/tcpd is referenced before the actual IMAP or POP server program. This is a special piece of software called a TCP wrapper that sits in between the incoming connection and the server process. It determines whether a connection should be considered valid based on IP address or hostname, and even performs checks to see if the incoming connection is being spoofed. So it accepts or drops.

    The files that control the operation of the TCP wrappers are /etc/hosts.allow and /etc/hosts.deny

    as we learned from our network security class. /etc/hosts,deny should have this line uncommented which : ALL:ALL this denies all the incoming connection to the IMAP or POP severs. And after you lock your system down you need to open service up to domains that should be about to access inetd processes. For example: ALL: LOCAL, 131.230.x.x, ...ETC

    to read more about host access, type in : man 5 hosts_access

    conclusion: When trying to determine what mail services to run, try to balance your resources with your users' needs. If you support users who must access email from multiple places (mobile users), IMAP will probably work best for you. If disk space is an issue, POP3 helps keep your disk and network usage to a minimum. Web-based email offers some of the benefits of each-access from anywhere without the constant network connection of IMAP.

    Written by le3fou in his class presentation.

Partager cette page