الثلاثاء، 16 يونيو 2009

Installing and running a mail server on Linux


In this article we 'll show how to make an easy mail server on Linux... it's to easy and thanks comes to Linux .


How Email Is Sent and Received
Email is transmitted as plain text across networks around
the world using SMTP (Simple Mail Transfer Protocol). As the
name implies, the protocol itself is fairly basic, and it has
been extended to add further authentication and error
reporting/messaging to satisfy the growing demands of
modern email. Mail transfer agents, or MTAs, work in the
background, transferring email from server to server, allowing
emails to be sent all over the world. You might have
come across such MTA software such as Sendmail, Postfix,
Fetchmail, Exim, or Qmail.

"and we can see from the figure on the top how the " e-mail sequence

:but befor installing we must know

MUA (mail user agent)The MUA is the component of the mail system that most users think of as the e-mail program. It's responsible for providing the interface used to enter the two parts of an e-mail. An MUA often provides user features such as an address book and a spelling checker. The MUA is also responsible for handing the message off to the MTA.

MTA (mail transfer agent)The MTA is the component of the mail system that most users never see. It takes the message provided by the MUA, decodes the header information to determine where the message is going, and delivers the message to the MTA on the receiving machine. The MTA on the receiving machine adds data to the header of the received e-mail message

LDA (local delivery agent)—The LDA is the component of the mail system that takes a received message from the MTA and appends the message to the receiving user’s incoming mailbox.

In order for the MTAs on various machines to pass e-mail traffic, they must know where to find each other and how to communicate. The MTA decodes the receiving address and uses the portion to the right of the @ sign to find the proper machine. Internet services such as DNS are used to determine how to route to the decoded address

Once the route has been determined, an MTA needs to know how to communicate to another MTA. This is accomplished using SMTP, a standards-based method that mail servers use for communication. All mail servers understand and respond to the limited set of commands that are defined in the standard.

When two MTAs communicate, they use a service port. Service ports are reserved ports on each machine where applications listen for commands. In the case of MTAs, port 25 is the standard port used. Service ports are generally reserved in the /etc/services file. When you use the grep command to find the ports used, you'll see something like this:

# grep smtp /etc/services

smtp 25/tcp mail # Simple Mail Transfer

smtp 25/udp mail # Simple Mail Transfer
Configuring sendmail

# ps -ef | grep post

root 1078 1 0 Jul20 ? 00:00:07 /usr/lib/postfix/master

postfix 1082 1078 0 Jul20 ? 00:00:02 qmgr -l -t fifo -u

postfix 29291 1078 0 02:38 ? 00:00:00 pickup -l -t fifo –u
Configuring the mail server

the following assumptions apply:

  • You have a full-time Internet connection
  • This machine is the outgoing mail server.
  • This machine is the incoming mail server.
  • Only users of this machine will be using it for e-mail services.

From the initial YAST screen, choose Network Services. From the list of Network Services, choose Mail Transfer Agent. It will take a minute or two for YAST to read all the necessary information about the installed mail server and to determine the installation options available.

The first three options on the Connection Type screen—Permanent, Dial-up, and No Connection—are mutually exclusive, so choose the appropriate one for the installation. A Permanent connection is where the mail server is always connected to the Internet; a Dial-up connection requires a step to connect to the Internet; and No Connection means no connection to the Internet, so only local mail can be sent and delivered.

The last option on the Connection Type screen, Enable Virus Scanning (AmaViS), is an add-on feature that allows both inbound and outbound mail to be checked for viruses. For this example, choose Permanent, leave the virus option disabled, and then press Next.

The next screen, Outgoing Mail, allows you to enter the outbound mail server, but since this article assumes the local machine is the outgoing mail server, you don’t need to enter anything here. The Masquerading option allows mail to always appear to come from a central machine, instead of from the local machine. This is useful in situations such as a company that would like all e-mail to appear as:

user@company.com

Without masquerading, e-mail would appear as:

user@localmachine.company.com

Many users prefer standardized e-mail addresses, which allow you to use central virus checking and provide a way to have only one machine accessible via the Internet for mail.

The Domains For Locally Delivered Mail option lets you specify what mail will be delivered on this machine. List as many machine names or aliases as are available. For example, the machine may be known as Eastnj officially, but might have aliases such as Turnpike and Somerset. Adding all three will allow mail to be delivered to users at all of those addresses.

By using Masquerade Other Domains, you can have other domains send mail as if they belong to the master domain. This is useful in a situation such as corporate acquisitions, when you want to allow mail to arrive at the old company name, while translating any outgoing mail to the new company name.

The last option in the dialog box provides the ability to directly translate a user address to a standard address. For example, if the company standard is to use an e-mail address such as firstname.lastname@company.com, and the user name is firstname, it would be possible to add a translation from firstname@localmachine.company.com, so all of that user's e-mail is addressed properly.

For this article, we won't worry about masquerading. Choose OK to return to the Outgoing Mail screen. The Authentication option relates to the outgoing mail server and is not useful for this example.

Pressing Next brings up the Incoming Mail screen, which shows the options for accepting incoming mail messages. Since we're assuming this machine is the incoming mail server, check Accept Remote SMTP Connections to enable incoming mail.

When you click Finish, a dialog box will be presented for writing the configuration. Choose Continue. YAST will write the configuration to the system and restart the postfix daemon. Choose Quit to leave YAST. The mail system is now configured. It can be tested using the mailx utility from the command line or the KMail utility from the GUI.



ليست هناك تعليقات:

إرسال تعليق