[Home] [Resume] [Work Responsibilities] [Search Page] [IT Menu]
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
- telnet linuxser.blairst 25
- HELO Linuxwor.blairst
- MAIL FROM: <root@linuxwor.blairst>
- RCPT TO: <petecaro@linuxser.blairst>
- DATA
- 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
.- QUIT
Mail Contents
Using POP3 to retrieve a mail - This is done at the recipients computer Linuxser
- Telnet localhost 110 - Connects the user to the POP3 service
- USER petecaro - User provides his username
- PASS password - User provides his password
- LIST - Lists the messages in the users mailbox
- RETR 2 - Retrieves message number 2
DELE 2 - Deletes message number 2
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.
- Locate the sendmail.cf file on the sending host Linuxwor. find / -name sendmail.cf
- Edit /etc/sendmail.cf and make the following changes
- 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.
- Change the line beginning DS to DSesmtp:linuxser.blairst
- 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- 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.- 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- To protect the contents of this file set the permissions. chmod 600 .fetchmailrc
- Type fetchmail to run the file.
- We may have to create a script file to invoke the fetchmail
fetchmail -f /path to the location of the /fetchmail.rc -syslog- Use a text base browser to test the configuration. Type elm.
Mail Contents