Mail Server Setup

[Home] [Resume] [Work Responsibilities] [Search Page] [IT Menu]

 

Mail Protocols
Using SMTP to send mail

Using POP3 to retrieve mail

Summary - Quick Configuration

Mail Protocols

We use the protocol SMTP to send mail and the POP3 protocol to retrieve it.  The reason SMTP is not used to retrieve the mail is due the resources it wastes trying to do so.  

SMTP is designed for hosts which are continually connected to the network. The SMTP darmon periodically examines the spool directory for new files and will actively attempt to upload it to the appropriate hosts.  It will continual to try a deliver these mails for a set period of time. As the majority of mail hosts are only intermittently connected to the network ( as with an ISP) this is a severe drain on its computing resources. This is where POP3 which is a passive "pull" protocol is better than the active "push" SMTP protocol.

 

Mail Contents

Using SMTP to send a mail - Mail is to be sent by the root user on host linuxwor to the user petecaro on host linuxser

  1. telnet linuxser.blairst 25
  2. HELO Linuxwor.blairst
  3. MAIL FROM: <root@linuxwor.blairst>
  4. RCPT TO: <petecaro@linuxser.blairst>
  5. DATA
  6. From: System Admin
    To: petecaro
    Subject:  A test mail
    Reply to: root@linuxwor.blairst
    The is the section to type is the full contents of the message
    .
  7. QUIT

Mail Contents

 

Using POP3 to retrieve a mail - This is done at the recipients computer Linuxser

  1. Telnet localhost 110         - Connects the user to the POP3 service
  2. USER petecaro                - User provides his username
  3. PASS password               - User provides his password
  4. LIST                                - Lists the messages in the users mailbox
  5. RETR 2                            - Retrieves message number 2
  6. DELE 2                            - Deletes message number 2

  7. QUIT

The messages are stored in /var/spool/mail/username

The fact is that users will not be telneting servers to send mail.  An edited configuration file (sendmail.cf) will be employed to direct sent mails to the chosen mail server on directly to the recipients. 

In the case of a user who sends mail via an ISP, the ISP's hostname and domain will be entered into this file.

Mail Contents

 

Summary - Quick Configuration - Configure the linuxwor host to both send mail via the SMTP service to the Linuxser host and retrieve mail from Linuxser using POP3. 

  1. Locate the sendmail.cf file on the sending host Linuxwor. find / -name sendmail.cf
  2. Edit /etc/sendmail.cf and make the following changes
  3. Change the line beginning DM to the login identifier that the ISP would have assigned to the user.  DMpetecaro@linuxser.blairst.  Make sure that the user account is exactly the same on both the workstation machine and the pretend ISP server.
  4. Change the line beginning DS to DSesmtp:linuxser.blairst 
  5. To configure inetd so that it invokes sendmail to process mail arriving via SMTP, insert the following line into file /etc/inetd.conf:
    smtp     stream    tcp     nowait   root    /usr/sbin/tcpd      sendmail  -v
  6. Restart the inetd daemon to force it to re-read its configuration file, as follows:  
    Type command  ps -ax  |  grep inetd.   This will show you information about the inetd process.  The first number displayed shows the process identifier.  Type command
    Kill processid.  Type command /usr/sbin/inetd to restart the process.
  7. Configure fetchmail. On the receiving machine create a file named .fetchmailrc in the home directory of the user petecaro. Insert the following text:
    poll linuxser.blairst protocol POP3 user petecaro with password password
  8. To protect the contents of this file set the permissions.  chmod 600 .fetchmailrc
  9. Type fetchmail to run the file.
  10. We may have to create a script file to invoke the fetchmail
    fetchmail  -f   /path to the location of the /fetchmail.rc   -syslog
  11. Use a text base browser to test the configuration.  Type elm.

Mail Contents

 

The Basic Installation Installation and Configuration The Setup Program  
The GUI Configuration   Configuring the network Web Serving Using Apache 
Installing and configuring Samba Domain Name Server  Setup  
Mail Server Setup Berkeley Remote Command Setup