Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Web Server Administration Chapter 8 Providing E-mail Services.

Similar presentations


Presentation on theme: "1 Web Server Administration Chapter 8 Providing E-mail Services."— Presentation transcript:

1 1 Web Server Administration Chapter 8 Providing E-mail Services

2 2 Overview Understand the e-mail environment Understand e-mail protocols Install and administer email for Linux Install and configure IMAP4 and POP3 servers for Linux Configure e-mail clients Understand Web-based e-mail clients

3 3 Understanding the E-mail Environment E-mail evolved from a variety of proprietary systems In the 1980s and 1990s, people often had e- mail addresses on a number of systems Even as late as 1997, Exchange 5.5 was not designed to take advantage of Internet e-mail An add-on gave Exchange the ability to send and receive e-mail over the Internet

4 4 Role of DNS in E-mail Systems A domain name, such as technowidgets.com, needs to be associated with two IP addresses One IP address can be for a Web site Another IP address is for e-mail To associate a domain name, or any other host name, with the IP address of an e-mail server, you need an MX record technowidgets.com. IN MX 10 mail.technowidgets.com. The 10 refers to the priority of the e-mail server if there are multiple e-mail servers

5 5 E-mail System Terminology MTA (Mail Transfer Agent) Accepts e-mail from clients and sends e-mail to another MTA for storage Postfix, sendmail MUA (Mail User Agent) E-mail client Outlook, Kmail, pine, Gmail, SquirrelMail MDA (Mail Delivery Agent) Delivers e-mail from server to MUA MDA part of Sendmail or Postfix, Dovecot

6 6 E-mail System Terminology Masquerading Replace actual host name with domain name Relaying The process of sending e-mail to an intermediate e-mail server before the message is transmitted to its final destination This should not be allowed from the Internet because spammers could use it to send e-mail Spammer Someone who sends unsolicited e-mail, typically to try to sell something

7 7 E-mail Protocols SMTP (Simple Mail Transfer Protocol) To send e-mail messages POP3 (Post Office Protocol) To retrieve e-mail Typically, all messages are downloaded to a client IMAP4 (Internet Mail Access Protocol) To retrieve e-mail E-mail stays on the server You can create folders on server to store e-mail

8 8 Understanding SMTP The commands are processed by the SMTP server Test Postfix CommandPurpose HELO Identifies the domain sending the message DATA Indicates the body of the message VRFY Verifies the e-mail user QUIT Ends the SMTP session

9 9 Understanding SMTP The SMTP headers add descriptive information HeaderDescription MAIL FROM: Identifies who is sending the message (required) RCPT TO: Identifies the recipient of the message (required) RECEIVED: Identifies the e-mail server that processed the message DATE: Indicates the date of the e-mail FROM: Shows the e-mail address as it is typically displayed in an e-mail client SUBJECT: Shows the subject of the e-mail message TO: Shows the recipient as it is typically displayed in an e-mail client CC: Sends copies of the message to a list of e-mail addresses BCC: Sends copies of the message to a list of e-mail addresses but does not display the e-mail addresses

10 10 Understanding SMTP Sample session Commands and headers in bold HELO WKS1 250 web1.technowidgets.com Hello [127.0.0.1] MAIL FROM: XYZ@yahoo.com 250 2.1.0 xyz@yahoo.com....Sender OK RCPT TO: cbranco@technowidgets.com 250 2.1.5 cbranco@technowidgets.com DATA 354 Start mail input; end with. This is a simple message. QUIT

11 11 Understanding POP3 More simplistic than IMAP4 First step is to log on with user name and password List, read, download, delete e-mail Test Dovecot

12 12 Common POP3 commands CommandDescription USER username Connects to POP3 server based on user name PASS password Enters the password for the user, as in PASS: Ax6yy LIST Displays the message number followed by the number of characters in the message UIDL Displays the unique ID for each message RETR n Replaces the n with a message number to retrieve that message TOP n lines Instead of retrieving the whole message, retrieves the number of lines designated by the lines parameter for message number n DELE n Deletes message number n from the server QUIT Ends the session

13 13 Sample POP3 Session- Major Components USER cbranco +OK PASS pass +OK User successfully logged on. LIST +OK 1 404 1 404. RETR 1 +OK Received: from WKS1 (127.0.0.1) by web1.technowidgets.com From: xyz@yahoo.com Return-Path: xyz@yahoo.com This is a sample message. DELE 1 +OK QUIT

14 14 Understanding IMAP4 Messages remain on server Requires much more space on server To keep track of the status of messages, flags are used \Recent \Seen \Answered \Flagged \Deleted \Draft

15 15 Common IMAP4 commands CommandDescription LOGIN username password Log on to the server with your user name and password, which are unencrypted. SELECT mailbox Select a mailbox before you perform mail tasks. The default mailbox is called inbox. The response gives a summary of mailbox information. FETCH message(s) item(s) Retrieve messages. The message(s) parameter gives the message number. The item(s) parameter determines what part of the message is fetched—that is, individual header items or the body of the text. STORE message(s) flags Change the flags associated with a message. Typically, this command is used to mark messages to be deleted, undeleted, or identified as unread. LOGOUT End the IMAP4 session.

16 16 Configuring E-mail Clients- Typical Information Required SMTP server IP address Your e-mail address Your e-mail password POP3 or IMAP4 server IP address

17 17 Web-based E-mail Clients Web-based e-mail clients allow you to use your browser SquirrelMail is a web-based e-mail service Most public sites use web-based email.

18 18 Web-based E-mail Clients- Advantages Because a browser is used, no client configuration is needed The lack of configuration can significantly reduce support costs No specialized client software is needed Users are not required to retrieve e-mail from specific computers that have been configured for them POP3 or IMAP4 protocols are not required, which reduces server-side support Because Web-based e-mail is not constrained by POP3 or IMAP4 protocols, a richer environment can be developed that extends beyond basic e-mail

19 19 Installing and Configuring Postfix, Dovecot, Squirrelmail Source: ostechnix.wordpress.com/2013/02/08/setup-mail-server-using-postfixdovecotsquirrelmail- in-centosrhelscientific-linux-6-3-step-by-step/ Remove sendmail yum remove sendmail Turn off firewall service iptables stop service ip6tables stop chkconfig iptables off chkconfig ip6tables off Disable Security Linux vi /etc/selinux/config … SELINUX=disabled

20 Installing Postfix yum install postfix Configure /etc/postfix/main.cf See slide “Configure Postfix” Start Postfix service service postfix start chkconfig postfix on Test Postfix See slide “Test Postfix” 20

21 Configure Postfix vi /etc/postfix/main.cf ##line no 75 - uncomment and enter your host name myhostname = mailserver1.yourdomain.edu ##line no 83 - uncomment and enter your domain name mydomain = yourdomain.edu ##line no 99 - uncomment myorigin = $mydomain ##line no 116 - change to all inet_interfaces = all ##line no 164 - add $domain at the end mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain $domain ##line no 264 - uncomment and add your network range mynetworks = 192.168.0.0/24, 127.0.0.0/8 ##line no 419 - uncomment home_mailbox = Maildir/ 21

22 Test Postfix – part 1 telnet localhost smtp Trying ::1... Connected to localhost. Escape character is '^]'. 220 server.ostechnix.com ESMTP Postfix ehlo localhost 250-server.ostechnix.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from: 250 2.1.0 Ok rcpt to: 250 2.1.5 Ok data 354 End data with. test. 250 2.0.0 Ok: queued as 117113FF18 quit 221 2.0.0 Bye Connection closed by foreign host. 22

23 Test Postfix – part 2 cd /home/user1/Maildir/new/ ls 1360236956.Vfd00I35afM181256.yourdomain cat 1360236956.Vfd00I35afM181256.yourdomain Return-Path: X-Original-To: user1 Delivered-To: user1@yourdomain.edu Received: from localhost (localhost [IPv6:::1]) by mailserver1.yourdomain.edu (Postfix) with ESMTP id 117113FF18 for ; Thu, 7 Feb 2013 17:05:32 +0530 (IST) Message-Id: Date: Thu, 7 Feb 2013 17:05:32 +0530 (IST) From: user1@yourdomain.edu To: undisclosed-recipients:; test 23

24 Install Dovecot yum install dovecot configure the following files (see slide “Configure Dovecot”) /etc/dovecot/dovecot.conf /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-master.conf Start Dovecot service service dovecot start chkconfig dovecot on Test Dovecot See slide “Test Dovecot” 24

25 Configure Dovecot vi /etc/dovecot/dovecot.conf protocols = imap pop3 lmtp vi /etc/dovecot/conf.d/10-mail.conf ##line no 24 – uncomment mail_location = maildir:~/Maildir vi /etc/dovecot/conf.d/10-auth.conf ##line no 9 - uncomment and change from yes to no. disable_plaintext_auth = no ##line no 97 - add the text "login“ auth_mechanisms = plain login vi /etc/dovecot/conf.d/10-master.conf unix_listener auth-userdb { #mode = 0600 user = postfix ##line no 83 - uncomment and enter postfix group = postfix ##line no 84 - uncomment and enter postfix 25

26 Test Dovecot telnet localhost pop3 Trying ::1... Connected to localhost. Escape character is '^]'. +OK Dovecot ready. user user1 +OK pass user1 +OK Logged in. list +OK 1 messages: 1 428. retr 1 +OK 428 octets Return-Path: X-Original-To: user1 Delivered-To:user1@yourdomain.edu Received: from localhost (localhost [IPv6:::1]) by mailserver1.yourdomain.edu (Postfix) with ESMTP id 117113FF18 for ; Thu, 7 Feb 2013 17:05:32 +0530 (IST) Message-Id: Date: Thu, 7 Feb 2013 17:05:32 +0530 (IST) From: user1@yourdomain.edu To: undisclosed-recipients:; test. quit +OK Logging out. Connection closed by foreign host. 26

27 Install SquirrelMail Install EPEL repository wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpmhttp://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm Install SquirrelMail Yum –y install Squirrelmail reStart webservices service httpd restart chkconfig httpd on Configure SquirrelMail See slide “Configure Squirrelmail” Test SquirrelMail See slide “Test SquirrelMail” 27

28 Configure Squirrelmail Edit the Squirrelmail configurations cd /usr/share/squirrelmail/config/./conf.pl Select option 1 – set organization details Select option 2 – enter domain name and SMTP in item 3 Save and quit Edit httpd.conf – adding an alias at the end of the file vi /etc/httpd/conf/httpd.conf Alias /squirrelmail /usr/share/squirrelmail Options Indexes FollowSymLinks RewriteEngine On AllowOverride All DirectoryIndex index.php Order allow,deny Allow from all 28

29 29 Summary E-mail has evolved over the years Microsoft Exchange 2000 and sendmail are the two of the most popular e-mail server products DNS plays a central role in messaging Three major protocols are involved in e- mail SMTP, POP3, and IMAP4


Download ppt "1 Web Server Administration Chapter 8 Providing E-mail Services."

Similar presentations


Ads by Google