Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Unix Sendmail. It's been said that you aren't a real Unix system administrator until you've edited a sendmail.cf file. It's also been.

Similar presentations


Presentation on theme: "Introduction to Unix Sendmail. It's been said that you aren't a real Unix system administrator until you've edited a sendmail.cf file. It's also been."— Presentation transcript:

1 Introduction to Unix Sendmail

2 It's been said that you aren't a real Unix system administrator until you've edited a sendmail.cf file. It's also been said that you're crazy if you've done it twice.

3 O’Reilly’s “Bat Book” 4th Edition -- covers Versions 8.10 through 8.14 Flying Fox (a species of fruit bat)

4 What is Sendmail? Sendmail is the most widely used Mail Transport Agent (MTA) on the internet MTAs send mail from one machine to another. Sendmail is not a client program, which you use to read your . Sendmail is one of the behind-the-scenes programs which move over the Internet. Normally it runs as a background daemon Can even be run out of the super daemon (xinetd)

5 Implementations SMTP Gateway An SMTP gateway allows users on your network to communicate with others on the Internet without concern as to which local mail software package exists on your network. All incoming mail for your network will pass through this gateway which converts the message into the appropriate format specific to your local mail software. Similarly, all mail destined for the Internet from your network will pass through this gateway to be sent across the Internet via SMTP

6 Implemetations SMTP Relay ”Warning Will Rogers” An SMTP relay is a machine that actually sends the mail across the Internet. A common misconception is that SMTP gateways are the same as SMTP relays. This is not always the case. There are SMTP gateways that act as relays themselves, but there are also many that do not. If the latter is the case on your network, you'll need to bounce your mail off one of the relays.

7 The Pieces The binary: /sbin/sendmail The configuration file: /etc/mail/sendmail.cf Supporting files: /etc/mail/access /etc/mail/aliases …and many more

8 More Pieces messages are stored in the directory: /var/spool/mail There is a separate file for each user waiting to be sent./var/spool/mqueue A log of sent and received: /var/log/mail

9 Sendmail Features Sendmail uses DNS (Domain Naming System) But not 100% dependent: DNS provides Mail Exchange (MX) Info Sendmail can do a DNS double-tap Lookup up who the client says they are Sendmail default is “mail relay off” Realtime Blackhole Lists (RBL) Mail Relay checkers - - Open Mail Relay Db

10 Sendmail Anti-Spam Enhancements Mailscanner Minimal anti-spam Anti-virus integration (scan in/outbound) Or Spam Assassin Rule based heuristic Header and text analysis Blacklist (RBL) Vipul's Razor (http://razor.sf.net)

11 Sendmail configuration and installation

12 Basic configuration Many types of configuration possible Separate mail servers on one network Mails forwarded to a gateway then forwarded onto individual mail-servers One mail server with many clients Method Chosen: One mail server  Problems occur with too much load  Overcome by load balancing through many mail servers with same disks  Method most chosen in sites (easier to administrate)

13 Concepts of sendmail Simple installation Mail user agent-read and compose messages  pine – cursor based graphical mail viewer  mail – command line mail Mail transport agent- accepts mail from user agent, understand recipients address. Gets mail to correct host for delivery  esmtp- extended simple mail transport protocol  Or smail, qmail, exim Delivery agent – accepts mail from transport and delivers it to appropriate recipients  Mail, /bin/sh, procmail,pop, phquery, uucp  Mail – simple user delivery agent

14 Necessities Other software needed besides sendmail DNS server Canonical name for local host Looks up hosts that connect Looks up hosts for delivery SMTP to find the address to connect to File System /var/mail access inbox/spool for clients /home to access simple files /usr/local or software to access mail software

15 Checklist for DNS mailserver An mx record on dns Hosts A lookup record Name to IP A reverse lookup record (validation purpose) IP to Name /etc/hosts

16 Compile retrieve off of sendmail.org untar and unzip compile.sh Build Configuration (m4 Macros) Choose a configuration file matching your os Generic-linux.m4 Compile and Configure

17 m4 Configuration Files M4 a macro preprocessor that produces a sendmail configuration file by processing a file that ends in.mc. Macros used are: define – defines a macro undefine – discards a previous definition include – includes a file dnl – discards characters up to including the next new line divert – manages output streams

18 Types of Configuration OSTYPE is the operating type Linux, sgi, solaris Specifies directories of where files are located for normal sendmail including queues and spool directories through variables Chose ostype(linux) VERSIONID version id of the sendmail you build

19 More Configuration DOMAIN allows to include domain files for site specific information Use generic for small sites Large sites spam, databases, tables MAILER delivery agent specifications. Types:  Local,smtp,fax,usenet,procmail… Used  local and smtp  MAILER(`local’) MAILER(`smtp’) Computer science dept:  Procmail, local, and smtp

20 Even more Configuration FEATURE Options to change sendmail’s behavior use_cw_file – necessary, names of all local hosts for which this host accepts  “ whatever.com”, “mail.whatever.com” redirect – allows forwarding access_db – necessary, consists of ips, or domains  Specify rejects, OK, discard or relay for machines to use smtp on that server.  Must use makemap hash /etc/mail/access < /etc/mail/access

21 No not more….. configuration nocanonify  Avoid dns lookups locally.  Used for client transport agents nullclient  FEATURE(`nullclient’,`mail.whatever.com’)  All mail is delivered to the mailserver MASQUERADE_AS allow multiple machines hide behind one single identity  MASQUERADE_AS(`cs.umbc.edu’)  MASQUERADE_AS(`whatever.com’) MAIL_HUB Automatically done Incoming mail smtp:mail.whatever.com SMART_HOST Automatic with masquerade Outgoing mail smtp:mail.whatever.com

22 Configuration Server configuration OSTYPE(`linux’) DOMAIN(`generic’) FEATURE(`use_cw_file’) FEATURE(`access_db’) MASQUERADE_AS(`whatever.com’) MAILER(`local’) MAILER(`smtp’) Client configuration OSTYPE(`linux’) FEATURE(`nocanonify’) FEATURE(`nullclient’, `mail.whatever.com’)

23 Creating cf file Build cf file for client/server make filename.cf cp filename.cf /etc/mail/sendmail.cf Client configuration is copied for client Server configuration is copied for server

24 /etc/aliases Necessary file for sendmail System wide config file maintained by administrator Computer Science Dept. uses lists, and aliases for professors Should always contain postmaster Sendmail will not work without this file Trust me….. Can contain include files for lists or other interfaces to majordomo (CS) or listproc like (OIT) Majordomo = FREE Listproc = expensive Configuration for sendmail has to enable /bin/sh for majordomo or listproc

25 Running Sendmail Should be done in RC scripts Linux has a rc file already if sendmail is installed Kill –TERM pid to kill sendmail /usr/sbin/sendmail -bd –q1h & to run again mv mqueue if queue is clogged, located in /var/spool/mqueue

26 Various Types of Clients with Different Operating Systems For each OS and version compile a new sendmail Make sure all clients share the same version of sendmail. Or sendmail not interact properly with server and client Create a new sendmail.cf file for each type of operating system supported. Use the m4 interpreter Solaris Linux Irix

27 Problem Solving for Configuration Ensure smtp is running on mail-server telnet to hostname w/ port 25 from client If connection refused major problem Try from mail server as well cd /var/log and tail messages Make sure variables are sound and correct on start up Make sure dns resolving and lookups are correct when mails are received tail maillog Make sure no errors have been reported

28 More problem solving… make sure mail is being placed into mqueue at least temporarily directory Also try typing mailq to see if they are not being delivered to end user Make sure mail is being placed in user /var/mail/username. Simply cat out user file Make sure you created a mail inbox in /var/mail

29 References RFC’s: RFC Simple Mail Transfer Protocol RFC Standard for the Format of ARPA Internet Text Messages RFC MIME (Multipurpose Internet Mail Extensions) Explained


Download ppt "Introduction to Unix Sendmail. It's been said that you aren't a real Unix system administrator until you've edited a sendmail.cf file. It's also been."

Similar presentations


Ads by Google