Linux Administration

Linux Administration

Posted on

E-mail process on red hat linux

  • Introducing SMTP
  1. MTA sends messages, but all messages are sent between MTAs using SMTP.
  1. SMTP is the TCP/IP protocol for transferring e-mail messages between computers on a network.
  1. SMTP specifies message movement between MTAs, by the path the message takes i.e. Messages may go directly from the sending to the receiving MTA or through other MTAs on other network computers.
  1. These other computers briefly store the message before they forward it to another MTA, if it is local to the MTA, or to a gateway that sends it to an MTA on another network.
  1. The SMTP protocol can transfer only ASCII text. It can’t handle fonts, colors, graphics, or attachments.
  1. If you want to be able to send these items, you need to add another protocol to SMTP.
  1. The protocol you need is called Multipurpose Internet Mail Extensions, or MIME, MIME enables you to add colors, sounds, and graphics to your messages while still enabling them to be delivered by SMTP. In order for MIME to work, you must have a MIME-compliant MUA.
  • Understanding POP3
  1. POP3 is the Post Office Protocol version 3, this protocol runs on a server that is connected to a network and continuously sends and receives mail.
  1. The POP3 server stores any messages it receives, POP3 was developed to solve the problem of what happens to messages when the recipient is not connected to the network.
  1. Without POP3, the message could not be sent to the recipient if the recipient were offline, But with POP3, when you want to check your e-mail, you connect to the POP3 server to retrieve your messages that were stored by the server.
  1. After you retrieve your messages, you can use the MUA on your PC to read them. Of course, your MUA has to understand the POP3 to be able to communicate with the POP3 server.
  1. The messages you retrieve to your PC are then typically removed from the server. This means that they are no longer available to you if you want to retrieve them to another PC.
  • Understanding IMAP4

The Internet Message Access Protocol version 4 (IMAP4) provides much more sophisticated email-handling functionality than SMTP or POP3 do. IMAP4 has more features. IMAP4 enables you to store email on a networked mail server, just as POP3 does.

The difference is that POP3 requires you to download your email before your MUA reads it, whereas IMAP4 enables your email to reside permanently on a remote server, from which you can access your mail. And you can do so from your office, your home, your PDA, your cell phone, or anywhere else. Your MUA must understand IMAP4 to retrieve messages from an IMAP4 server.

Note: POP3 and IMAP4 don’t interoperate. While there are email clients and servers that speak both protocols, you can’t use a POP3 client to communicate with an IMAP4 server or an IMAP4 client to communicate with a POP3 server. When you configure an email server, you must decide whether your users need POP3 or IMAP4 functionality (or both). IMAP4 servers usually require much more disk space than POP3 servers because the email remains on the mail server unless the users or system administrator delete it.

  • Using the Postfix Mail Server
  1. Postfix is a mail transport agents used every day at sites that handle thousands and tens of thousands of messages per day.
  1. The best part is that Postfix is fully compatible with Sendmail at the command level.
  1. The similarity is deliberate, for Postfix was designed to be a high-performance, easier-to-use replacement for Sendmail.

Switching to Postfix

  1. By default, Fedora Core and RHEL use Sendmail, Switching to Postfix is simple, but before doing so, stop Sendmail:
    # service sendmail stop
  1. The next step is to make sure the Postfix is installed
    $ rpmquery postfix
    postfix—2.2.2-2

Configuring Postfix

  1. The configuration file is /etc/postfix/main.cf . The following variables need to be checked or edited
    1. Domain name:

mydomain =example.com

  1. Local machine domain:

myhostname=coondog.example.com

  1. Domain name appended to unqualified addresses
    myorigin=$mydomain
    This causes all mail going out to have your domain name appended.
  1. The mydestination variable tells Postfix what addresses it should deliver locally.

mydestination=$myhostname, localhost, localhost.$mydomain

  1. Postfix supports a larger number of configuration variables than the four just listed, but these are the mandatory changes you have to make.
  2. Create or modify /etc/aliases file : At the very least, you need aliases for Postfix, postmaster, and root in order for mail sent to those addresses to get to a real person.

Example :

postfix: root

postmaster: root

root: bubba

  1. After creating or modifying the aliases file, regenerate the alias database using Postfix’s new aliases command.
    /usr/sbin/newaliases
  1. The last step is to start Postfix:

# service postfix start

Starting postfix: [ OK ]

Make sure that Postfix will start when you boot the system. This should be taken care of by the MTA switching tool, but it never hurts to double-check.

You can use the chkconfig commands shown in the following example:

# chkconfig –levels 0123456 sendmail off

# chkconfig –levels 0123456 postfix off

# chkconfig –levels 2345 postfix on

Finally, modify your syslog configuration to handle Postfix log messages

appropriately.

following entries in /etc/syslog.conf, which controls the system log:

*.info;*.!warn;authpriv.none;cron.none;mail.none; -/var/log/messages

*.warn;authpriv.none;cron.none;mail.none; -/var/log/syslog

mail.*;mail.!err -/var/log/mail.log

mail.err -/var/log/mail.err

Naturally, you have to restart syslogd syslogd to cause these changes to take  effect:

# service syslog restart

  • Serving Email with POP3 and IMAP
  • Windows systems used as desktop network clients ordinarily do not have an MTA of their own. Such systems require email access using IMAP or POP3.

Setting up an IMAP Server                        

  1. The IMAP implementation configured here is the Dovecot IMAP server.
  2. First make sure Dovecot package is installed.
  1. The following rpmquery command shows you whether Dovecot package is installed. If not, install the dovecot package before proceeding:
    # rpmquery dovecot
    dovecot -0.99.14-4.fc4
  2. Configure the dovecot service to start when the system boots
    Use the following commands to start dovecot at boot time:
    chkconfig –levels 0123456 dovecot off
    chkconfig –levels 345 dovecot on
  3. Connect to the IMAP server, again using telnet:
    $ telnet localhost imap
    Trying 127.0.0.1…
    Connected to localhost.localdomain (127.0.0.1)
    logout
  4. Test the server, connect to the POP3 server as a mortal user using telnet
    $ telnet localhost pop3
    try ….
    connected to localhost.localdomain
    +OK dovecot ready.
    quit
    +OK Logging out

2

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Advertisements

Linux Administration

Posted on

How to Setup sendmail server on red hat linux

Email Delivery Process :

  • Mail User Agent (MUA)
  1. To be able to send mail, you, or your users, need a program called a Mail User Agent (MUA). The MUA, also called a mail client, enables users to write and read mail messages.
  1. Two types of MUAs are available: a graphical user interface (GUI), such as Netscape Messenger, and a command-line interface, such as Pine.
  • Mail Transfer Agent (MTA)
  1. Whether your MUA is a GUI or command-line interface, after the message is composed, the MUA sends it to the mail transfer agent (MTA).
  1. The MTA is the program that sends the message out across the network and does its work without any intervention by the user.
  • The MTA installed by default on your Red Hat system is called Sendmail.
  1. The MTA reads the information in the To section of the e-mail message and determines the IP address of the recipient’s mail server.
  1. Then the MTA tries to open a connection to the recipient’s server through a communication port, typically port 25.
  1. If the MTA on the sending machine can establish a connection, it sends the message to the MTA on the recipient’s server using the Simple Message Transfer Protocol (SMTP).
  • Local Delivery Agent (LDA)
  1. After the LDA receives the message from the MTA, it places the message in the receiver’s mailbox file that is identified by the username.
  1. On your Red Hat system this is a program called procmail. The location of the user’s mailbox file is
    /usr/ spool/mail/<user’s name>.
  • The final step in the process happens when the user who is the intended receiver of the message reads the message. The user does this using the MUA on his or her PC.
  • Mail Notifier
  • An optional program is a mail notifier that periodically checks your mailbox file for new mail. If you have such a program installed, it notifies you of the new mail.
  • If new mail has arrived, the shell displays a message just before it displays the next system prompt. It won’t interrupt a program you’re running.
  • You can adjust how frequently the mail notifier checks and even which mailbox files to watch.
  • If you are using a GUI, there are mail notifiers available that play sounds or display pictures to let you know that new mail has arrived.
  • Configuring Sendmail:

3

4

2

Now send mail from user kiranmail to clientmail

Command is:

3

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Linux Administration

Posted on

1

To check package is installed or not the command is:

2

3

4

1

2

2

1

3

4

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Linux Administration

Posted on Updated on

Important commands for NFS

  showmount -e : Shows the available shares on your local machine

  showmount -e <server-ip or hostname>: Lists the available shares at the remote server

  showmount -d : Lists all the sub directories

  exportfs -v : Displays a list of shares files and options on a server

  exportfs -a : Exports all shares listed in /etc/exports, or given name

  exportfs -u : Unexports all shares listed in /etc/exports, or given name

  exportfs -r : Refresh the server’s list after modifying /etc/exports

NFS server configuration commands:

#rpm –qa | grep nfs

#ifconfig

#pwd

[root@nfsserver ~]# mkdir /nfsshare

#cd nfsshare

#touch f1 f2 f3

#vi /etc/exports

            Edit the file with line:

                        /root/nfsshare client’s ip address(rw,sync,no_root_squash)

   Save file.

NFS Options

Some other options we can use in “/etc/exports” file for file sharing is as follows.

  1. ro: With the help of this option we can provide read only access to the shared files i.e client will only be able to read.
  2. rw: This option allows the client server to both read and write access within the shared directory.
  3. sync: Sync confirms requests to the shared directory only once the changes have been committed.
  4. no_subtree_check: This option prevents the subtree checking. When a shared directory is the subdirectory of a larger file system, nfs performs scans of every directory above it, in order to verify its permissions and details. Disabling the subtree check may increase the reliability of NFS, but reduce security.
  5. no_root_squash: This phrase allows root to connect to the designated directory.

#service nfs restart

Setting Up the NFS Client

After configuring the NFS server, we need to mount that shared directory or partition in the client server.

Mount Shared Directories on NFS Client

Now at the NFS client end, we need to mount that directory in our server to access it locally. To do so, first we need to find out that shares available on the remote server or NFS Server

root@nfsclient ~]# showmount -e 192.168.0.100

Export list for 192.168.0.100:/nfsshare 192.168.0.101

Note: here 192.168.0.100 is server’s ip address while 192.168.0.101 is client’s ip address.

Above command shows that a directory named “nfsshare” is available at “192.168.0.100” to share with your server.

Mount Shared NFS Directory

To mount that shared NFS directory we can use following mount command.

root@nfsclient ~]# mount -t nfs 192.168.0.100:/nfsshare           /mnt/nfsshare

The above command will mount that shared directory in “/mnt/nfsshare” on the client server. You can verify it following command.      

[root@nfsclient ~]# mount | grep nfs sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)nfsd on /proc/fs/nfsd type nfsd (rw)192.168.0.100:/nfsshare on /mnt type nfs (rw,addr=192.168.0.100)

 

The above mount command mounted the nfs shared directory on to nfs client temporarily, to mount an NFS directory permanently on your system across the reboots, we need to make an entry in “/etc/fstab“.

Testing NFS mount:

#cd /mnt/nfsshare

#ls

f1 f2 f3

Removing the NFS Mount

If you want to unmount that shared directory from your server after you are done with the file sharing, you can simply unmount that particular directory with “umount” command. See this example below.

root@nfsclient ~]# umount /mnt/nfsshare

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com