------------------------- Week 10 Notes for NET2003 ------------------------- -Ian! D. Allen - idallen@idallen.ca - www.idallen.com Remember - knowing how to find out an answer is more important than memorizing the answer. Learn to fish! RTFM! (Read The Fine Manual) Keep up on your readings (Course Outline: average 5 hours/week homework). A good way to memorize the material is to take notes in class and then merge your notes with my published note summaries after class. You won't be able to Google search during tests and exams. * Abbreviation "ALN" = your "Advanced Linux Networking" text by R.W.Smith Free O'Reilly Safari eBook Resources (from an Algonquin network address): http://proquest.safaribooksonline.com/ Review: Week 9 notes The second Midterm test (25%) takes most of your lab period this week. ---------------------------------------------------------------------------- Internet Protocols ------------------ * Text-based Internet Protocols - many use plain-text-based negotiations that you can snoop easily - Unix always preferred text file formats over binary formats - Unix has text logging and many tools for massaging text streams * The netcat "nc" TCP/IP "Swiss Army Knife" program: - a "pure" way to connect your keyboard with a remote TCP/IP daemon - similar to "telnet", except it doesn't try to auto-negotiate first - useful for connecting directly to many text-based Internet protocols: - to save the output, run a "script" terminal session HTTP: Hyper Text Transfer Protocol RFC: http://tools.ietf.org/html/rfc2616 see Notes file http_session.txt SMTP: Simple Mail Transfer Protocol RFC: http://tools.ietf.org/html/rfc2821 see Notes file smtp_session.txt POP3: Post Office Protocol Version 3 RFC: http://tools.ietf.org/html/rfc1939 see course text ALN p.263 http://www.electrictoolbox.com/article/networking/pop3-commands/ (ALN: course text "Advanced Linux Networking" by Roderick W. Smith) - try using this on your Algonquin account inmail.algonquincollege.com NNTP: Network News Transport Protocol RFC: http://tools.ietf.org/html/rfc977 see Notes file nntp_session.txt FTP: File Transfer Protocol - See Notes file: file_transfer.txt - be careful of the difference between FTP binary and text transfers! - also available under Windows in a console (DOS) window - FTP protocol is much harder to debug using nc or telnet, since FTP has two separate ports and streams (control and data). Q: T/F HTTP, SMTP, POP3, and NNTP are text-based Internet protocols that you can operate directly using a text program such as netcat. ------------------------------------------------------------------------------ see Notes: Mail Systems Terminology - mail_systems_terms.txt -------------------------------------------------------------------------------- Configuring POP3 - ALN Chapter 11 p.257 ---------------- POP and IMAP are MRA/MAA protocols. (ref. mail_systems_terms.txt) Q: What is the difference between a "Push" and a "Pull" mail protocol? p.257 Q: T/F: a pull mail server can operate without a working push server. p.257 Q: An enterprise mail system receives email (delivered via the SMTP push mail protocol). Describe two ways that office users can read this email. p.258 Q: What kind of mail server do I need to permit users to fetch and read mail from their own computers? p.259 Q: What happens if the push mail server (SMTP server) on a pull mail machine (POP3 server) fails? p.259 Q: Describe what "relay" means in a push mail (SMTP) protocol. p.259-260 Q: Why does a pull mail server need a larger disk than a pull mail server? top p.261 Q: What is the role of a pull mail server? p.261 Q: T/F: You must use the same host name for your push and pull mail servers. p.261 Q: Know how to connect to a POP3 server using netcat or telnet and verify that it's working. For examples and model POP3 sessions, see ALN p.263 and the above Internet links. Q: Describe briefly how POP and IMAP servers handle their email store. p.262, p.266-267 Q: T/F: POPmail requires more storage and bandwidth than IMAP. p.262, p.266-267 Q: T/F: default POP and IMAP mail servers carry userids, passwords, and email safely in encrypted form. p.267 Q: T/F: most POP servers are simple and require no configuration. p.267 Q: T/F: most POP/IMAP servers run under a "super-server" such as inetd/xinetd. p.269,p.270 ------------------------------------------------------------------------------- Configuring SMTP (Postfix) - ALN Chapter 19 p.507 ---------------- SMTP is an MTA protocol. (ref. mail_systems_terms.txt) https://help.ubuntu.com/community/Postfix Linux offers several SMTP (Mail Transfer Agent - MTA) programs. (The ALN text calls these mail delivery or "Push" protocols [p.477].) The most well-known is the ancient "sendmail" program whose configuration file "has traditionally been described as looking like an explosion in a punctuation factory". See a sample config file in the Notes: sendmailcf.txt Debian/Ubuntu Linux uses the more modern "Postfix" MTA. Q: T/F: an SMTP server is known as a Mail Transfer Agent ("MTA"). p.478 Q: What is the purpose of an MTA? p.478 Q: T/F: most Linux systems install an SMTP server by default. p.479 - Sendmail was the original. Postfix is a good replacement. p.480 - Describe the traditional Unix "mbox" mail format used by sendmail/Exim/Postfix? p.480-481 - Describe the new "maildir" mail format used by qmail. p.481 Q: What is a DNS "MX" record? p.481 The "host -t mx " command can list MX records for . You can also use "dig mx". Q: What command will show the MX records for a domain? - What are the MX records for algonquincollege.com? for idallen.org? Q: What purpose do the sequence numbers have in a set of MX records? p.482 - lowest first! Q: Describe the difference between "envelope headers", "message headers", and "message data". p.482-483 Q: Know how to connect to an SMTP server using netcat or telnet and verify that it's working. For examples and model SMTP sessions, see ALN p.483 and Class Notes file smtp_session.txt Q: T/F: the message headers are optional and can be omitted; the email will still be delivered. p.483 Q: T/F: the envelope headers must match the message headers. p.484 Skip "SMTP Server Configuration Options" p.485-491 Skip "Basic Sendmail Configuration " p.491-499 Skip "Basic Exim Configuration " p.499-507 Read "Basic Postfix Configuration" p.507-515 Postifx is the default MTA for Ubuntu. Q: What is a big advantage of the Postfix config file over sendmail's config file? p.507 - Text Update p.508: The fully commented postfix default config file is now named "main.cf.dist" and may be stored elsewhere than /etc/postfix/ (e.g. /usr/share/postfix/main.cf.dist). The main.cf file contains only the few lines that change the default postfix operation. p.508 Q: Which Postfix config file is usually modified (absolute path)? p.508 Note how the main.cf file refers to other config files, such as aliases. Q: What Postfix file usually contains system-wide mail aliases? p.508 Alias files are usually stored in a binary database format, for speed. Q: How do you generate the binary .db files from the text files? p.508 Postfix comes with its own control command that lets you affect how the postfix system operates. Q: What is the name of the postfix command-line control program? p.509 (top) (Only the super-user can use this.) Q: How is the Postfix server usually started/stopped? p.509 (top) - Does the start-up script for postfix run the postalias command? (Go look!) Q: Which Postfix parameter controls the hostnames that postfix treats as "local" and for which it will receive mail? p.510-511 Q: How do you continue a long line in the postfix config file? p.511 Q: Which Postfix parameters control the hostnames/networks that postfix will allow to relay email through this host? p.511-512 Note: See alsto "mynetworks_style" in more recent versions of Postfix. Q: What Postfix parameter sets the name of a "smart" SMTP relay host? p.512 Q: What is the difference between "the hosts that I will permit to relay via this host" and "the host to which I relay all email (smart host)"? Useful commands: "mailq" - show the queue of outgoing messages. "postfix reload" - reload most of the config file parameters (see log) "postfix check" - check your postfix installation "postfix set-permissions" - fix permissions in your postfix installation "postconf" - Postfix configuration utility (dumps or changes parameters) Q: What command shows the mail queue? Q: What command shows the current or default values of any Postfix configuration parameter (e.g. from main.cf)? Q: What command and syntax would you use to change the "relayhost" parameter to have the value "outmail.algonquincollege.com" ? (Note the man page suggests that [-ev] is optional, when it is not.) Postfix can deliver your email into your mailbox (acts as a MDA) using a built-in method, or by calling something like procmail to to do it. Procmail is an MDA program with a powrful (though cryptic) pattern-matching language for sorting and filtering mail messages. ALN p.515 Q: T/F Postfix can also act as an MDA and put email into your system mailbox. Q: What separate program is often used as a MDA by Linux MTAs?