Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using Sendmail go out through an Exchange Server

11 views
Skip to first unread message

donrodric

unread,
Oct 14, 2008, 7:20:25 AM10/14/08
to
Hello everybody. Help required please, good people.

I am trying to configure sendmail to send emails out through an MS
Exchange server.

I have tried all kinds of things with the sendmail.cf file, the hosts
file and netsvc.conf file.

Have also tried adding the servers IP to the Exchange machine, but no
joy.

Would anybody care to lend a hand, please? The directors arent
signing off expenditure forms without a fight these days, so payment
in cash might be a problem, but could perhaps pay in old hardware from
all the branches we are closing!

Many thanks,

donrodric

unread,
Oct 14, 2008, 8:23:38 AM10/14/08
to
ps - have also tried stopping and starting sendmail on each change.

ynotssor

unread,
Oct 14, 2008, 3:40:05 PM10/14/08
to
In news:50bedae3-b3c3-466d...@64g2000hsu.googlegroups.com,
donrodric <paul.wi...@connells.co.uk> typed:

> I am trying to configure sendmail to send emails out through an MS
> Exchange server.
>
> I have tried all kinds of things with the sendmail.cf file, the hosts
> file and netsvc.conf file.

You've probably mucked up the sendmail.cf file by directly editing it with
no knowledge of what you're doing.

Use the sendmail.mc file, and add the line

define(`SMART_HOST', `your.exchange.server')

somewhere above your MAILER() statements, then rebuild the sendmail.cf from
the sendmail.mc file.

Of course you'll lose any other changes you've directly edited in the
sendmail.cf file, so maybe you'll want to edit sendmail.cf directly again
and change:

# "Smart" relay host (may be null)
DSyour.exchange.server


donrodric

unread,
Oct 15, 2008, 7:11:44 AM10/15/08
to
On Oct 14, 8:40 pm, "ynotssor" <ynots...@example.com> wrote:
> Innews:50bedae3-b3c3-466d...@64g2000hsu.googlegroups.com,
> donrodric <paul.widdeco...@connells.co.uk> typed:

Thanks for your assistance. I copied the newly generated sendmail.cf
file over to /etc/mail & restarted sendmail, but got the same error.
(Which I didnt include in the previous post...)

# sendmail -v @EXSVR:joe.b...@jobbs.co.uk < /emailfile
@EXSVR:joe.b...@jobbs.co.uk... User unknown

It cleared up the nag message about the out of date config file
though, so thanks!

I also found a website about building the hash tables, so I ran this
little lot too:
# cd /etc/mail
# touch access domaintable mailertable virtusertable
# for file in access domaintable mailertable virtusertable
> do
> makemap dbm /etc/mail/${file} < /etc/mail/${file}
> makemap hash /etc/mail/${file} < /etc/mail/${file}
> done
#
# touch /etc/mail/local-host-names
# chmod 664 access* domaintable* mailertable* virtusertable*
(still no joy...)


Here's a clue though - if we set the email address to a recognised
user name within /etc/passwd, we dont get this error. (still doesnt
send anything though :-()

Any ideas?

Rob MacGregor

unread,
Oct 15, 2008, 6:22:03 PM10/15/08
to
donrodric unleashed the infinite monkeys on 14/10/2008 12:20 producing:

> Hello everybody. Help required please, good people.
>
> I am trying to configure sendmail to send emails out through an MS
> Exchange server.
>
> I have tried all kinds of things with the sendmail.cf file, the hosts
> file and netsvc.conf file.
>
> Have also tried adding the servers IP to the Exchange machine, but no
> joy.

Configure the Exchange server as the SMART_HOST - see the section titled
"MASQUERADING AND RELAYING" in cf/README or
http://www.sendmail.org/doc/sendmail-current/cf/README.

--
Rob MacGregor (BOFH)

Rule 37: "There is no 'overkill'. There is only 'open fire'
and 'I need to reload.'"

donrodric

unread,
Oct 16, 2008, 6:14:47 AM10/16/08
to
On Oct 15, 11:22 pm, Rob MacGregor <m...@privacy.net> wrote:
> donrodric unleashed the infinite monkeys on 14/10/2008 12:20 producing:
>
> > Hello everybody.  Help required please, good people.
>
> > I am trying to configure sendmail to send emails out through an MS
> > Exchange server.
>
> > I have tried all kinds of things with the sendmail.cf file, the hosts
> > file and netsvc.conf file.
>
> > Have also tried adding the servers IP to the Exchange machine, but no
> > joy.
>
> Configure the Exchange server as the SMART_HOST - see the section titled
> "MASQUERADING AND RELAYING" in cf/README orhttp://www.sendmail.org/doc/sendmail-current/cf/README.

>
> --
>   Rob MacGregor (BOFH)
>
> Rule 37: "There is no 'overkill'. There is only 'open fire'
>           and 'I need to reload.'"

tlhIngan Hol vIjatlhbe' MacGregor, and the README is long and my
attention span short, I'm afraid.

I have tried setting SMART_HOST in sendmail.mc, then m4'ing it, then
copying sendmail.cf, then restarting. I just want somebody to make it
go away, so that I can go back to whatever it is I normally do in this
office based alternate reality.

define(`SMART_HOST', `SERVER99')

was the kind of thing I tried in sendmail.mc. Should that be the name
of the server, or the domain name (somethingorother.co.uk)?

Ingo Freund

unread,
Oct 16, 2008, 6:36:50 AM10/16/08
to
On 16.10.2008 12:14, donrodric wrote (please find the answer below the original text):
> On Oct 15, 11:22 pm, Rob MacGregor <m...@privacy.net> wrote:
>> donrodric unleashed the infinite monkeys on 14/10/2008 12:20 producing:
>>
>>> Hello everybody. Help required please, good people.
>>> I am trying to configure sendmail to send emails out through an MS
>>> Exchange server.
>>> I have tried all kinds of things with the sendmail.cf file, the hosts
>>> file and netsvc.conf file.
>>> Have also tried adding the servers IP to the Exchange machine, but no
>>> joy.
>> Configure the Exchange server as the SMART_HOST - see the section titled
>> "MASQUERADING AND RELAYING" in cf/README orhttp://www.sendmail.org/doc/sendmail-current/cf/README.
>>
>> --
>
> define(`SMART_HOST', `SERVER99')
>
> was the kind of thing I tried in sendmail.mc. Should that be the name
> of the server, or the domain name (somethingorother.co.uk)?

The name of the smarthost (your exchange machine)
needs to be resolved by the sendmail server.
Type "host <name.of.exchange_machine" on the sendmail
machine. If you receive a result (an IP-Address), and it
is the right IP-Address of the echange server, then
configure the smart_host directive with that name and
after m4'ing the sendmail.mc and restarting sendmail
all mails should be pushed to exchange.

If it doesn't work give us a look on the related part of
your mail log file normally located in /var/log
named "mail" or "maillog".

-Ingo.

Tilman Schmidt

unread,
Oct 17, 2008, 6:34:33 AM10/17/08
to
donrodric schrieb:

> Here's a clue though - if we set the email address to a recognised
> user name within /etc/passwd, we dont get this error. (still doesnt
> send anything though :-()

Sounds like your Sendmail still considers jobbs.co.uk a local domain.
Remove it from your Cw definition or /etc/mail/local-host-names file.
Alternatively, look into the LUSER_RELAY feature.

HTH
T.

--
Please excuse my bad English/German/French/Greek/Cantonese/Klingon/...

Giorgos Keramidas

unread,
Oct 16, 2008, 8:42:14 AM10/16/08
to
On Wed, 15 Oct 2008 04:11:44 -0700, paul.wi...@connells.co.uk wrote:
> Thanks for your assistance. I copied the newly generated sendmail.cf
> file over to /etc/mail & restarted sendmail, but got the same error.
> (Which I didnt include in the previous post...)
>
> # sendmail -v @EXSVR:joe.b...@jobbs.co.uk < /emailfile
> @EXSVR:joe.b...@jobbs.co.uk... User unknown
>
[...

> Here's a clue though - if we set the email address to a recognised
> user name within /etc/passwd, we dont get this error. (still doesnt
> send anything though :-()

This is a bit of a guess, but if you are getting delivery errors for
users that are not listed in `/etc/passwd', then it looks like your
Sendmail is trying to deliver the email messages for the particular
domain through the `local' mailer.

Can you run

# sendmail -bv joe.b...@jobbs.co.uk

and show us the results?

0 new messages