+ All Categories
Home > Education > Linux10 sendmail

Linux10 sendmail

Date post: 18-May-2015
Category:
Upload: jainul-musani
View: 535 times
Download: 0 times
Share this document with a friend
Description:
Linux Sendmail
Popular Tags:
47
Mail Server 1
Transcript
Page 1: Linux10 sendmail

Mail Server

1

Page 2: Linux10 sendmail

E-Mail BasicsLinux provides e-mail servers, which communicate with end-user systems and with other e-mail servers to manage your e-mail needs.

Mail Server

2

Page 3: Linux10 sendmail

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

Mail Server

Page 4: Linux10 sendmail

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

Mail Server

Page 5: Linux10 sendmail

The transport agent is also responsible for accepting mail at the receivers end.

5

Mail Server

Page 6: Linux10 sendmail

The delivery agent receives mail from the transport agent and deliver it to the actual user’s address.

6

Mail Server

Page 7: Linux10 sendmail

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

Mail ServerSMTP(Simple Mail Transfer Protocol)

Page 8: Linux10 sendmail

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

Mail ServerSMTP(Simple Mail Transfer Protocol)

Page 9: Linux10 sendmail

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

Mail ServerSMTP(Simple Mail Transfer Protocol)

Page 10: Linux10 sendmail

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

Mail ServerPOP (Post Office Protocol)

Page 11: Linux10 sendmail

The POP and IMAP protocols can be used by the local e-mail clients to retrieve their e-mail from a remote server.

11

Mail ServerPOP (Post Office Protocol)

Page 12: Linux10 sendmail

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 Web-based mail servers such as Gmail.

12

Mail ServerPOP (Post Office Protocol)

Page 13: Linux10 sendmail

Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind.

13

Mail ServerDovecot

Page 14: Linux10 sendmail

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

Mail ServerDovecot

Page 15: Linux10 sendmail

Most prominent (noticeable) features

1)Dovecot is among the highest performing IMAP servers while still supporting the standard mbox and Maildir formats.

15

Mail ServerDovecot

Page 16: Linux10 sendmail

Most prominent (noticeable) features

2) Dovecot's indexes are self-optimizing.

They contain exactly what the user's client commonly needs, no more and no less.

16

Mail ServerDovecot

Page 17: Linux10 sendmail

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

Mail ServerDovecot

Page 18: Linux10 sendmail

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

Mail ServerMIME(multipurpose internet mail extension)

Page 19: Linux10 sendmail

There is a separate protocol which handles these attachments MIME-multipurpose internet mail extension.

MIME extends the definition of mail to include binary files and multiple data format in single message.

19

Mail ServerMIME(multipurpose internet mail extension)

Page 20: Linux10 sendmail

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

Mail ServerMIME(multipurpose internet mail extension)

Page 21: Linux10 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

(Microsoft Exchange Server)21

Mail ServerRunning Sendmail

Page 22: Linux10 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

(Microsoft Exchange Server)22

Mail ServerRunning Sendmail

Page 23: Linux10 sendmail

Quickly find out whether Sendmail is installed on your system by entering the following command from a shell prompt:

$ rpm –q sendmail

23

Mail ServerInstalling Sendmail

Page 24: Linux10 sendmail

If Sendmail has been installed, the package version is displayed. If not, the message ‘package sendmail is not installed’ is displayed.

24

Mail ServerInstalling Sendmail

Page 25: Linux10 sendmail

Check that m4 is installed by running command

$ rpm –q m4Check that sendmail –c4 is installed by running the command

$ rpm –q sendmail –c4

25

Mail ServerInstalling Sendmail

Page 26: Linux10 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

Mail ServerInstalling Sendmail

Page 27: Linux10 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.(The Package Manager window opens)

27

Mail ServerInstalling Sendmail

Page 28: Linux10 sendmail

3) Click Forward4) Scroll down the list and select

Mail Server.

5) Click Forward.

28

Mail ServerInstalling Sendmail

Page 29: Linux10 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

Mail ServerInstalling Sendmail

Page 30: Linux10 sendmail

To install Sendmail manually,$ rpm –ivh /mnt/cdrom/RedHat/RPMS/sentmail*

30

Mail ServerInstalling Sendmail

Page 31: Linux10 sendmail

• Sendmail - one of the most difficult program to configure that you will ever encounter.

• In fact, the basic configuration file, sendmail.cf is over 1000 lines long.

• You don’t want to mess with this file if you can possibly avoid it.

31

Mail ServerModifying sendmail.mc

Page 32: Linux10 sendmail

• The sendmail.cf configuration file is generated automatically from a much shorter file called senndmail.mc.

• This file contains special macros that are processed by a program called m4.

32

Mail ServerModifying sendmail.mc

Page 33: Linux10 sendmail

• The m4 program reads the macros in the sendmail.mc file and expands them to create the actual sendmail.cf file.

• Even so, the sendmail.mc file is a new hundred lines long.

33

Mail ServerModifying sendmail.mc

Page 34: Linux10 sendmail

You can find the sendmail.mc and sendmail.cf files in the

/etc/mail directory.Before you edit these files, you should make backup copies of the current files.

34

Mail ServerModifying sendmail.mc

Page 35: Linux10 sendmail

you can regenerate the sendmail.cf file by commands:

$ cd /etc/mail$ m4 sendmail.mc > sendmail.cf

$ server sendmail restart

35

Mail ServerModifying sendmail.mc

Page 36: Linux10 sendmail

First command changes the current working directory to /etc/mail.

Second command compiles the sendmil.mc command into the sendmail.cf command.

Third command restarts the Sendmail service so that the changes will take effect.

36

Mail ServerModifying sendmail.mc

Page 37: Linux10 sendmail

Two strange conventions used in the sendmail.mc 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(`mydomain.com’)

37

Mail ServerModifying sendmail.mc

Page 38: Linux10 sendmail

Two of the more common configuration changes that you may need to make sendmail.mc:

38

Mail ServerModifying sendmail.mc

Page 39: Linux10 sendmail

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 sendmail.mc file:

DAEMON_OPTIONS(

`Port-smtp.Addr=127.0.0.1,

Name=MTA’)dnl39

Mail ServerModifying sendmail.mc

Page 40: Linux10 sendmail

2) Masquerading/hidden/concealed allows all the mail being sent from your domain to appear as if it came from the domain (for example, [email protected]) rather than from the individual host (i.e. [email protected]).

40

Mail ServerModifying sendmail.mc

Page 41: Linux10 sendmail

To enable masquerading, add lines similar to these:

MASQUERADE_AS(`cleaver.net’)dnlFEATURE (masquerade_envelope)dnlFEATURE

(masquerade_entire_domain)dnlMASQUERADE_DOMAIN(`cleaver.net’)dnl

41

Mail ServerModifying sendmail.mc

Page 42: Linux10 sendmail

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 [email protected] and have all mail sent to that account delivered to a user named willie.

42

Mail ServerSetting up aliases

Page 43: Linux10 sendmail

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

Mail ServerSetting up aliases

Page 44: Linux10 sendmail

For example, here’s a virturusers file that defines several aliases:

[email protected] willie

[email protected] [email protected] robertAfter you make changes, you should restart the Sendmail service.

44

Mail ServerSetting up aliases

Page 45: Linux10 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

Mail ServerSPAM - Sendmail

Page 46: Linux10 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

Mail ServerSPAM - Sendmail

Page 47: Linux10 sendmail

Thank You !!

47


Recommended