Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Nov 1995 18:07:41 +0100 (MET)
From:      Piero Serini <piero@strider.ibenet.it>
To:        amengual@sadeya.cesca.es (Carlos Amengual)
Cc:        hostmaster@host.bemarnet.es, Questions@FreeBSD.ORG (FreeBSD Questions List)
Subject:   Re: Problems with mail reception
Message-ID:  <199511091707.SAA27784@strider.ibenet.it>
In-Reply-To: <Pine.BSF.3.91.951109163845.2514A-100000@blanco.sadeya.cesca.es> from "Carlos Amengual" at Nov 9, 95 05:31:03 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Hello.

I  keep this thread on -questions since we all see frequent ques-
tions about this matter, even if it's not strictly FreeBSD relat-
ed.
The "poor bored people" on this mailing list often receives email
asking how to configure sendmail. This discussion, IMHO, can only
help them to reply in the most correct way.  This  doesn't  imply
*I*  am right, it is my opinion that going deeply into this prob-
lem now will save a lot of future e-mails.

Quoting from Carlos Amengual (Thu Nov  9 18:31:03 1995):
> Look at my "From:" field. It is amengual@sadeya.cesca.es, and not
> amengual@blanco.sadeya.cesca.es (if it is, I have some relativistic 
> problem here). And look at the From field from Antonio: It is
> "Antonio Navarro Navarro <hostmaster@bemarnet.es>".

Ok. It is already configured for MASQUERADing, then.

Or,  the  hostname of the machine is set (incorrectly) to the do-
main itself.

There  is  no  other way for sendmail to know that you don't want
the hostname in the From field. (either From or From:).

> > Wrong!  Sendmail  is configured that way. I do know tat you tweak
> > an existant sendmail.cf file, but the *correct* way to do  it  is
> > to use the cf/ tree.
> 
> As I mentioned, it is likely that many people will not have it, and

Anybody can get it via anon ftp, you know.

> most do not really need it to configure sendmail. If your existing
> sendmail.cf does things well for you, the temptation to "incrementally"
> modifying it is high, even if you have the m4 files at hand.

The temptation to patch the kernel with 'dd' is also high :)

> I will look at the macro definition (sorry, that's the developer approach), 
> though it seems unlikely that the file produced will be so different from
> the initial one.

You'll be surprised: here are excerpts from a masquerading cf file:

#
#  envelope sender and masquerading recipient rewriting
#
S11
R$+                     $: $>51 $1                      sender/recipient common
R$* :; <@>              $@ $1 :;                        list:; special case
R$*                     $@ $>61 $1                      qualify unqual'ed names

#
#  header sender and masquerading recipient rewriting
#
S31
R$+                     $: $>51 $1                      sender/recipient common
R$* :; <@>              $@ $1 :;                        list:; special case

# do special header rewriting
R$* <@> $*              $@ $1 <@> $2                    pass null host through
R< @ $* > $*            $@ < @ $1 > $2                  pass route-addr through
R$=E < @ $=w . >        $@ $1 < @ $2 >                  exposed user as is
R$* < @ $=w . >         $: $1 < @ $2 @ $M >             masquerade as domain
R$* < @ $+ @ >          $@ $1 < @ $2 >                  in case $M undefined
R$* < @ $+ @ $+ >       $@ $1 < @ $3 >                  $M is defined -- use it
R$*                     $@ $>61 $1                      qualify unqual'ed names

#
#  common sender and masquerading recipient rewriting
#
S61

R$* < @ $* > $*         $@ $1 < @ $2 > $3               already qualified
R$=E                    $@ $1 < @ $j>                   show exposed names
R$+                     $: $1 < @ $M >                  user w/o host
R$+ <@>                 $: $1 < @ $j >                  in case $M undefined

If you use UUCP, the following also applies:

#
#  envelope sender rewriting for uucp-uudom mailer
#
S72

...
R$&h ! $+ ! $+                  $@ $1 ! $2              $h!...!user => ...!user
R$&h ! $+                       $@ $&h ! $1             $h!user => $h!user
R$+                             $: $M ! $1              prepend masquerade name
R! $+                           $: $j ! $1              in case $M undefined


Moreover,  you should know that a single line in a rewriting rule
is likely to have tremendous impact on your poor sendmail.

> > Configure a sendmail in the right way, i.e. use m4 and  then  use
> > diff to see it yourself.
> 
> I do have sendmail configured the "right" way: the way I need to do less
> changes and I feel more safe with.

The right way IMO is the way the author intended you to do things.

> > Wrong! Any customization can be done in the .mc file, and this
> > is the right way to do it.
> > 
> > > Your method is only one approach, not the only one as you imply.
> > 
> > Wrong! Using m4 is the only *correct* approach.
> 
> I have never seen, in any book, that only m4 is correct. Every people I know
> deals directly with the sendmail.cf file. The real point is if you are 
> reasonably confident of what you are doing and, finally, if things work 
> after all. It is not so hard to add rules and mailers by hand in the raw
> file.

ORA Sendmail book, page 325:
"Most  configuration commands are so complex that each requires a
chapter or two of his own. A few, however,  are  simple.  In  the
balance of this chap- ter, we will describe the simple ones: com-
ments, continuation lines, and the V(version) command."

ORA Sendmail book, page 731:
"V8  sendmail  provides an easy way to create a custom configura-
tion file for your site. In the cf  subdirectory  of  the  source
distribution,  you  will  find  a  file named README. It contains
easy-to-understand, step-by-step instructions."

The  book  itself is 792 pages long. It devotes 264 pages (323 to
587) to sendmail.cf and its internals, and 21 pages (731 to  752)
to m4.

I  think the above proves beyond any reasonable doubt, thy honor,
that the *easiest* way to configure sendmail is using the m4  ap-
proach.  In Computer Science,  given the same result, the easiest
approach is the correct one.

> As this is falling to "style matters", I suggest that any response should be 
> left out of the poor bored people in the mailing list, if you agree, now that
> Antonio's problem is (unsurprisingly, ignoring us) solved (by the way I 
> suggested :)

See above (lines 3 - 10 :)

Bye,
--
#        $Id: .signature,v 1.12 1995/08/14 12:10:54 piero Exp $
Piero Serini                                            Via Giambologna, 1 
<Piero@Free.IT>                                     I 20136 Milano - ITALY



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511091707.SAA27784>