This pro forma document may be used by any member of it to produce a controlled document



Yüklə 498,79 Kb.
səhifə1/6
tarix17.01.2019
ölçüsü498,79 Kb.
#99967
  1   2   3   4   5   6


















Table Of Contents


1 Introduction 2

1.1 Purpose 2

1.2 References 2

1.2.1 Literature references 2

2 How to set up Sendmail 2

3 Sendmail Diagnostics 2

4 Security checks 3

5 Creating a Genericstable 3

6 Config.mc file 4

6.1 mail relay scenario 4

6.1.1 Config.mc
4

6.1.2 Please note: include(`../m4/cf.m4') 6

7 Using the m4 Macro Builder 6

7.1.1 General Caution: Version Upgrades 6

7.1.2 After you have built you mc file 6

8 Understanding Sendmail Logging 7

8.1.1 Literature references 7

8.1.2 Field Meaning 7

8.1.3 Message logging and sendmail dlf file contents 8

8.1.4 Example for an erroneous message sending 9

8.1.5 Miscellaneous sendmail loggings 9

8.1.6 For log level 9, the logged events per category are: 9

8.1.7 Connection related logging 10

8.1.8 Message related logging 11

8.1.9 Log control 11

9 SENDMAIL CONFIGURATION FILES 11

10 Defining Macros 65

10.1 A quick Reference Guide 65

10.1.1 D: define macro 65

1Introduction

1.1Purpose


I hope this is a complete enough doco to keep you out of trouble with Sendmail at Dom1.

1.2References

1.2.1Literature references


Bryan Costales and Eric Allman, Sendmail 2nd Edition, copyright 1997, 1993

O'Reilly & Associates, Inc.

David H. Crocker, Standard for the format of Internet text

messages, RFC822, Aug. 13, 1982.

Eric Allman, Sendmail Installation and Operation Guide For Sendmail

Version 8.10, April 7, 2000.Log format for message logging

Various HPUX guides

2How to set up Sendmail

My advice would be as follows:




  • 1 Get the book Sendmail 2nd Edition, read it as required. Use it more as a reference guide. You will get to know this well if you have to set up something in a non standard config.




  • Read and digest the Sendmail Config files section.




  • Read the HP release notes an Install notes for your sendmail version. There are some HP specific things to learn here.




  • Learn how to use the m4 macro builder




  • Create your mail scenario in plain language first.




  • Create your mc config file, do not try to build a cf file from scratch unless you have a lot of time. Use the macro builder as this will teach you the logic behind the cf file at the same time.




  • Test this config regularly i.e. aliasing using sendmail –v, cf file quality using sendmail –d0.11 –bp




  • Learn about logging messages, always tail the mail log






3Sendmail Diagnostics

To check if your sendmail cf file does not have syntax errors:

Sendmail –d0.11 –pb
Tail –f /var/adm/syslog/mail.log

This is but one use of many diagnostic techniques you can use with sendmail:


See also this rule testing page:
http://www.ebone.at/books/programmers/sonstiges/oreillybookself/tcpip/sendmail/ch38_01.htm


4Security checks

There are a few cases in which relaying is allowed even though it isn't intended. The most common is case is the use of FEATURE(relay_entire_domain) which allows relaying for every system in class m. If class m is wrong, then the system may open up relaying for other hosts in that domain. Check it with:

echo '$=m' | sendmail -bt -d0.4

5Creating a Genericstable

To set up the User Database, you need some understanding of it all, and I would suggest looking at O'Reilly. However, here are the steps necesaary:

1. Modify /etc/mail/sendmail.cf to uncomment this line:

O UserDatabaseSpec=/etc/mail/userdb

2. Create the user database.

%makemap btree /etc/userdb.db < /etc/userdb

here the /etc/userdb is a text file:

format


key value

The general format of the file is:

bob:mailname Bob.Roberts@here.us.edu
Bob.Roberts:maildrop bop

Here, outgoing mail from the user named bob will be addressed as though it is from

Bob.Roberts@here.us.edu.

Note that there are pairs of mailname and maildrop.

maildrop:

The value is the official delivery address for this user.

mailname:

The mailname keyword causes a reverse alias transformation, wherein the login name in the key is changed into the address in the value for outgoing mail.

3. Stop and restart sendmail.

6Config.mc file

6.1mail relay scenario

This is the scenario the mc file is predicated on:

We receive mail for three domains to one box
Our DNS is on Dom1
Dom1 is masqueraded as Dom2
Dom3 is masqueraded as Dom1
Some mail from Dom1 users is handled by a genericstable as Dom3 users
Mail for Dom1 users is sent via aliases

Below is the current mc file for the above scenario. Make sure that if you make any changes you have carefully checked for syntax errors.



6.1.1Config.mc


This config file is for Sendmail V8.11.1


Text in blue is for explanation:
You must include this include for HPUX (not documented)
include(`../m4/cf.m4')
Stuff printed as headers of .cf file note syntax of headers divert(-1)
divert(-1)

#

# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.



# All rights reserved.

# Copyright (c) 1983 Eric P. Allman. All rights reserved.

# Copyright (c) 1988, 1993

# The Regents of the University of California. All rights reserved.

#

# By using this file, you agree to the terms and conditions set



# forth in the LICENSE file which can be found at the top level of

# the sendmail distribution.

#

#
#


# This is a generic configuration file for HP-UX 9.x.

# It has support for local and SMTP mail only. If you want to

# customize it, copy it to a name appropriate for your environment

# and do the modifications there.

#
divert(0)dnl

divert(-1)

# Ported changes from sendmail-8.9.3 - Rajesh. Dec 20, 2000.

# Fix for JAGaa30867.

# Enabled local site hiding and masquerading in default sendmail.cf file.

# Adding feature(always_add_domain) and define __MASQUERADE_ENVELOPE_

# Fix for JAGaa30300 - Added support for openmail and uucp mailer and defined

# _X400_UCCP.

# Fix for JAGaa31678.

# Defined _CLASS_U so that it will add the rule to handle UUCP.

#

divert(0)dnl


Version
VERSIONID(`$Id: generic-hpux10.mc,v 8.11 1999/02/07 07:26:02 gshapiro Exp $')
OS type sets use of ../ostype/hpux11.m4
OSTYPE(hpux11)dnl
My Domain
DOMAIN(`Dom2')dnl
Domains I relay
RELAY_DOMAIN_FILE(`/etc/mail/relay-domains')dnl
Relay all of all relaydomains
FEATURE(`relay_entire_domain')dnl
Masquerade envelope
define(`_MASQUERADE_ENVELOPE_')dnl
Fancy HPUX stuff I hae not bothered to look up, seems to cause no harm and is in HP recommended .mc file
define(`confTRY_NULL_MX_LIST',`T')dnl

define(`DATABASE_MAP_TYPE',`dbm')dnl

define(`_CLASS_U_')dnl

#FEATURE(always_add_domain)dnl


Allow local mailer (/usr/bin/mail)
MAILER(local)dnl
Allow SMTP mail
MAILER(smtp)dnl
Use genericstable
FEATURE(`genericstable')dnl
Obvious
GENERICS_DOMAIN(`Dom3')dnl
Who I route to by default
define(`SMART_HOST', smtp:athens)dnl
I Masquerade as
define(`MASQUERADE_AS', `Dom1')dnl
My Fully Qualified Domain
DjDom2
Some local config info see how to group info for this
LOCAL_CONFIG
Masquerade so stuff differently
FEATURE(`limited_masquerade')dnl
Domains I receive mail for has to be here in file
Cw Dom1 Dom2 Dom3 dnl
What I masquerade differently
MASQUERADE_DOMAIN(`Dom1 Dom3')dnl

6.1.2Please note: include(`../m4/cf.m4')

I have also noticed that the cf/cf/generic-hpux10.mc (really a HPUX11 file) does not work without this at the beginning:

include(`../m4/cf.m4')

m4 will run but fail.


Add a domain file



Yüklə 498,79 Kb.

Dostları ilə paylaş:
  1   2   3   4   5   6




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin