Ops 535 A 2
Ops 535 A 2
Ops 535 A 2
Documentation Assignment 2 OPS535 By: Andrew Greene Student # 027993047 Professor: Raymond Chan
Table of Contents
NETWORK TOPOLOGY ........................................................................................................................................... 3 IP ADDRESSING SCHEME ........................................................................................................................................ 3 ADDING MX RECORDS TO DNS .............................................................................................................................. 4 SETTING UP POP3/IMAP SERVER ON VM3 ............................................................................................................. 4 CONFIGURING DOVECOT TO USE POP ................................................................................................................... 4 TESTING / TROUBLE SHOOTING DOVECOT LOCALLY .............................................................................................. 4 TESTING / TROUBLE SHOOTING DOVECOT REMOTELY ........................................................................................... 6 INSTALLING/CONFIGURING SENDMAIL .................................................................................................................. 6 TROUBLESHOOTING SMTP SERVER ........................................................................................................................ 7 SETTING UP USERS MAILBOXES USING NFS VIA VM2............................................................................................. 9 ADDING NEW EMAIL USER TO YOUR DOMAIN ...................................................................................................... 9 INSTALLING SQUIRRELMAIL ................................................................................................................................. 10 TESTING SQUIRRELMAIL ...................................................................................................................................... 11 IS THE PROBLEM ON THE SERVER?....................................................................................................................... 11 IS THE PROBLEM WITH THE NETWORK? .............................................................................................................. 12 IS THE PROBLEM WITH THE LOCAL EMAIL CLIENT? .............................................................................................. 13 RPM PACKAGES REQUIRED .................................................................................................................................. 13 SERVICES REQUIRED FOR THIS EMAIL SYSTEM FUNCTION ................................................................................... 14
Network Topology
IP Addressing Scheme
DNS Server VM1 Network ID: 192.168.8.0 Subnet Range: 192.168.8.1 192.168.8.254 Subnet Mask: 255.255.255.0 IP Address: 192.168.8.53 NFS Server VM2 Network ID: 192.168.8.0 Subnet Range: 192.168.8.1 192.168.8.254 Subnet Mask: 255.255.255.0 IP Address: 192.168.8.2 NIS & POP3 / IMAP Server VM3 Network ID: 192.168.8.0 Subnet Range: 192.168.8.1 192.168.8.254 Subnet Mask: 255.255.255.0 IP Address: 192.168.8.3
Once the following records have been added you will need to restart the named service for the changes to take effect: Run the following command to restart DNS: Service named restart
Network Configuration Page |5 If the service is running you will want to test connectivity locally: Open a terminal then run the following commands [root@mail ~]# telnet localhost pop3 +OK dovecot ready. user vm3mail +OK pass password +OK Logged in. list +OK 1 messages: 1 622 . retr 1 +OK 622 octets Return-Path: vm3mail@mail.aplus.ca X-Original-To: vm3mail Delivered-To: vm3mail@mail.aplus.ca Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mail.aplus.ca (Sendmail) with SMTP id 943284B43 for <johndoe>; Thu, 22 Feb 2007 09:06:37 -0500 (EST) Message-Id: 20120222140640.943284B43@mail.aplus.ca Date: Thu, 3 Apr 2012 09:06:37 -0500 (EST) From: vm3mail@mail.vm3.aplus.ca To: undisclosed-recipients:; X-IMAPbase: 1172153557 1 Status: O X-UID: 1 Content-Length: 5 X-Keywords: test . quit +OK Logging out. Connection closed by foreign host. [root@vm3 ~]# After sending the test email if you do not receive it you should check the /var/log/maillog for errors pertaining to the email you sent. Andrew Greene #027993047 OPS535
Installing/Configuring Sendmail
You will need to download the following packages in order to configure send mail properly sendmail and sendmail-cf: Yum install sendmail Yum install sendmail-cf After you have installed the required packages you will need to find and change the following files located in the /etc/mail/ directory:
Edit the /etc/mail/sendmail.cf file with the following line # SMTP daemon options O DaemonPortOptions=Port=smtp,Name=MTA # who I masquerade as (null for no masquerading) (see also $=M) DMaplus.ca
Edit the /etc/mail/sendmail.mc file with the following line dnl # The following example makes mail from this host and any additional dnl # specified domains appear to be sent from mydomain.com dnl # MASQUERADE_AS(`aplus.ca')dnl
Network Configuration Page |7 Edit the /etc/mail/local-host-names file with the following line # local-host-names - include all aliases for your machine here. mail.aplus.ca aplus.ca
Edit the /etc/mail/access file with the following line # by default we allow relaying from localhost... Connect:localhost.localdomain RELAY Connect:localhost RELAY Connect:127.0.0.1 RELAY After you have configured all of the files previously mentioned you will need to Rebuild the file using either the Makefile in the configuration directory or by issuing the command m4 sendmail.mc > /etc/sendmail.cf then you will need to restart the sendmail service on all of the virtual machines: Service sendmail restart Next you will want to make this service start up by default on the next boot: Chkconfig sendmail on
Network Configuration Page |8 Open a command line and type telnet mailserver.mydomain.com 25 A sendmail server will answer with a following similar output: 220 mailserver.mydomain.com ESMTP Sendmail 8.13.8+Sun/8.13.8; Mon, 21 Apr 2008 11:36:17 +0200 (CEST) When you type the ?help? command the available commands the mail server understands are listed: 214-2.0.0 This is sendmail version 8.13.8+Sun 214-2.0.0 Topics: 214-2.0.0 HELO EHLO MAIL RCPT DATA 214-2.0.0 RSET NOOP QUIT HELP VRFY 214-2.0.0 EXPN VERB ETRN DSN STARTTLS 214-2.0.0 For more info use HELP . 214-2.0.0 To report bugs in the implementation contact Sun Microsystems 214-2.0.0 Technical Support. 214-2.0.0 For local information send email to Postmaster at your site. 214 2.0.0 End of HELP info Try the following to send an e-mail from the command line: helo clienthostname.mydomain.com 250 clienthostname.mydomain.com Hello clienthostname.mydomain.com [129.159.231.54], pleased to meet you mail from:myname@mydomain.com 250 2.1.0 myname@mydomain.com Sender ok rcpt to:recepientname@recepientdomainname.com 250 2.1.5 recepientname@recepientdomainname.com Recipient ok data 354 Enter mail, end with . on a line by itself
subject: This is a test to:recepientname@recepientdomainname.com This contains the BODY of a test mail . 250 2.0.0 m3L9aH0W018247 Message accepted for delivery quit 221 2.0.0 mailserver.mydomain.com closing connection Note the dot (.) at the end of the mail body.
If this test succeeds (mail is delivered to its final destination) you most likely have a configuration issue on your mail client. 5. If the underlying operating system allows you to analyze the network traffic on the network interface(s) (using ethereal, wireshark, netcap, tcpdump, snoop, etc) t ry to capture the network traffic while trying to send a mail form the mail client. Analyze if there is SMTP traffic between your client and the mail server.
Then run the following command to update your exports information: Exportfs a You should now be allowed to mount that directory from vm3 on vm2 Mounting the vm3 /var/spool/mail directory on vm2 with the following command: mount -t nfs 192.168.8.2:/var/spool/mail /var/spool/mail You will also need to edit the /etc/fstab file with the above information if you want the directory to be mounted automatically next time your system boots up.
N e t w o r k C o n f i g u r a t i o n P a g e | 10 You should note that if your /etc/default/useradd file has not been updated to use the NFS shared directory you will need to add some options to the useradd command Useradd -d home_dir Next you will need to update the NIS maps info to include the new users you have just created. Running the following command to update NIS: /var/yp/Makefile Once the updates have been made you can confirm that the user has been created by running the following command from vm1 or vm2: Ypcat passwd
Installing Squirrelmail
You will need to download the squirrelmail package in order to use webmail Yum install squirrelmail Then you will need to start the httpd service with the following command: Service httpd start Next you will want to make this service start up by default on the next boot: Chkconfig httpd on Then you will need to configure send by running the following command /usr/share/squirrelmail/config/conf.pl Type in D and press Enter to select the Set pre-defined settings for specific IMAP servers menu. Type in dovecot and press Enter. Then type in 2 and press Enter and select the server settings menu. After that you type in 1 and press Enter to select the Domain menu. Type in your domain name and press Enter. Save your changes and quit when you are done. The final thing to do is set the SELinux rules use the following commands: setsebool httpd_can_network_connect on setsebool httpd_can_sendmail on Andrew Greene #027993047 OPS535
N e t w o r k C o n f i g u r a t i o n P a g e | 11
Testing Squirrelmail
Click the browser icon at the top near the System menu to launch the Firefox web browser. In the address box, type in http://localhost/webmail/src/configtest.php and press Enter. Check for any errors. In the address box, type in http://localhost/webmail and press Enter. Type in a valid username and password and click Login.
N e t w o r k C o n f i g u r a t i o n P a g e | 12
N e t w o r k C o n f i g u r a t i o n P a g e | 13
N e t w o r k C o n f i g u r a t i o n P a g e | 14 Sednmail-cf Squirrelmail