الثلاثاء، 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.



الاثنين، 15 يونيو 2009

What Is Linux Fedora

Fedora is directly descended from one of the most popular Linux distributions everRedHat Linux. Those of you who know nothing about Linux might have heard of Red Hat; itis enough to know that it is the largest Linux vendor in North America. Fedora benefitsdirectly from many Red Hat engineers as well as the wider contributions from free soft-ware developers across the world

السبت، 13 يونيو 2009

continue in command lines

Working with Compressed Files
Another file management operation is compression and decompression of files, or the
creation, listing, and expansion of file and directory archives. Linux distributions usually
include several compression utilities you can use to create, compress, expand, or list the
contents of compressed files and archives. These commands include the following

. bunzip2—Expands a compressed file
. bzip2—Compresses or expands files and directories
. gunzip—Expands a compressed file
. gzip—Compresses or expands files and directories
. shar file—Creates a shell archive of files
. tar—Creates, expands, or lists the contents of compressed or uncompressed file or
directory archives known as tape archives or tarballs
Most of these commands are easy to use. The tar command, however, has a somewhat
complex (although capable) set of command-line options and syntax. Even so, you can
quickly learn to use tar by remembering a few simple invocations on the command line.
For example, to create a compressed archive of a directory, use tar’s czf options like this


tar czf dirname.tgz dirname

The result is a compressed archive (a file ending in .tgz) of the specified directory (and all
files and directories under it). Add the letter v to the preceding options to view the list of
files added during compression and archiving. To list the contents of the compressed
archive, substitute the c option with the letter t, as follows
:
$ tar tzf archive

Of course, if many files are in the archive, a better invocation (to easily read or scroll
through the output) is the following:


$ tar tzf archive | less
To expand the contents of a compressed archive, use tar’s zxf options, like so:

$ tar zxf archive
The tar utility decompresses the specified archive and extracts the contents in the current
directory.

الخميس، 11 يونيو 2009

quick start with commands

Understanding the Command Line
Hang around Linux users for any length of time and it
won’t be long before you hear them speak in hushed tones
about the command line or the terminal. Quite rightly, too,
because the command line offers a unique and powerful
way to interact with Linux. However, for the most part,
you may never need to access the command line because
Fedora offers a variety of graphical tools that enable you to configure most things on your system.

Navigating Through the File System
Use the cd command to navigate through the Fedora file system. This command is gener-
ally used with a specific directory location or pathname, like this:
$ cd /usr/share/doc
Under Fedora, the cd command can also be used with several shortcuts. For example, to
quickly move up to the parent (higher-level) directory, use the cd command like this:
$ cd ..
To return to one’s home directory from anywhere in the Linux file system, use the cd
command like this:
$ cd
You can also use the $HOME shell environment variable to accomplish the same thing.
Type this command and press Enter to return to your home directory:
$ cd $HOME
You can accomplish the same thing by using the tilde (~) like this:
$ cd ~


Another important command to use is the ls command, which lists the contents of the
current directory. It’s commonly used by itself, but a number of options (or switches)
available for ls give you more information. For instance, the following command returns
a listing of all the files and directories within the current directory, including any hidden
files (denoted by a . prefix) as well as a full listing, so it will include details such as the
permissions, owner and group, size, and last modified time and date:
$ ls -al
You can also issue the following command:
$ ls -R
This command scans and lists all the contents of the subdirectories of the current direc-
tory. This might be a lot of information, so you might want to redirect the output to a
text file so that you can browse through it at your leisure by using the following:
$ ls alR > listing.txt


Basic Linux Directories

Name 
/
/bin
/boot
/dev
/etc
/home
/initrd
/lib
/lost+found
/media
/mnt
/opt
/proc
/root
/sbin
/selinux
/sys
/tmp
/usr
/var       
Managing Files with the Shell

. cat filename—Outputs contents of filename to display
. less filename—Allows scrolling while reading contents of filename
. mv file1 file2—Renames file1 to file2
. mv file dir—Moves file to specified directory
. cp file1 file2—Copies file1 and creates file2
. rm file—Deletes file
. rmdir dir—Deletes directory (if empty)
. grep string file(s)—Searches through files(s) and displays lines containing
matching string