1825554 Members
2904 Online
109681 Solutions
New Discussion

Sendmail 8.11 Relaying

 
SOLVED
Go to solution
Mark Hopkins_2
Frequent Advisor

Sendmail 8.11 Relaying

Hello,

Is there a way to configure Sendmail to accept and relay ALL incoming email?

I am using version 8.11 on HP-UX 11.0.

Thanks.

Mark
Only the dead see the end of war!
12 REPLIES 12
Sajid_1
Honored Contributor

Re: Sendmail 8.11 Relaying

This document may help you:
http://support2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000048726177

Doc ID - KBRC00001771
learn unix ..
Michael Tully
Honored Contributor

Re: Sendmail 8.11 Relaying

Hi,

You need to setup the 'Smart Relay' host. This is generally an MS exchange server.

Modify your /etc/mail/sendmail.cf file

# "Smart" relay host (may be null)
DSmyrelay

Save the file and stop and restart sendmail.
Make sure that the host you use can be resolved via DNS.

# /sbin/init.d/sendmail stop
# /sbin/init.d/sendmail start

HTH
Michael
Anyone for a Mutiny ?
Mark Hopkins_2
Frequent Advisor

Re: Sendmail 8.11 Relaying

Guys,

Perhaps I should explain a little more.

OK, this internal sendmail server is already set up as the 'smart relay' host. The only lines within sendmail.cf that I have modified are:

(1) F{LocalIP} /etc/mail/LocalIP
(2) DSmyInternetISPrelay.com
(3) DHlocalmailserver.mydomain.com

The ONLY problem that I am having is that unless incoming email is from IP ranges specified in the LocalIP file, it get rejected. Therefore, all email delivered by my ISP from 'the world' get rejected.

Thanks.

Mark
Only the dead see the end of war!
Christopher Caldwell
Honored Contributor

Re: Sendmail 8.11 Relaying

I don't think you want to relay all mail everywhere - that'll get you're mail server blackholed in about 10 minutes (plus you'll get lots of hate mail).

On the off chance you really do want to relay all mail, look at promiscuous relay in the the sendmail documentation.

It's here
usr/contrib/sendmail/usr/newconfig/etc/mail/cf/README

I imagine that you really want to relay all inbound mail to a certain set of domains, where the relay that I'm on now might not be the final destination for the mail.

-If so, point the MX for the known domains at your relay.

-Uncomment the mailertable rulesets in sendmail.cf

For each domain you wish to relay, add a line like
a.com smtp:name.of.finalhost
to /etc/mail/mailertable where name.of.finalhost is the destintation you'd like to relay to.

Type
makemap dbm /etc/mail/mailertable < /etc/mail/mailertable

Restart sendmail (to read the new sendmail.cf).
Sean OB_1
Honored Contributor

Re: Sendmail 8.11 Relaying

Sendmail by default is set to not allow relaying.

Read through the conf file carefully. I know that there are parms to set to allow relaying of all mail.

Something like "Dontblamesendmail".

However please note that this is STRONGLY frowned upon as it will open your server up to be a relay for spammers and will likely get your server and all mail using it blacklisted.

Mark Hopkins_2
Frequent Advisor

Re: Sendmail 8.11 Relaying

Christopher/Sean,

Understood. Yes I really only want to relay email destined for mydomain.com. I attempted the mailertable instructions and got nowhere, so I backed them out.

Perhaps I can explain a little more. Currently I receive emails destined for mydomain.com from my ISP, so they handle MX. At my firewall I route inbound port 25 traffic to an exchange 2k server. All I want to do is insert a sendmail server into that path. It was easy to do outboud traffic. All I needed to do was make the sendmail server the smart relay host for the exchange server.

Thanks again.

Mark
Only the dead see the end of war!
Christopher Caldwell
Honored Contributor
Solution

Re: Sendmail 8.11 Relaying

MX for mydomain.com
->MX.MYDOMAIN.COM
Exchange is exchange.mydomain.com

on the my mx.domain.com server, uncomment the mailertable rulesets:

##### @(#) mailertable.m4 8.18 (Berkeley) 2001/07/16 #####
Kmailertable dbm /etc/mail/mailertable
R< $+ > $* $: < $(mailertable $1 $) > $2 lookup
### Ruleset 90 -- try domain part of mailertable entry ###
R$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
R$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "."
R< $* > $* $@ $2 no mailertable match

make a file called /etc/mail/mailertable

add a rule /etc/mail/mailertable that says
mydomain.com smtp:[exchange.mydomain.com]

make sure [exchange.mydomain.com] knows it's alright for it to recieve mail for mydomain.com

type
makemap /etc/mail/mailertable < /etc/mail/mailertable

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

Note: things can't get dicey if you're running split DNS (different view from the inside of the firewall vs. outside)--you might be running NAT.

The inside hosts should refer (and be named) using the inside DNS server.

If this doesn't work, post the diagnostic error messages from the following:

$ sendmail -v you@mydomain.com
test
.

and/or
what's in /var/adm/syslog/mail.log
Mark Hopkins_2
Frequent Advisor

Re: Sendmail 8.11 Relaying

Christopher,

I assumed that the command you wanted me to attempt was:

makemap dbm ...............

(I added the dbm)

Anyway.....

# tail /var/adm/syslog/mail.log
Aug 29 12:03:14 gemini sendmail[4041]: g7TH3Dw04039: to=, delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=124980, relay=smtp.enteract.com. [207.229.143.4], dsn=2.0.0, stat=Sent (Ok: queued as 5168D99DC)
Aug 29 15:21:06 gemini /sbin/init.d/sendmail[5566]: #### rebooted ####
Aug 29 15:21:07 gemini sendmail[5578]: Warning: .cf file is out of date: sendmail 8.11.1 supports version 9, .cf file is version 7
Aug 29 15:21:07 gemini sendmail[5578]: alias database /etc/mail/aliases rebuilt by root
Aug 29 15:21:07 gemini sendmail[5578]: /etc/mail/aliases: 6 aliases, longest 9 bytes, 76 bytes total
Aug 29 15:21:07 gemini sendmail[5580]: starting daemon (8.11.1): SMTP+queueing@00:30:00
Aug 29 15:24:41 gemini sendmail[5616]: g7TKOfi05616: ruleset=check_rcpt, arg1=, relay=mpmlbx01.mypoints.com [209.87.114.31], reject=571 5.7.1 we do not relay
Aug 29 15:24:42 gemini sendmail[5616]: g7TKOfi05616: from=, size=21004, class=0, nrcpts=0, proto=ESMTP, daemon=Daemon0, relay=mpmlbx01.mypoints.com [209.87.114.31]
Aug 29 15:26:41 gemini sendmail[5624]: g7TKQei05624: ruleset=check_rcpt, arg1=, relay=[63.170.166.28], reject=571 5.7.1 we do not relay
Aug 29 15:26:41 gemini sendmail[5624]: g7TKQei05624: from=, size=0, class=0, nrcpts=0, proto=SMTP, daemon=Daemon0, relay=[63.170.166.28]
Only the dead see the end of war!
Mark Hopkins_2
Frequent Advisor

Re: Sendmail 8.11 Relaying

Christopher,

Thanks for the help. It turned out that I needed to uncomment other lines having to do with the mailertable... not just the ones you cited. Everything seems to work as I want. I am a little concerned that the log file says that I am using an old sendmail.cf but I will look into that on my own before bothering the forum.

Thanks to all.

Mark
Only the dead see the end of war!
Christopher Caldwell
Honored Contributor

Re: Sendmail 8.11 Relaying

==>I am a little concerned that the log file says that I am using an old sendmail.cf but I will look into that on my own before bothering the forum.

The installer is nice and doesn't overwrite your sendmail.cf file. They expect you to get the new sendmail.cf file from
/usr/contrib/sendmail/usr/newconfig/etc/mail

You'll need to "re-customize" the sendmail.cf file, but then all will be well.
Mark Hopkins_2
Frequent Advisor

Re: Sendmail 8.11 Relaying

Christopher,

Yeah I know. The config file is SUCH A BEAR though. Thanks again.

Mark
Only the dead see the end of war!
Mark Hopkins_2
Frequent Advisor

Re: Sendmail 8.11 Relaying

All,

Thanks again for the help. As it turned out, it was VERY easy to create all sendmail files from scratch, with my own .mc file. Took about an hour. Thanks to your input I have the configuration that I want.

Mark
Only the dead see the end of war!