Linux10 sendmail


Published on

Linux Sendmail

Published in: Education
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Linux10 sendmail

  1. 1. Mail Server 1
  2. 2. Mail Server E-Mail Basics Linux provides e-mail servers, which communicate with enduser systems and with other email servers to manage your email needs. 2
  3. 3. Mail Server 1] User agent for reading and sending mail 2] Transport agent for forwarding mail between machines. 3] Delivery agent for delivering mail to the user mail 3
  4. 4. Mail Server The user agent act as the user front end. It consists of the application layer programs like mail. It hands over mail to the transport agent. 4
  5. 5. Mail Server The transport agent is also responsible for accepting mail at the receivers end. 5
  6. 6. Mail Server The delivery agent receives mail from the transport agent and deliver it to the actual user’s address. 6
  7. 7. Mail Server SMTP(Simple Mail Transfer Protocol) Several protocols exist to manage e-mail. The most common of these is the (SMTP), which is designed as a push mail protocol, meaning that the sending system initiates the transfer. 7
  8. 8. Mail Server SMTP(Simple Mail Transfer Protocol) SMTP is used through most of a mail delivery system. The final stage, though, often employs a pull mail protocol, such as the Post Office Protocol (POP) or the Internet Message Access Protocol (IMAP). With these protocols, the receiving system initiates the transfer. 8
  9. 9. Mail Server SMTP(Simple Mail Transfer Protocol) SMTP was designed to enable a message to be relayed through an arbitrary number of computers. For instance, an end user might compose a message, which is sent to the local SMTP server. 9
  10. 10. Mail Server POP (Post Office Protocol) This system might use its own internal routing table to redirect the message to another local system, from which the message might be read, either directly or via a POP or IMAP server. 10
  11. 11. Mail Server POP (Post Office Protocol) The POP and IMAP protocols can be used by the local e-mail clients to retrieve their e-mail from a remote server. 11
  12. 12. Mail Server POP (Post Office Protocol) Currently, these are the two most prevalent protocols for e-mail retrieval. These can be used to connect to your local server, as well as Webbased mail servers such as Gmail. 12
  13. 13. Dovecot Mail Server Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind. 13
  14. 14. Dovecot Mail Server Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory. 14
  15. 15. Dovecot Mail Server Most prominent (noticeable) features 1)Dovecot is among the highest performing IMAP servers while still supporting the standard mbox and Maildir formats. 15
  16. 16. Dovecot Mail Server Most prominent (noticeable) features 2) Dovecot's indexes are selfoptimizing. They contain exactly what the user's client commonly needs, no more and no less. 16
  17. 17. Dovecot Mail Server Most prominent (noticeable) features 3) Dovecot is self-healing. It tries to fix most of the problems it notices by itself, such as broken index files. The problems are however logged so the administrator can later try to figure out what caused them. 17
  18. 18. Mail Server MIME(multipurpose internet mail extension) Today the mail facility is wildly used to deliver multimedia attachments. There attachments are separate file containing binary characters which use the 8 character of ASCII code. 18
  19. 19. Mail Server MIME(multipurpose internet mail extension) There is a separate protocol which handles these attachments MIMEmultipurpose internet mail extension. MIME extends the definition of mail to include binary files and multiple data format in single message. 19
  20. 20. Mail Server MIME(multipurpose internet mail extension) MIME encodes a message before sending which is sub-sequently decoded at the other side by MIME. MIME message can be easily exchange between them. 20
  21. 21. Mail Server Running Sendmail Standard part of most Linux distributions One of the most popular mail server programs on the Internet Use Sendmail as an alternative to expensive mail server programs 21 (Microsoft Exchange Server)
  22. 22. Mail Server Running Sendmail Standard part of most Linux distributions One of the most popular mail server programs on the Internet Use Sendmail as an alternative to expensive mail server programs 22 (Microsoft Exchange Server)
  23. 23. Mail Server Installing Sendmail Quickly find out whether Sendmail is installed on your system by entering the following command from a shell prompt: $ rpm –q sendmail 23
  24. 24. Mail Server Installing Sendmail If Sendmail has been installed, the package version is displayed. If not, the message ‘package sendmail is not installed’ is displayed. 24
  25. 25. Mail Server Installing Sendmail Check that m4 is installed by running command $ rpm –q m4 Check that sendmail –c4 is installed by running the command $ rpm –q sendmail –c4 25
  26. 26. Mail Server Installing Sendmail m4 and sendmail –c4 are required if you want to make changes to your Sendmail configuration. They are should be there if Sendmail is installed. It never hurts to check. 26
  27. 27. Mail Server Installing Sendmail If Sendmail isn’t installed, instal by following steps: 1)Insert the RedHat Linux distribution CD in your CD drive. 2)When prompted to run the Autorun file, click YES. 27 (The Package Manager window opens)
  28. 28. Mail Server Installing Sendmail 3) Click Forward 4) Scroll down the list and select Mail Server. 5) Click Forward. 28
  29. 29. Mail Server Installing Sendmail 6) When Package Manager program displays the list of packages it processes to install, Click Forward. 7) When the Package Manager program is done, Click FINISH. 29
  30. 30. Mail Server Installing Sendmail To install Sendmail manually, $ rpm –ivh /mnt/cdrom/RedHat/RPMS/sentmail* 30
  31. 31. Mail Server Modifying • Sendmail - one of the most difficult program to configure that you will ever encounter. • In fact, the basic configuration file, is over 1000 lines long. • You don’t want to mess with this file if you can possibly avoid it. 31
  32. 32. Mail Server Modifying • The configuration file is generated automatically from a much shorter file called • This file contains special macros that are processed by a program called m4. 32
  33. 33. Mail Server Modifying • The m4 program reads the macros in the file and expands them to create the actual file. • Even so, the file is a new hundred lines long. 33
  34. 34. Mail Server Modifying You can find the and files in the /etc/mail directory. Before you edit these files, you should make backup copies of the current files. 34
  35. 35. Mail Server Modifying you can regenerate the file by commands: $ cd /etc/mail $ m4 > $ server sendmail restart 35
  36. 36. Mail Server Modifying First command changes the current working directory to /etc/mail. Second command compiles the command into the command. Third command restarts the Sendmail service so that the changes will take effect. 36
  37. 37. Mail Server Modifying Two strange conventions used in the file: i) Comments don’t begin with at hash mark (#), they begin with the letter dnl. ii) Quotation marks must begin with a backquote (`) and end with an apostrophe (‘). So a properly quoted string looks like this: MASQUERADE_AS(`’) 37
  38. 38. Mail Server Modifying Two of the more common configuration changes that you may need to make 38
  39. 39. Mail Server Modifying 1) The default configuration allows connections only from localhost. If you want Sendmail to work as a server for other computers on your network, look for the following line in the file: DAEMON_OPTIONS( `Port-smtp.Addr=, Name=MTA’)dnl 39
  40. 40. Mail Server Modifying 2) Masquerading/hidden/concealed allows all the mail being sent from your domain to appear as if it came from the domain (for example, rather than from the individual host (i.e. 40
  41. 41. Mail Server Modifying To enable masquerading, add lines similar to these: MASQUERADE_AS(`’)dnl FEATURE (masquerade_envelope)dnl FEATURE (masquerade_entire_domain)dnl MASQUERADE_DOMAIN(`’)dnl 41
  42. 42. Mail Server Setting up aliases An alias – also known as a virtual user – is an incoming e-mail address that is automatically routed to local users. i.e. you may want to create a generic account such as and have all mail sent to that account delivered to a user named willie. 42
  43. 43. Mail Server Setting up aliases To do that, you edit the file /etc/mail/virtursers/ This file starts out empty. To create a virtual users, just like the incoming e-mail address followed by the actual recipient. 43
  44. 44. Mail Server Setting up aliases For example, here’s a virturusers file that defines several aliases: willie robert robert After you make changes, you should restart the Sendmail service. 44
  45. 45. Mail Server SPAM - Sendmail • Spam artists – unscrupulous / dishonest / corrupt marketers who clutter the Internet with millions of unsolicited emails – are constantly on the prowl for unprotected Sendmail servers, which they can use to launch their spam campaigns. 45
  46. 46. Mail Server SPAM - Sendmail • If you don’t protect your server, sooner or later a spammer will coax your computer into spending almost all its time sending out the spammer’s e-mail. • To protect your server from becoming an indentured spam servant, you can configure it to refuse any mail that merely wants to use your computer to relay messages to other computers. 46
  47. 47. 47