Configuring Linux Mail Servers Objectives –This chapter will show you how to install and use Mailservers Contents –An Overview Of How Sendmail Works –Sendmail.

Slides:



Advertisements
Similar presentations
DMZ (De-Militarized Zone)
Advertisements

DMZ (De-Militarized Zone)
1 Dynamic DNS. 2 Module - Dynamic DNS ♦ Overview The domain names and IP addresses of hosts and the devices may change for many reasons. This module focuses.
SYSTEM ADMINISTRATION Chapter 19
Web Server Administration
Web Server Administration Chapter 4 Name Resolution.
DNS server & Client Objectives Contents
Configuring a Web Server. Overview  Understand how a Web server works  Install IIS (Internet Information Services) and Apache Web servers  Examine.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
What’s New in WatchGuard XCS 10.0 Update 3 WatchGuard Training.
DNS Setup DNS CONFIGURATION. DNS Configuration DNS Setup named daemon is used A DNS Server may be caching/master/slave server The named.ca file has information.
Pro Exchange SPAM Filter An Exchange 2000 based spam filtering solution.
中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap Four : Mail 王俊城RHCE/RHCX.
23 October 2002Emmanuel Ormancey1 Spam Filtering at CERN Emmanuel Ormancey - 23 October 2002.
UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.
Linux Operations and Administration
Sendmail configuration and installation Presented by kathleen.
1 Linux Networking and Security Chapter 3. 2 Configuring Client Services Configure DNS name resolution Configure dial-up network access using PPP Understand.
Mail Server Setup MAIL SERVER SETUP.
Linux+ Guide to Linux Certification, Third Edition
Va-scanCopyright 2002, Marchany Securing Solaris Servers Randy Marchany.
ADMINISTRATION HANDS-ON. Page 2 About the Hands-On This hands-on section is structured in a way, that it allows you to work independently, but still giving.
1 Web Server Administration Chapter 8 Providing Services.
LANDesk Management Gateway
Mail Server Three major components MTA MUA MDA Mail Transfer Agent
The Linux Operating System Lecture 7: Tonga Institute of Higher Education.
Chapter 10 Intro to Routing & Switching.  Upon completion of this chapter, you should be able to:  Explain how the functions of the application layer,
Final Lab - Spam Group 10: Scott Durr Stephen Thompson.
CSIE 1 Filtering mail Speaker: Chung yu Wu Adviser: Quincy Wu Date: 2005/12/07.
Connecting to Network. ♦ Overview ► A network connection is required to communicate with other computers when they are in a network. Network interface.
Chapter 10 Networking and the Internet ITSC 1458.
ISQS server attacks Presented by Deven Patel.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network Chapter 7: Domain Name System.
VsFTP in Linux. Introduction to FTP The File Transfer Protocol (FTP) is used as one of the most common means of copying files between servers over the.
Setting up NIS and HTTP. Network Information Service Reading: 1. Linux NIS HOWTO: howto/HOWTOhttp://
Configuring Linux Mail Servers
Samba Advanced System Administration Course James Lwali University computing Centre Ltd, University of Dar es salaam,
ITI-481: Unix Administration Meeting 3. Today’s Agenda Hands-on exercises with booting and software installation. Account Management Basic Network Configuration.
1 SCOoffice Server for OpenServer Technical Overview.
TELE 301 Lecture 10: Scheduled … 1 Overview Last Lecture –Post installation This Lecture –Scheduled tasks and log management Next Lecture –DNS –Readings:
Postfix Mail Server Postfix is used frequently and handle thousands of messages. compatible with sendmail at command level. high performance program easier-
Hour 7 The Application Layer 1. What Is the Application Layer? The Application layer is the top layer in TCP/IP's protocol suite Some of the components.
Linux Services Muhammad Amer. 2 xinetd Programs  In computer networking, xinetd, the eXtended InterNET Daemon, is an open-source super-server daemon.
Hands On Networking Network Applications Ram P Rustagi, ISE Dept Kundan Kumar, MCA Dept Manini Sahoor, MCA Dept Ravi Teja, MCA Dept Sourav.
1 Electronic Messaging Module - Electronic Messaging ♦ Overview Electronic messaging helps you exchange messages with other computer users anywhere in.
Proxy Server PROXY SERVER. What is a Web Proxy? Proxy Server A proxy is a host which relays web access requests from clients Used when clients do not.
Topics Sending an Multipart message Storing images Getting confirmation Session tracking using PHP Graphics Input Validators Cookies.
1 COP 4343 Unix System Administration Unit 14: – send and receive mail – mail filtering – mail server – mailing lists.
GATEWAY WITH PER-USER SPAM BLOCKING AND VIRUS SCANNING Greg Woods National Center for Atmospheric Research Scientific Computing Division Boulder,
General rules 1. Rule: 2. Rule: 3. Rule: 10. Rule: Ask questions ……………………. 11. Rule: I do not know your skill. If I tell you things you know, please stop.
Linux services troubleshooting. If you cannot connect to your service.. When you start service, check that it says ok (most services say that when starting.
INTRODUCTION Using Electronic one can send message to, can receive usages from other computer users anywhere in the world. is most common and.
CIS 192B – Lesson 2 Domain Name System. CIS 192B – Lesson 2 Types of Services Infrastructure –DHCP, DNS, NIS, AD, TIME Intranet –SSH, NFS, SAMBA Internet.
DNS server & Client Objectives –to learn how to setup dns servers Contents –An Introduction to DNS –How To Download and Install The BIND Packages –How.
Linux Operations and Administration
Linux Operations and Administration
Web Server Administration Chapter 6 Configuring a Web Server.
Web Server Administration Chapter 4 Name Resolution.
Linux Operations and Administration Chapter Twelve Configuring a Mail Server.
Chapter 4: server services. The Complete Guide to Linux System Administration2 Objectives Configure network interfaces using command- line and graphical.
Web Server Administration Chapter 6 Configuring a Web Server.
Understanding POP3 / IMAP Created by : Ashish Shah, J. M. Patel College of Commerce 1.
Chap-I Network and System Configuration in Linux
LINUX ADMINISTRATION
LINUX ADMINISTRATION 1
LINUX ADMINISTRATION 1
DHCP server & Client Objectives Contents
SUBMITTED BY: NAIMISHYA ATRI(7TH SEM) IT BRANCH
IIS.
has many aspects that work together to give people almost instant communication from any computer on the internet to any other computer There.
Presentation transcript:

Configuring Linux Mail Servers Objectives –This chapter will show you how to install and use Mailservers Contents –An Overview Of How Sendmail Works –Sendmail configruation files –Relaying –Sendmail Masquerading –Using Sendmail to Change the Sender's Address Practical –Setting up mailserver

Getting SENDMAIL Installing Sendmail –You will need to make sure that the sendmail, sendmail-cf and m4 software RPMs are installed. rpm –ivh sendmail i386.rpm(The client/server) rpm –ivh sendmail-cf i386.rpm(Config files) rpm –ivh sendmail-devel i386.rpm(Optional) rpm –ivh sendmail-doc i386.rpm(Optional) Starting/Stopping Sendmail –You can use the chkconfig command to get Sendmail configured to start at boot: –To start/stop/restart sendmail after booting –You need to restart sendmail after changing sendmail.cf # chkconfig sendmail on # service sendmail start # service sendmail stop # service sendmail restart # service sendmail start # service sendmail stop # service sendmail restart

The /etc/mail/sendmail.mc File How to Put Comments in sendmal.mc –The sendmail.mc file doesn't use the "#" for commenting, but instead uses the string "dnl". Configuring the DNS for sendmail –Make Your Mail Server The Mail Server For Your Domain in DNS Disabled statements due to "dnl" commenting dnl DAEMON_OPTIONS(`Port=smtp,Addr= , Name=MTA') dnl # DAEMON_OPTIONS(`Port=smtp,Addr= , Name=MTA') Incorrectly disabled statement # DAEMON_OPTIONS(`Port=smtp,Addr= , Name=MTA') Active statement DAEMON_OPTIONS(`Port=smtp,Addr= , Name=MTA') Disabled statements due to "dnl" commenting dnl DAEMON_OPTIONS(`Port=smtp,Addr= , Name=MTA') dnl # DAEMON_OPTIONS(`Port=smtp,Addr= , Name=MTA') Incorrectly disabled statement # DAEMON_OPTIONS(`Port=smtp,Addr= , Name=MTA') Active statement DAEMON_OPTIONS(`Port=smtp,Addr= , Name=MTA') IN MX 10mail.my-site.com # host mail.my-site.com mail.my-site.com has address # host mail.my-site.com mail.my-site.com has address

Sendmail & name resolution All hosts that are not the nameserver should have /etc/resolv.conf file like this: And incorrectly configured resolv.conf –file can lead to errors like this when running the m4 The /etc/hosts File must have loopback address domain my-site.com nameserver domain my-site.com nameserver WARNING: local host name (smallfry) is not qualified; fix $j in config file bigboy.my-site.com bigboy localhost.localdomain \ localhost

How To Configure Linux Sendmail All Linux mail clients in your home or company need to know which server is the mail server. –In /etc/mail/sendmail.mc file: Converting From a Mail Client to a Mail Server –Determine Which NICs Sendmail Is Running On –We can verify that sendmail is running by first using the pgrep command define(`SMART_HOST',`mail.my-site.com') # pgrep sendmail # netstat -an | grep :25 | grep tcp tcp : :* LISTEN # pgrep sendmail # netstat -an | grep :25 | grep tcp tcp : :* LISTEN

Convert the sendmail client to server Edit sendmail.mc To Make Sendmail Listen On All Interfaces dnl This changes sendmail to only listen on the loopback device dnl and not on any other network devices. Comment this out if you want dnl to accept over the network. -> dnl DAEMON_OPTIONS(`Port=smtp,Addr=mail.my-site.com, Name=MTA') dnl NOTE: binding both IPv4 and IPv6 daemon to the same port requires dnl a kernel patch dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6') dnl We strongly recommend to comment this one out if you want to protect dnl yourself from spam. However, the laptop and users on computers that do dnl not have 24x7 DNS do need this. -> dnl FEATURE(`accept_unresolvable_domains')dnl dnl FEATURE(`relay_based_on_MX')dnl dnl This changes sendmail to only listen on the loopback device dnl and not on any other network devices. Comment this out if you want dnl to accept over the network. -> dnl DAEMON_OPTIONS(`Port=smtp,Addr=mail.my-site.com, Name=MTA') dnl NOTE: binding both IPv4 and IPv6 daemon to the same port requires dnl a kernel patch dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6') dnl We strongly recommend to comment this one out if you want to protect dnl yourself from spam. However, the laptop and users on computers that do dnl not have 24x7 DNS do need this. -> dnl FEATURE(`accept_unresolvable_domains')dnl dnl FEATURE(`relay_based_on_MX')dnl

Convert the sendmail client to server Comment out the "SMART_HOST" Entry In sendmail.mc Regenerate The sendmail.cf File & Restart sendmail –This step can be accomplished by running the script we created at the beginning of the chapter. Now Make Sure Sendmail Is Listening On All Interfaces dnl define(`SMART_HOST',`mail.my-site.com') # netstat -an | grep :25 | grep tcp tcp : :* LISTEN # netstat -an | grep :25 | grep tcp tcp : :* LISTEN #./smmake

A General Guide To Using The sendmail.mc File Primary rule, nice and clean sendmail.mc with comments –Masquerade rewrites all mail from hosts to coming from domain –FEATURE adds functionallity to sendmail dnl ***** Customised section 1 start ***** Dnl FEATURE(delay_checks)dnl FEATURE(masquerade_envelope)dnl FEATURE(allmasquerade)dnl FEATURE(masquerade_entire_domain)dnl dnl dnl ***** Customised section 1 end ***** dnl ***** Customised section 1 start ***** Dnl FEATURE(delay_checks)dnl FEATURE(masquerade_envelope)dnl FEATURE(allmasquerade)dnl FEATURE(masquerade_entire_domain)dnl dnl dnl ***** Customised section 1 end *****

Sendmail feature files The /etc/mail/relay-domains File The /etc/mail/access File –Keywords include RELAY, REJECT, OK (not ACCEPT) and DISCARD The /etc/mail/local-host-names File –Also recieve mail from my other site –In DNS we need to enter: my-other-site.com my-site.com my-other-site.com my-site.com localhost.localdomain RELAY localhost RELAY RELAY RELAY RELAY RELAY my-site.com RELAY localhost.localdomain RELAY localhost RELAY RELAY RELAY RELAY RELAY my-site.com RELAY my-site.com my-other-site.com my-site.com my-other-site.com my-other-site.com. MX 10 mail.my-site.com.

Which User Should Really Receive The Mail? The /etc/mail/virtusertable file The /etc/aliases File Allways run command newaliases after working with aliases marc paul error:nouser User unknown marc paul error:nouser User unknown... manager: root abuse: root # trap decode to catch security attacks decode: root # Person who should get root's mail root: # My mailing list file admin-list: ":include:/home/mailings/admin-list"... manager: root abuse: root # trap decode to catch security attacks decode: root # Person who should get root's mail root: # My mailing list file admin-list: ":include:/home/mailings/admin-list"

Sendmail Masquerading Explained If you want your mail to appear to come from and not You can in that case: a)Configure your client, such as Outlook Express, to set your address to b)Set up masquerading to modify the domain name of all traffic originating from and passing trough your mail server Configuring masquerading –This can be solved by editing your sendmail.mc configuration file and adding some masquerading commands: FEATURE(always_add_domain)dnl FEATURE(`masquerade_entire_domain')dnl FEATURE(`masquerade_envelope')dnl FEATURE(`allmasquerade')dnl MASQUERADE_AS(`my-site.com')dnl MASQUERADE_DOMAIN(`my-site.com.')dnl MASQUERADE_DOMAIN(localhost)dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl FEATURE(always_add_domain)dnl FEATURE(`masquerade_entire_domain')dnl FEATURE(`masquerade_envelope')dnl FEATURE(`allmasquerade')dnl MASQUERADE_AS(`my-site.com')dnl MASQUERADE_DOMAIN(`my-site.com.')dnl MASQUERADE_DOMAIN(localhost)dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl

Sendmail Masquerading Explained Testing Masquerading –You should also tail the /var/log/maillog file to verify that the masquerading is operating Other Masquerading Notes –By default, user "root" will not be masqueraded. This is achieved with the: –in /etc/mail/sendmail.mc mail -v username EXPOSED_USER(`root')dnl

Using Sendmail to Change the Sender's Address Add these statements to your /etc/mail/sendmail.mc –In order to rewrite s origin address, you need some features: –In /etc/mail/sendmail.mc Create a /etc/mail/generics-domains Create your /etc/mail/genericstable FEATURE(`genericstable',`hash -o /etc/mail/genericstable.db')dnl GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')dnl FEATURE(`genericstable',`hash -o /etc/mail/genericstable.db')dnl GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')dnl my-site.com my-other-site.com bigboy.my-site.com my-site.com my-other-site.com bigboy.my-site.com #linux-username alert peter #linux-username alert peter

Fighting SPAM, add features RFC-Ignorant valid IP address checker. Easynet open proxy list. The Open Relay Database open mail relay list. Spamcop spammer blacklist. Spamhaus spammer blacklist. FEATURE(`dnsbl', `ipwhois.rfc-ignorant.org',`"550 Mail from " $&{client_addr} " refused. Rejected for bad WHOIS info on IP of your SMTP server - see FEATURE(`dnsbl', `proxies.blackholes.easynet.nl', `" ACCESS DENIED to OPEN PROXY SERVER "$&{client_name}" by easynet.nl DNSBL ( `')dnl FEATURE(`dnsbl', `relays.ordb.org', `"550 rejected due to sending server misconfiguration - see FEATURE(`dnsbl', `bl.spamcop.net', `"450 Mail from " $`'&{client_addr} " refused - see FEATURE(`dnsbl',`sbl.spamhaus.org',`Rejected - see

Spamassassin Downloading & Installing Spamassassin Starting Spamassassin Configuring Procmail for Spamassassin Startup Spamassassin –Combine spamassasin with sendmail features cp /etc/mail/spamassassin/spamassassin-spamc.rc /etc/procmailrc # /etc/init.d/spamassassin start # chkconfig --level 35 spamassassin on # rpm –ivh spamassassin i386.rpm.