Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Linux Operations and Administration Chapter Twelve Configuring a Mail Server Objectives • Identify key elements in the Linux e-mail architecture • Describe how MTAs and MUAs are used in the Linux mail system • Configure a mail server in YaST Linux Operations and Administration 2 Introduction to the Linux Mail System • E-mail predates the Internet • Today, e-mail is the most widely used Internet service • OpenSUSE includes sophisticated e-mail programs – Such as Evolution and Kmail • In Linux environment, e-mail is modular – A separate program is used to manage each function Linux Operations and Administration 3 Introduction to the Linux Mail System (cont’d.) Figure 12-1 The Linux e-mail architecture © Cengage Learning 2013 Linux Operations and Administration 4 Introduction to the Linux Mail System (cont’d.) • Two main types of programs typically used on a Linux e-mail server: – Mail transfer agent (MTA) • A program for receiving and delivering messages via Simple Mail Transfer Protocol • In Linux, the MTA is often Postfix or sendmail – Mail user agent (MUA) • An e-mail program that enables users to access their mailboxes for reading and sending electronic messages • Examples: Evolution, KMail, command-line utility mail Linux Operations and Administration 5 Introduction to the Linux Mail System (cont’d.) • Simple Mail Transfer Protocol (SMTP) – TCP/IP protocol that defines how e-mail is sent across the network • Postfix – Default MTA in openSUSE Linux Operations and Administration 6 Introduction to the Linux Mail System (cont’d.) • When MTA receives the message from MUA: – It determines whether the message is intended for a recipient on local domain or a recipient on another domain – If it’s on the local domain (example.com): • MTA saves the message in local machine’s message store until the recipient reads it – For a recipient on another domain: • MTA sends the message via SMTP to a remote MTA Linux Operations and Administration 7 Mail Transfer Agents • MTA – Actual mail server – Responsible for: • Receiving e-mails from local users • Forwarding them to a local message store or a remote MTA • Messages are transferred from the local message store to users via mail delivery agent (MDA) – Protocols which can be used for the transfer: • Post Office Protocol (POP3) • Internet Message Access Protocol (IMAP) Linux Operations and Administration 8 Mail Transfer Agents (cont’d.) • Process of an MTA sending messages not belonging to local domain to a remote MTA isn’t automatic – Your domain’s DNS settings must be configured correctly – MTA needs to be able to establish a connection with the remote MTA Linux Operations and Administration 9 Sendmail • Sendmail – Most widely used MTA on UNIX/Linux systems – Not the preferred MTA on openSUSE Linux systems • Postfix – Preferred MTA • Ease of configuration, reliability, and security Linux Operations and Administration 10 Sendmail (cont’d.) • In most organizations, employees need to send email to many other domains • You can edit Sendmail configuration file to: – Change the MTA behavior to allow multiple domains – Set rules, such as message filters • Sendmail is a large program compared with other mail programs – It performs all MTA functions Linux Operations and Administration 11 Qmail • • • • • Written by Dan Bernstein A fast, modular MTA Lightweight, secure, and reliable Designed with security and ease of use in mind Easier to configure – Such as allowing multiple domains • Multiple modules handle qmail’s MTA functions – Each no bigger than 30 KB Linux Operations and Administration 12 Postfix • Developed by Wietse Venema • Default MTA package on openSUSE Linux systems • Designed as a modular MTA • Easier to configure, and more reliable and secure than sendmail • Its modular design enhances security – Each module has its own set of permissions to follow the guideline of least privileges Linux Operations and Administration 13 Mail User Agents • MUA – An e-mail program that enables users to send and read messages stored in their mailboxes • In the Linux e-mail system: – Each user has a local mailbox – Local MTAs send messages to users’ mailboxes – MUA doesn’t actually receive messages • It allows users to read messages that have already been placed in mailboxes Linux Operations and Administration 14 Mail User Agents (cont’d.) • MUAs can store messages in one of two ways – Method 1 • Messages are stored on users’ computers • Frees up space on the server – Method 2 • Messages are stored on the mail server • Users can access them from any computer on the local domain Linux Operations and Administration 15 Mail User Agents (cont’d.) • Table 12-1 – Describes four MUA packages included with openSUSE • All these packages can use both methods of storing messages Linux Operations and Administration 16 Mail User Agents (cont’d.) Table 12-1 Common openSUSE Linux MUAs Linux Operations and Administration 17 Using Mailx • Example showing how to use mailx Linux Operations and Administration 18 Using Mailx (cont’d.) • Example: using mailx to read messages in mailbox: Linux Operations and Administration 19 Using Mailx (cont’d.) • Using mail command with no arguments displays all messages in mailbox • Table 12-2 – Describes common commands that can be entered at the interactive prompt • Activity 12-1: Using the Mailx Program – Send and display e-mails with the mailx program Linux Operations and Administration 20 Using Mailx (cont’d.) Table 12-2 Common mailx commands Linux Operations and Administration 21 Mail Server Configuration • Configuration procedures differ depending on the Linux distribution • With openSUSE Linux, you can use a mail server configuration utility in YaST Control Center to perform configuration tasks, including: – Enable virus scanning – Define the type of network connection MTA uses to determine how e-mail is delivered – Configure an outbound mail server that’s used if you have a dial-up connection or aren’t connected to the Internet Linux Operations and Administration 22 Mail Server Configuration (cont’d.) – Define masquerade name for outgoing e-mail • Useful for companies that prefer using a more professional name than actual mail server name – Configure incoming mail options, such as: • • • • • Firewall settings Root mailbox account Whether to accept mail from remote servers Local alias accounts Virtual domains Linux Operations and Administration 23 The Mail Server Configuration Wizard • Root user can start Mail Server Configuration Wizard • yast2 mail command is used to start wizard • Following sections describe the steps in wizard Linux Operations and Administration 24 General Settings • Can use General Settings window to specify network connection type – Determines how MTA delivers messages – Default option is “Permanent” • Selecting this option allows Postfix (the MTA) to send messages in real time as they’re created Linux Operations and Administration 25 General Settings (cont’d.) – Dial-up option • For Linux machines that connect to the Internet via a dial-up connection • Forces users to queue outbound mail server manually when they’re ready to send or receive messages • Example: – To e-mail a user on a remote computer, you must use sendmail -q command after sending your message Linux Operations and Administration 26 General Settings (cont’d.) – “No connection” option • For Linux machines that don’t have access to the Internet • Users with this option can e-mail each other only on local machines • Can also use General Settings window to enable virus scanning with AMaViS program – AMaViS stands for A Mail Virus Scanner Linux Operations and Administration 27 General Settings (cont’d.) Figure 12-2 The General Settings window © Cengage Learning 2013 Linux Operations and Administration 28 Outgoing Mail • Outgoing Mail window is used to configure dial-up connections by: – Adding your ISP’s SMTP server, such as smtp.provider.com – Clicking Authentication button to enter authentication credentials • MTAs can send messages to remote MTAs – If your mail server is connected to the Internet, you can leave outgoing mail server entry blank Linux Operations and Administration 29 Outgoing Mail (cont’d.) • When you send e-mails, your full computer name is used in the name field – Example: • [email protected] • Most companies prefer to have the organization name displayed – To do this: • Click the Masquerading button • Set a display name for each user on the network Linux Operations and Administration 30 Outgoing Mail (cont’d.) Figure 12-3 The Outgoing Mail window © Cengage Learning 2013 Linux Operations and Administration 31 Incoming Mail • Accept remote SMTP connections option – This check box is disabled if: • If your computer isn’t directly connected to the Internet • You have a dial-up connection – Select this option if: • If you’re connected to the Internet directly – If you select this option, you must configure firewall settings • Need to select Open Port in Firewall check box Linux Operations and Administration 32 Incoming Mail (cont’d.) Figure 12-4 The Incoming Mail window © Cengage Learning 2013 Linux Operations and Administration 33 Incoming Mail (cont’d.) • Downloading section – If a company hosts e-mail on a server that isn’t connected directly to its networks: • Enter remote server’s credentials in Downloading section – Protocols that can be used to transfer e-mail from a remote MTA: • POP3—Post Office Protocol 3 (POP3) • IMAP—Internet Message Access Protocol (IMAP) Linux Operations and Administration 34 Incoming Mail (cont’d.) • “Forward root’s mail to” text box – Root user account has full access to all Linux machines on a network – Logging in to mail server as a regular user with limited permissions is recommended – You can redirect system e-mails to your regular user account by entering your username in “Forward root’s mail to” text box Linux Operations and Administration 35 Incoming Mail (cont’d.) • Delivery Mode drop-down list – Options • Directly • Through procmail • To Cyrus IMAP Server • Aliases button – Used for redirecting e-mail to a different local user or a list of local users • Virtual domains button – Used to create an alias for your domain name Linux Operations and Administration 36 Incoming Mail (cont’d.) • If you selected masquerading option in Outgoing Mail window: – You should configure a domain alias • Activity 12-2: Configuring a Mail Server – Configure a mail server to send e-mail from a user on one computer to a user on another computer Linux Operations and Administration 37 Incoming Mail (cont’d.) Figure 12-5 The Forwarder Settings window © Cengage Learning 2013 Linux Operations and Administration 38 Summary • E-mail is based on standard protocols for sending, storing, and receiving electronic messages • Mail transfer agent delivers messages between systems via Simple Mail Transfer Protocol • Mail user agent is the mail application users run to access mailboxes and send and receive e-mail • SMTP is the standard protocol for sending e-mail across a network • Sendmail is the most widely used MTA on Linux systems •LinuxPostfix is the preferred MTA in openSUSE Operations and Administration 39 Summary (cont’d.) • • • • • Qmail is a modular MTA KMail and Evolution are two graphical MUAs Mailx is a command-line MUA Fetchmail is a text-based MUA Can configure settings for an openSUSE mail server with YaST Mail Server Configuration Wizard • POP3 and IMAP are client/server protocols for receiving e-mail • Procmail: to filter and sort incoming e-mail • Cyrus: a type of IMAP server Linux Operations and Administration 40