[ILUG] null client configuration for sendmail
Badger
badger at scattermail.com
Thu Aug 31 14:36:08 IST 2006
On Thu, Aug 31, 2006 at 08:05:21AM +0530, Walter Faleiro wrote:
> Hi Badger,
> As I had said earlier, the configuration did not work as it still sent the
> mail to walter at fedora.example.com instead of watler at example.com.
> Will work with what the further post says and call it quits.
>
> Thanks again,
> --Walter.
>
Hi Walter,
clearly I got a little absent minded toward the latter part of last
night. I was pretty confused that stuff which was working here was
giving no results at your end.
Anyway, I'd just like to finish off by giving you one simple
configuration that works on my end. When it comes to sendmail there are
usually a multitude of ways to do things, and I believe that the
following configuration will give you the desired results even though it
differs from the configuration used on your RH-7.2 boxes. The one
possible problem that I have noted with this configuration to date is
that mail to root is never delivered to root on the local machine - even
if you use the EXPOSED_USER macro. Perhaps this is not a problem in your
organization.
For the following configuration I did not have the sendmail daemon
running at all - therefore the sendmail.mc is irrelevant. The only
important configuration file was /etc/mail/submit.mc, and this is what
it looks like on my machine (most of it is just what ships as default):
-- snip --
#
# This is the prototype file for a set-group-ID sm-msp sendmail that
# acts as a initial mail submission program.
#
divert(0)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`linux setup')dnl
define(`confCF_VERSION', `Submit')dnl
define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining
define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
define(`confTIME_ZONE', `USE_TZ')dnl
define(`confDONT_INIT_GROUPS', `True')dnl
define(`confPID_FILE', `/var/run/sm-client.pid')dnl
dnl define(`confDIRECT_SUBMISSION_MODIFIERS',`C')dnl
FEATURE(`use_ct_file')dnl
dnl
dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1]
dnl FEATURE(`msp', `[127.0.0.1]')dnl
dnl The following was added by badge
MASQUERADE_AS(`example.com')dnl
FEATURE(`allmasquerade')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`msp', `gonzo.example.com')dnl
-- snip --
In the following example (and in the above configuration), the host
kermit.example.com plays the same role as fedora.example.com on your
site - it's the local workstation. The host gonzo.example.com on my
site plays the same role of the mailserver server01.example.com.
Don't worry about the TLS stuff below it's not important.
[badger at kermit sendmail.01]$ echo | mail -s "test 2" -v badger
badger... Connecting to gonzo.example.com. via relay...
220 gonzo.example.com ESMTP Postfix
>>> EHLO kermit.example.com
250-gonzo.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250 8BITMIME
>>> STARTTLS
220 Ready to start TLS
>>> EHLO kermit.example.com
250-gonzo.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
>>> MAIL From:<badger at example.com> SIZE=27 AUTH=badger at kermit.example.com
250 Ok
>>> RCPT To:<badger at example.com>
>>> DATA
250 Ok
354 End data with <CR><LF>.<CR><LF>
>>> .
250 Ok: queued as 58DDCC995
badger... Sent (Ok: queued as 58DDCC995)
Closing connection to gonzo.example.com.
>>> QUIT
221 Bye
This is how the headers on the mail look from the badger account on
gonzo.example.com, which also happens to be example.com in my site's
configuration.
Return-Path: badger at example.com
X-Original-To: badger at example.com
Delivered-To: badger at example.com
Received: from kermit.example.com (kermit.example.com [172.16.12.1])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(No client certificate requested)
by gonzo.example.com (Postfix) with ESMTP id 58DDCC995
for <badger at example.com>; Thu, 31 Aug 2006 22:48:44 +0900 (JST)
Received: (from badger at localhost)
by kermit.example.com (8.13.7/8.13.7/Submit) id k7VCiWwv004595
for badger; Thu, 31 Aug 2006 13:44:32 +0100
Date: Thu, 31 Aug 2006 13:44:32 +0100
From: badger at example.com
Message-Id: <200608311244.k7VCiWwv004595 at kermit.example.com>
To: badger at example.com
Subject: test 2
Hope it works for you!
- badge
More information about the ILUG
mailing list