Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sendmail configuration and installation Presented by kathleen.

Similar presentations


Presentation on theme: "Sendmail configuration and installation Presented by kathleen."— Presentation transcript:

1 Sendmail configuration and installation Presented by kathleen

2 Importance Business and personal communication Business and personal communication Each company provides some type of email service Each company provides some type of email service Important to learn how to install and build and configure sendmail Important to learn how to install and build and configure sendmail

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

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

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

6 Possible Necessities YP (NIS) server YP (NIS) server User names and passwords to allow client machines about usernames. Providing central services User names and passwords to allow client machines about usernames. Providing central services Unless you share the same passwd file Unless you share the same passwd file

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

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

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

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

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

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

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

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

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

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

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

18 Clients Copy new version of sendmail Copy new version of sendmail Copy sendmail.cf Copy sendmail.cf Make sure following are mounted from servers Make sure following are mounted from servers /var/mail /var/mail /usr/local /usr/local /home /home

19 Various Types of Clients with Different Operating Systems For each OS and version compile a new sendmail 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 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 Create a new sendmail.cf file for each type of operating system supported. Use the m4 interpreter Solaris Solaris Linux Linux Irix Irix

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

21 More problem solving… make sure mail is being placed into mqueue at least temporarily directory 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 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. Make sure mail is being placed in user /var/mail/username. Simply cat out user file Simply cat out user file Make sure you created a mail inbox in /var/mail Make sure you created a mail inbox in /var/mail

22 Any questions? Any questions?


Download ppt "Sendmail configuration and installation Presented by kathleen."

Similar presentations


Ads by Google