- Easy Linux - Lesson 8 - Email Server October 2007 Contents 1 Summary 2 2 Theoretical presentation 2 2.1 Introduction............................... 2 2.2 SMTP................................... 2 2.3 functionalities......................... 2 2.3.1 Intranet functionalities..................... 3 2.3.2 External Functionalities..................... 3 2.4 More information............................. 4 3 Exercises 4 3.1 Individual................................. 4 3.2 Group................................... 5 3.2.1 Kaspersky Anti-Virus/Anti-Spam............... 7 4 Achieved purposes 8
Easy Linux - - 2 1 Summary SMTP server: functionalities; SMTP server working; Relay server - DNS and static routes; Anti-Virus and Anti-Spam. 2 Theoretical presentation 2.1 Introduction Todays session will be entirely dedicated to the electronic mail service. The service responsible for the email sending will be presented, and its basic working shall be explained. The email functionalities in will be focused, namely: rows management, alternative addresses, mail route, automatic answers, distribution lists, search of mail in the ISP (Fetchmail) and mail copy. The aspects relating security shall also be focused: Anti-Virus, Anti-Spam, internal receivers and senders. 2.2 SMTP The electronic mail is without a doubt the most used network service in the Internet, earning more and more space to communication by conventional mail service or FAX. The protocol responsible for the remittance of electronic messages is SMTP (Simple Mail Transfer Protocol), which runs in port 25 TCP. Basically, it allows sending mail to one or more receivers, and it is implemented by MTA s (Mail Transfer Agents). The MTA used by is Qmail 1. The SMTP allows only sending the messages, and the users must use an email client that supports the protocols that have as a purpose to download the messages from servers - POP3/IMAP. In the attached Scheme 1 we can see a flowchart about the SMTP protocol working. 2.3 functionalities One of the most important concepts to take into account in the mail server configuration is the open relay. A server working in open relay, processes messages between sending and receiving addresses out of the servers domain, and it is possible that they dont even exist. Obviously, doesnt acts as an open relay, and it only guides emails from the Internet to domains specifically indicated. In the web interface in.i - Email there are the following fields: Locally delivered domains: The domains that the server locally serves for all the emails that enter in this server to one of these domains (*@domain_that _the_machine_serves) the server will locally search an mail box, and if there isnt any, it shall return an error message in Mailbox here by that name; 1 http://cr.yp.to/qmail.html
2.3 functionalities Easy Linux - - 3 Authorized relay domains: forwards all the messages that have their domains in this list and will be accepted by the server to a queue list. Messages to other recipients that don t belong to this domains won t be accepted by the server; Relay networks definitions: All the messages proceeding from these IP networks will be guided by the server. Here should be listed only the company private IP networks; SMTP Routes: Indication of the SMTP server through which the messages to domains that the machine does not serve will be guided - the routes could be specified by domain or they could be global (they do not explain the domain). And in.i - E-Mail - Definitions: General Definitions: SMTP server particular configurations; SSL certificate settings: Settings for the secure connections: Valid internal recipients: Email addresses accepted by the server; Invalid senders: (blacklisted). Email addresses without authorisation to send email 2.3.1 Intranet functionalities In.I - E-mail there are the following functionalities: Queues Management: It allows to visualise in real time which messages are queuing in the server; Users Management: Provides a centralized management for each user email account of the system and you can configure Mailing Lists: A mailing list allows sending emails in a 1 to N philosophy; Kaspersky Anti-Virus: After the insertion of a license, it is possible to use the specific Anti-Virus software for MTAs; Kaspersky Anti-Spam: After the insertion of a license, it is possible to use the specific Anti-Spam software for MTAs. 2.3.2 External Functionalities In.C - E-mail there are two specific functionalities to the exterior, and the remaining ones are also common for the Intranet: Advanced Relay: Permit the email forwarding based on non-existent recipients and also by domain (catchall); Get mail from ISP: it allows to download periodically email messages through POP3/ IMAP from an external server in ISP. Mail Copy: This functionality has as a purpose to save all the electronic mail messages entering and leaving the LAN, in two specific accounts: sentmail and receivedmail.
2.4 More information Easy Linux - - 4 2.4 More information Reference Manual for 4.2-4.C; 3 Exercises Technical server file: Accesses: Name: server# Domain: easylinux.com IP (eth0): 192.168.10.#/ 24 192.168.10.0 192.168.10.255 INTERFACE LOGIN PASS Console operator easy root hard Web ipbadmin a Base Menus: E-Mail:.I/C - E-Mail - Configure 3.1 Individual The student must connect his/her laptop to eth0 with a crossed cable. This exercise has as a purpose the familiarisation with the mail functionalities directed to the LAN: Fill the servers technical file; Insert a user in with your personal data, as well as the following ones: Name: John Smith Login: jsmith@easylinux.com Name: Mark David Login: mdavid@easylinux.com Configure an email client (Outlook/Thunderbird) in your workstation in order to add these accounts, or http://webmail.easylinux.com. Go to E-Mail base menu and click Definitions: Limit the global maximum size of a sending message to 1MByte; Place as a single valid internal recipient the user John Smith. Be default the list is empty meaning that all recipients are valid; Place as an invalid receiver the user Mark David; Test these configurations exchanging emails between LAN users. After that empty the lists Valid internal recipients and Invalid serders; In menu E-Mail - Users Management click in the user Mark David and:
3.2 Group Easy Linux - - 5 Define this alternative address: markdavid@easylinux.com; Define an automatic response; Limit the message maximum size of a received message to 500Kbytes; Go to Mailing Lists and Insert a mailing list called training@easylinux.com, adding to it all Internal Users; Test all these configurations exchanging emails between LAN users; 3.2 Group Each work group will do the management of two email server with distinct objectives: one will be the internal mail server; the other will do only the mail relay. The network topology is the following one: Internal email server technical file (.I): (# = Group 1 - Includes Student 1 and 2) (# = Group 2 - Includes Student 3 and 4) (# = Group 3 - Includes Student 5 and 6) Name: intranet# Domain: easylinux#.com IP (eth0): 192.168.#.1/ 24 192.168.#.0 192.168.#.255 DNS forwarder: 192.168.#.2 DNS : Register a machine relay# with IP 192.168.#.2 DHCP: enable 192.168.#.2 (option router) Email relay technical file (.C):
3.2 Group Easy Linux - - 6 (# = Group 1 - Includes Student 1 and 2) (# = Group 2 - Includes Student 3 and 4) (# = Group 3 - Includes Student 5 and 6) Name: relay# Domain: easylinux#.com IP (eth0): 192.168.#.2/ 24 192.168.#.0 192.168.#.255 IP (eth1): 172.16.10.#/ 24 172.16.10.0 172.16.10.255 Gateway: 172.16.10.100 (eth1) DNS forwarder: 172.16.10.100 DNS name resolution: 192.168.#.1 DHCP: disable Accesses: INTERFACE LOGIN PASS Console operator easy root hard Web ipbadmin a Figure 1: Topology to implement by group - Internal mail server and mail relay After implementing the individual network topology in Figure 1 follow this steps: Replace the base settings; Configure the technical file for both servers and check that everything is ok.
3.2 Group Easy Linux - - 7 Configure the following mail definitions:.c -> E-Mail.I: - Locally delivered domains must have: intranet#.easylinux#.com easylinux#.com - SMTP routes: Domain: (empty) SMTP route: relay#.easylinux#.com.c: - Locally delivered domains must have only: relay#.easylinux#.com - SMTP routes: Domain: (empty) SMTP route: 172.16.10.100 Domain: easylinux#.com SMTP route: intranet#.easylinux#.com Go to.c - E-Mail - Definitions and change the option Reject emails from invalid domains to No; Test the working of the internal servers and relay, switching mails between all the groups and sending to Internet; 3.2.1 Kaspersky Anti-Virus/Anti-Spam 1. Insert the available Anti-Spam license file in.i (Menu.C - E-Mail - Kasp. Anti-Spam); 2. Insert the available Anti-Virus license file in.c and.i (Menu.C - E-Mail - Kasp. Anti-Virus) and update settings; 3. In both servers go to Anti-Virus menu, click Configure and change the Notify to address field; 4. In.C go to Anti-Spam menu, click Configure and customize this options: In Policies - Group Policy - Rules, modify the Detection Level to Maximum; In Policies - Group Policy - Actions, modify the Send message to: field. Must be a local mailbox, because all the Spam must stay in the.c! In Policies - Common, you can insert some WAN addresses in Blacklist and Whitelist.
Easy Linux - - 8 4 Achieved purposes 1. What is an e-mail; 2. functionalities: Rows management, alternative addresses, mail guiding, automatic answers, distribution lists, fetchmail, mail copy, Anti- Virus and Anti-Spam; 3. Valid internal receivers and invalid senders concept; 4. How does SMTP service work; 5. The email relay server; 6. Anti-Virus working; 7. Anti-Spam working; 8. Linux mail server diagnostic.