Sendmail.cf modifications for local mail without going to internet
- From: "maria.freixes_graells@xxxxxxxxxx" <maria.freixes_graells@xxxxxxxxxx>
- Date: 9 Jun 2006 01:30:27 -0700
Hello everybody!!
I've an UNIX Compaq machine with this sendmail.cf that sends the local
mail to the internet through 'alcatel.es' domain.
Example: If I send a mail from root@xxxxxxxxxxxxxxxxxxxxxxxxx to
backup@xxxxxxxxxxxxxxxxxxxxxxxxx, the message go to mail: from
smail2.alcatel.fr ([155.132.188.80]) by
esmail03.netfr.alcatel.fr (Lotus Domino Release 5.0.13aHF163)
with ESMTP id 2006060910111082:1768
I'll be very gratefully if someone could help me.
Best regards,
Maria
#
# *****************************************************************
# * *
# * Copyright (c) Digital Equipment Corporation, 1991, 1997 *
# * *
# * All Rights Reserved. Unpublished rights reserved under *
# * the copyright laws of the United States. *
# * *
# * The software contained on this media is proprietary to *
# * and embodies the confidential technology of Digital *
# * Equipment Corporation. Possession, use, duplication or *
# * dissemination of the software and media is authorized only *
# * pursuant to a valid written license from Digital Equipment *
# * Corporation. *
# * *
# * RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
# * by the U.S. Government is subject to restrictions as set *
# * forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
# * or in FAR 52.227-19, as applicable. *
# * *
# *****************************************************************
#
# HISTORY
#
# @(#)$RCSfile: sendmail.cf.pd,v $ $Revision: 1.1.19.2 $ (DEC) $Date:
1996/11/22 18:36:26 $
#
# cruft to let old bindsetup work. these macros are not used.
#
DDLOCAL
DAseb604
############################################################
@Ltag(Intro)
############################################################
#####
##### SENDMAIL CONFIGURATION FILE
#####
##### Paul Vixie, forked off on 9-December-90
##### Paul Vixie, major MAIL11/MR work on 17-July-1991
##### Paul Vixie, Todd Kaehler and Fred Avolio: parameterized, August
1992
#####
##### Originally created using Advanced MailSetup
#####
############################################################
############################################################
## predefined
# $y decnet node name (if known) (if running a recent binary)
# $w fully-qualified hostname
# $j same as $w (except IDA, which is all-lower-case,
strip-at-first-dot)
##
############################################################
@Ltag(LocalInfo)
### local info
############################################################
# parent domain
DPalcatel.es
# my domain
DNbar.ses.alcatel.es
# name exported on external internet mail
DWbar.ses.alcatel.es
# my official hostname
Dj$w
#
# aliases at the $P level -- we think we are authoritative for these
#
Cdbar
#
# usernames which will be @host qualified on outbound localdom mail
#
CNroot postmaster news uucp mailer-daemon rdist nobody daemon pop
FN/var/adm/sendmail/local.users %[^#]
#
# trash top-level domains -- don't use $[...$] on names ending with
these
#
CTUUCP USENET UMC DNET
############################################################
#
# General configuration information
#
############################################################
# Version Number
DV1.1.19.2/23Mar00-0331PM
##########################
### Special macros ###
##########################
# my name
DnMAILER-DAEMON
# UNIX header format
DlFrom $g $d
# delimiter (operator) characters
Do.:%@!^=/[]
# Routing operators (foreign addrs assumed)
Co % @ ! ^
# format of a total name
Dq$?x$x $.<$g>
# SMTP login message
De$j Sendmail $v ($V) $b
###################
### Options ###
###################
# wait 5 minutes for newaliases to complete
Oa
# location of alias file
OA/var/adm/sendmail/aliases
# default delivery mode (deliver in background)
Odbackground
# temporary file mode
OF0600
# default UID: "nobody"
Ou65534
# default GID: "nobody"
Og65534
# location of help file
OH/usr/share/lib/sendmail.hf
# log level
OL9
# include sender if she's on an alias to which she's sending
Om
# queue directory
OQ/var/spool/mqueue
# read timeout -- violates protocols
Or1h
# status file
OS/var/adm/sendmail/sendmail.st
# queue up everything before starting transmission
Os
# use separate envelope/header rewriting rulesets (IDA)
O/
# default timeout interval
OT3d
# load average for forcing "Odq" behaviour
Ox20
# load average for refusing connections
OX12
###############################
### Message precedences ###
###############################
Pfirst-class=0
Pspecial-delivery=100
Pjunk=-100
#########################
### Trusted users ###
#########################
Troot daemon uucp news
#############################
### Format of headers ###
#############################
H?P?Return-Path: <$g>
#HReceived: by $j id $i; $b
HReceived: $?sfrom $s $.by $j ($v/$V)
id $i; $b
H?D?Resent-Date: $a
H?D?Date: $a
H?F?Resent-From: $q
H?F?From: $q
H?x?Full-Name: $x
HSubject:
H?M?Resent-Message-Id: <$t.$i@$j>
H?M?Message-Id: <$t.$i@$j>
###########################
### Rewriting rules ###
###########################
##
## S1/S2 (and S5/S6 in IDA) are called before the per-mailer S= and R=
rwsets.
## for any address types which we export in native format (e.g., uucp
!-form)
## rather than pseudodomain format (e.g., mail11 @node.decnet form), we
need
## to undo the effects of S3/S7 here, so that the per-mailer rwsets
will see
## them as "unqualified" and add the appropriate qualification to them.
note
## that this is a deeply divisive issue; these so-called "mixed-mode"
addresses
## (e.g., vixie!paul@xxxxxxxxxxxxxx) have different interpretations
depending
## on who you ask. since you're running our config file, you're
getting our
## particular leanings. if you want it done some other way, do it
yourself.
## (vix)
################################
# Sender Field Pre-rewriting #
################################
S1
R$+<@$-.UUCP> $2!$1 decapsulate UUCP
###################################
# Recipient Field Pre-rewriting #
###################################
S2
R$+<@$-.UUCP> $2!$1 decapsulate UUCP
###########################
# Name Canonicalization #
###########################
S3
# handle "from:<>" special case
R<> $@@ turn into magic token
# route-addr's look canonical but aren't
R<@$+:$+>$* @$1:$2 unfocus <route-addr>
# already canonical?
R$*<@$+>$* $@$>7$1<@$2>$3 idempotency is good
# basic textual canonicalization -- note lack of RFC733 heuristic here
R$*<$+>$* $2 basic RFC822 parsing
# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
R@$+,$+ @$1:$2 change all "," to ":"
R@$+:$+ $@$>7<@$1>:$2 handle <route-addr>
# more miscellaneous cleanup
R$+:$*;$* $@$1:$2;$3 list syntax
R$+@$+ $:$1<@$2> focus on domain
R$+<$+@$+> $1$2<@$3> move gaze right
R$+@$+<@$+> $1%$2<@$3> a@b@c@d ->a%b%c@d
# things that are still in @-form are ready to eat
R$+<@$+> $@$>7$1<@$2> now canonical
# convert rightmost % to @ (ruleset 7 has the rest of the magic for
this)
R$+%$+ $@$>7$1<@$2> user%host
# (ruleset 3 ends here. we don't exit through
# $>7 here as with the other exits from ruleset 3
# since we only exit through S7 when we make a
# change.)
##### special local conversions (exit path from S3)
S7
R$*<@$+%$+>$* $1%$2<@$3>$4 move @ right after %
R$+<@POP>$* $@$1<@POP>$2 POP already OK
R$*<@$->$* $@$1<@$2.$N>$3 qualify hostnames
#################################
# Final Output Post-rewriting #
#################################
S4
R@ $@ handle <> error addr
R$*<$+>$* $1$2$3 defocus
R@$+:$+:$+ @$1,$2:$3 <route-addr> canonical
R@$+:$+ $@<@$1:$2> route-addr needs <>
#################################
# (IDA) header senders #
#################################
S5
R$+ $@$>1$1 same as envelope
#################################
# (IDA) header recipients #
#################################
S6
R$+ $@$>2$1 same as envelope
#################################
# Utility: strip local domain #
#################################
# this is neccessarily tricky. S0 needs to strip off the local host(s)
and
# it may take several passes to do that (consider $-%$j%$j%$j or
$U!$-@$j).
# this requires iterate-until-no-change, which is a semantic not
directly
# provided by sendmail. sendmail does permit recursion, though, which
we
# use. S0 calls S8, which calls itself whenever it makes a change,
else falls
# out the bottom when it has nothing left to strip.
#
# S8/S17 starts by calling S3 since on the subsequent recursive calls,
a change
# will have been made and the canonicalizion will have been lost. we
would
# like to use $>8$>3 but that doesn't work the way you'd expect. the
cost
# here is that S3 gets called once at the top even though S3 was called
before
# S0 so there's nothing for it to do. this is why S3 must be
idempotent and
# also why S3's "no change needed" condition is so close to its top.
#
# S18 is like S8, but it leaves a single <@$j> at the end. This is
useful
# for client machines in a hub based environment. It allows for a
simple
# addr that ends in <@$j>, to be considered local (i.e. deliver it
here),
# otherwise, forward it to the Hub. Somewhat similar rules can be done
# move easily in sendmail V8 using ruleset 5, but that won't work here.
#
# S19 is called only by S18. It is an ugliness that could be done
directly
# in IDA, but we're trying to make sure that these cf files work with
almost
# any vendors sendmail.
S8
R$+ $:$>17$1 any @localhost?
# here's where we recurse if a change was made
R<@>:$* $@$>8$1 localhost/route-addr
R$*<@>$* $@$>8$1$2 localhost
# S17 Localizing subroutine.
# Strips off "@$j" (and other synonyms for this host) leaving "<@>"
instead.
S17
R$+ $:$>3$1 needed for recursions
R$*<@$j>$* $@$1<@>$2 @myfqdm
R$*<@$=w>$* $@$1<@>$3 @my alias
R$*<@$=w.$N>$* $@$1<@>$3 @my alias
# next two lines only gen'd if have aliases for all and $N isn't LOCAL
R$*<@$N>$* $@$1<@>$2 @mydomain
R$*<@$=d.$P>$* $@$1<@>$3 @codomain
# S18
# Like S8, but leaves local addresses qualified with a single "<@$j>".
S18
R$+ $:$>17 $1
R<@>:$* $@$>19 $1 localhost/route-addr
R$*<@>$* $@$>19 $1$2 localhost
# S19
# Utility subroutine for S18.
# Being here implies that <@$j> (or its equivalent) was found at least
once.
# We can now strip off all <@$j>, and selectively add one back.
S19
R$* $:$>8 $1 Strip off all $j
R$*$=o$* $@ $1$2$3 This is a remote addr.
R$+::$+ $@ $1::$2 A DECnet addr.
R$* $@$>3 $1<@$j> must be local
########################################
# Utility: canonicalize local domain #
########################################
S9
# (next four lines are only generated if $N isn't LOCAL)
R$*<@$->$* $:$1<@$2.$N>$3 qualify
R$*<@$+.$=T>$* $@$1<@$2.$3>$4 trash pseudodom, lv aln
R$*<@$+.$=T.$P>$* $@$1<@$2.$3.$P>$4 qualified trash, lv aln
R$*<@$+>$* $:$1<@$[$2$]>$3 canon'ize complex names
############################################################
############################################################
#####
##### RULESET 0
#####
############################################################
############################################################
S0
# special cases
#
R@ $#local $:$n handle <> form
R$*<@[$+]>$* $#smtp $@[$2] $:$1<@[$2]>$3 numeric internet spec
# localize if possible (rip off @DOMAINs for which we are
authoritative)
R$*<@$+>$* $:$>8$1<@$2>$3
#
# Fake hosts in my domain
#
R$+<@POP> $#pop $@$j $:$1 username@POP
# Real hosts in my domain
#
R$*<@$*$N>$* $#smtpl $@$2$N $:$1<@$2$N>$3 our domain; no gw
# Parent domain
#
R$*<@$*$P>$* $#smtp $@mail.alcatel.es $:$1<@$2$P>$3 our domain; gw
# Nonlocal mail
#
R$*<@$+>$* $#smtp $@mail.alcatel.es $:$1<@$2>$3 use gateway
# Local mail
#
R$+ $#local $:$1 must be local
############################################################
############################################################
#####
##### Local, POP and Program mailers
#####
############################################################
############################################################
Mlocal, P=/bin/mail, F=SlsDFMmnu, S=10, R=20, A=mail -r $f -d $u
Mprog, P=/bin/sh, F=lsDFM, S=10, R=20, A=sh -c $u
Mpop, P=/usr/lib/mh/spop, F=nsmFDM, S=10, R=20, A=pop $u
S10
R@ $n errors to mailer-daemon
S20
############################################################
############################################################
#####
##### SMTP to hosts inside the local domain
#####
############################################################
############################################################
Msmtpl, P=[IPC], F=mDFMuX, S=11, R=21, A=IPC $h, E=\r\n
# (we pull off the local hostname in all cases, and then selectively
add it
# back on. we would add it back if the aliases aren't shared across
all
# hosts in this domain, or if the user is root or one of the others
that
# we want to know the hostname for.)
#
S11
R$*<@$j>$* $>3$1$2 strip local host name
R$*<@$+>$* $:$>9$1<@$2>$3 canonicalize domain
# (next two lines are only present if aliases aren't shared across
localdom)
R$*<@$+>$* $@$1<@$2>$3 already has an @domain
R$+ $@$1<@$j> add our hostname
# (by running S11 on recipients, we get the above behaviour on To: and
Cc:
# headers, as well as for the envelope recipient. this is good since
we
# always call $#smtpl with hostname attached, which means that we
won't be
# down here at all if $j is in the address (that would have been
stripped
# in S0), and we will therefore qualify any domain-less addresses with
our
# own hostname before sending them to other hosts in our domain. this
is
# all ugly but it's what you have to do if your aliases aren't shared.
--vix)
#
S21
R$+ $@$>11$1 nothing special here
############################################################
############################################################
#####
##### SMTP to hosts outside the local domain
#####
############################################################
############################################################
Msmtp, P=[IPC], F=mDFMuXL, S=12, R=22, A=IPC $h, E=\r\n
S12
R<@$+>$* $@<@$1>$2 <route-addr> syntax
R$*<@[$+]>$* $@$1<@[$2]>$3 numeric, lv alone
R$*<@$+>$* $@$>9$1<@$2>$3 canonicalize domain
R$=N $@$1<@$j> Add $j to local
R$- $:$1??$(@ $1 $: $) Look up aliases
R$-??$+ $@$1<@$j> Found it - reformat
R$-?? $:$1 undo dammage
R$+ $@$1<@$W> fix up return addr
S22
R$+ $@$>12$1 nothing special here
############################################################
############################################################
#####
##### SMTP to relay host
#####
############################################################
############################################################
Msmtpr, P=[IPC], F=mDFMuX, S=13, R=23, A=IPC $h, E=\r\n
# (we pull off the local hostname in all cases, and then selectively
add it
# back on. we would add it back if the user is root or one of the
others
# for which we want to know the hostname. Otherwise we want to look
like we
# are a local user on the relay machine. This is to allow for
"cleaner"
# addresses when crossing mail domains. --FMA)
#
S13
R$*<@$j>$* $>3$1$2 strip local host name
R$*<@$+>$* $:$>9$1<@$2>$3 canonicalize domain
R$=N $@$1<@$j> qualify nonhidden users
R$- $:$1??$(@ $1 $: $) Look up aliases
R$-??$+ $@$1<@$j> Found it - reformat
R$-?? $:$1 undo dammage
S23
R$+ $@$>13$1 nothing special here
.
- Follow-Ups:
- Prev by Date: Sendmail : List of account
- Next by Date: Re: Sendmail.cf modifications for local mail without going to internet
- Previous by thread: Sendmail : List of account
- Next by thread: Re: Sendmail.cf modifications for local mail without going to internet
- Index(es):
Relevant Pages
|