Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

How to activate two relay systems?

How to activate two relay systems?

Hello,

I have two network zones, with a exchange server each one. I want relay all mails "domain.com" to server1, and the rest to server2, "domainx.com", "domainy.com".

I have modified sendmail.cf on this way:

DSserver1

Kmailertable dbm /etc/mail/mailertable

And mailertable:
domainx.com smtp:server2
domainy.com smtp:server2

Where is the error? All of mails go to server1.

What can I do to configure that correctly?

Thanks in advance and excuses by my writing.

9 REPLIES
Steven E. Protter
Exalted Contributor

Re: How to activate two relay systems?

/var/adm/syslog/mail.log

This file probably contains error messages that will make this easier to diagnose.

Please take a look there and post anything that looks strange.

You might want to do this:

fail -f /var/adm/syslog/mail.log

Then send a mail that should be relayed, watch the log.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com

Re: How to activate two relay systems?

The file mail.log has any error, simply:

Sep 3 15:10:29 amarillo10 sendmail[9487]: PAA09487: to=paco@porras.com, ctladdr=root (0/3), delay=00:00:02, xdelay=00:00:01, mai
ler=relay, relay=server1 [89.1.0.156], stat=Sent (Mail accepted)
Sep 3 15:14:25 amarillo10 sendmail[9500]: PAA09500: from=root, size=0, class=0, pri=30000, nrcpts=1, msgid=<200309031314.PAA09500@pio10>, relay=root@localhost
Sep 3 15:14:25 amarillo10 sendmail[9500]: PAA09500: to=rosario@flores.com, ctladdr=root (0/3), delay=00:00:01, xdelay=00:00:00, mai
ler=relay, relay=server1 [89.1.0.156], stat=Sent (Mail accepted)

No error, but all the exchange is goint to "server1".
Kasper Haitsma
Trusted Contributor

Re: How to activate two relay systems?

Hi,

Please reveal the version of your sendmail config:
# echo quit | sendmail -bs

perhaps the rules for using the mailertable are not active, or incorporated in your sendmail.cf:

# grep -i mailertable sendmail.cf

if there are lines that start with:
#S...
#R...
then using the mailertable is not activated in your sendmail.cf
and last but not least, after creating the text file /etc/mail/mailertable, you need to manually build the database:

# makemap dbm /etc/mail/mailertable < /etc/mail/mailertable

HTH

Kasper
It depends

Re: How to activate two relay systems?

The sendmail's version is "ESMTP Sendmail 8.8.6 (PHNE_17190)/8.8.6; Thu, 4 Sep 2003 11:11:08 +0200 (MEST)"

In the sendmail.cf these are the lines with "#":

#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

Should I uncoment these lines?

In the sendmail.cf I have this other line:

# Mailer table (overriding domains)
Kmailertable dbm /etc/mail/mailertable

Is the mailertable activated so?

Thanks
Kasper Haitsma
Trusted Contributor

Re: How to activate two relay systems?

Hi,

Well there you have it :-)
You need to remove the single comments for both complete blocks, where the lines occur.

make sure the 'space' between 'statements' are 's, you can see this in vi, by issueing the command:
:set list
this will show the non-displayable characters:
$
^I

and ofcourse the makemap I mentioned

HTH

Kasper
It depends

Re: How to activate two relay systems?

oh....

I have removed the comments and the makemap. The mails continue going to "server1". They ignore the mailertable file..

There is some thing that I must do?

There is any way to configurate this? ??domaintable???


Steven E. Protter
Exalted Contributor

Re: How to activate two relay systems?

As far as I know, you can only have one DS directive.

You can handle multiple domains with the mailertable entries AND

entries in virtusertable and generictable to handle the second domain

virtusertable will look like this:

@domainofserver2username

genrics will be the reverse

username@domainofserver2


AND

entries in

/etc/mail/aliases

forwarding mail for that dummy user to server2

@domainofserver2username


You'll probably need a dummy username to make it work.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com

Re: How to activate two relay systems?

Hi..
It's alredy works... !!

I don't know exactly what I have done, but, the mail's are going to SERVER2...

THANKS..
Kasper Haitsma
Trusted Contributor

Re: How to activate two relay systems?

Sorry Stephen, I know you are most of the time very knowledgable, but I think you take too long a road to get there.

mr Poster, I have uncommented lines 1382-1386, two lines before until two line after your 1st hit in the rule are of mailertable:
# not local -- try mailer table lookup
R$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name
R< $+ . > $* $: < $1 > $2 strip trailing dot
R< $+ > $* $: < $(mailertable $1 $) > $2 lookup
R< $~[ : $+ > $* $>95 < $1 : $2 > $3 check -- resolved?
R< $+ > $* $: $>90 <$1> $2 try domain

and the line of ruleset S90 (1511-1516):

S90
R$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
R$* <$~[ : $+ > $* $>95 < $2 : $3 > $4 check -- resolved?
R$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again
R$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "."
R< $~[ : $+ > $* $>95 < $1 : $2 > $3 "." found?
R< $* > $* $@ $2 no mailertable match


I have also added a line to the mailertable, that reflects the DS:

. esmtp:server1

are you sure you have built the mailertable database:

makemap dbm mailertable < mailertable.

You can verify (without sending a message, potentially with a test sendmail.cf):
# sendmail -bt
or
# sendmail -bt -C sendmail.cf.test
>/parse user@domain
... (a lot of lines)
mailer esmtp, host server1, user user@domain

>/parse user@domainx.com
... (should return)
mailer smtp, host server2, user user@domainx.com

>D # to exit back to your shell

HTH
Kasper
It depends