System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

smart host in sendmail -- plz help

 
SOLVED
Go to solution
Maaz
Valued Contributor

smart host in sendmail -- plz help

Experts
mta: sendmail

I have a mailserver(small_mail_server), that is not directly connected to the internet, and another server(big_mail_server) that is connected to internet.

email clients are configured to use/communicate with small_mail_server.

I have to config small_mail_server so that any mail destined for the outside(internet) will be forward/hand-over/relay to big_mail_server

what should i do ?
and whats the smart host is ?

Please help
Regards
Maaz
10 REPLIES
Ivan Ferreira
Honored Contributor
Solution

Re: smart host in sendmail -- plz help

The smart host is exactly what you need. The smart host is the hosts that will be contacted to send all emails to non resolvable domains. Configure in your .mc file:

define(`SMART_HOST',`big_mail_server')

Regenerate your cf file:

m4 sendmail.mc > sendmail.cf

Restart the service.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Alexander Chuzhoy
Honored Contributor

Re: smart host in sendmail -- plz help

Just to add to Ivan's reply that in recent versions you can simply do:
cd /etc/mail; make;
to regenerate to sendmail.cf file.
Maaz
Valued Contributor

Re: smart host in sendmail -- plz help

Thanks Dear Ivan Ferreira and Alexander Chuzhoy for help.

Dear Ivan and Alexander I have edit the /etc/mail/sendmail.mc as:

define(`SMART_HOST',`big_mail_server')
cd /etc/mail; make

Two Questions here
1, if my small_mail_server is a client of a dns server, and the dns server is able to resolve internet domain... then will my small_mail_server will frward the emails(outside the organization) to the big_mail_server ?
2, should i have to do some work on big_mail_server also ?

plz help again ;)
Thanks n Regards
Maaz
Ivan Ferreira
Honored Contributor

Re: smart host in sendmail -- plz help

Two Questions here
1, if my small_mail_server is a client of a dns server, and the dns server is able to resolve internet domain... then will my small_mail_server will frward the emails(outside the organization) to the big_mail_server ?

No. Mails will be sent directly by small_mail_server. You should disable DNS queries for sendmail in this server. See:
http://www.sendmail.org/faq/section3.html#3.22

2, should i have to do some work on big_mail_server also ?

Yes. You must allow the relaying to small_mail_server. This normally is done in the /etc/mail/relay-domains or /etc/mail/access file. Also if you want that big_mail_server also deliver mail to small_mail_server, you must configure a mailertable.

http://www.sendmail.org/m4/mailertables.html
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: smart host in sendmail -- plz help

Again Same question but now mta is POSTFIX

small_mail_server: mta is postfix
big_mail_server: mta is postfix

what I have to do on small_mail_server and big_mail_server ... plz help

Regards
Maaz


Ivan Ferreira
Honored Contributor

Re: smart host in sendmail -- plz help

Edit main.cf in small_mail_server:

relayhost=[big_mail_server]

In big_mail_server:

The relaying of email to the internal email server is done through the transport_maps
directive. This directive instructs Postfix to look at the transport map and do pattern
matching based on the destination domain name.

The transport file is quite simple:
/etc/postfix/transport:
domain.com smtp:internal-mail.domain.com

After creating the transport file, issue the following command:
postmap hash:/etc/postfix/transport
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: smart host in sendmail -- plz help

I am sorry I am asking again and again...plz accept the appologies from my side... I am really a bad/duffer System Support Personal.

Infact I havent access the boxes(postfix/sendmail)... but I have to configure those machines in a day or two..thats why I am preparing.

One more thing here... say small_mail_server is running on 10.0.0.0/24 subnet... then should I have to configure the /etc/postfix/access file on big_mail_server as...

10.0.0.0 RELAY

and If my small_server is working for test.net domain, then on big_server,
/etc/postfix/transport:
test.net smtp:internal-mail.test.net

Thanks n Regards
Maaz
Ivan Ferreira
Honored Contributor

Re: smart host in sendmail -- plz help

In small_mail_server, you don't have to configure the access file because you already have a directive called mynetworks. Postfix will allow relay to mynetworks by default.

Your transport table for big_mail_server is correct.

If want to be really prepared for the day of the configuration, you should setup a pair of virtual machines and configure sendmail/postfix as you want. Then replicate the configuration in your client.

I suggest you to use postfix if you can. I just moved from sendmail to postfix and I think that was a good choice by many resons, but the LDAP support that provides postfix is really good (for example, combined with ldapadmin.exe).
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: smart host in sendmail -- plz help

Please excuse and forgive me i am asking again and again... sorry ;-(

please let me know is there any thing missing or mistake in the big_mail_server and small_mail_server's /etc/postfix/main.cf file

big_mail_server's main.cf

all the default options and

myhostname = smtp.test.net
mydomain = test.net
myorigin = test.net
inet_interfaces = all
mydestination = $myhostname, localhost, $mydomain
mynetworks = 127.0.0.0/8, 10.0.0.0/24

Plus

in /etc/postfix/transport of big_mail_server
test.net smtp:internal-mail.test.net

Above is the total Configs of big_mail_server(that connects with internet).

Now following is the total configs of small_mail_server.
/etc/postfix/main.cf
all the default options plus the following:

myhostname = local.test.net
mydomain = test.net
myorigin = test.net
inet_interfaces = all
mydestination = $myhostname, localhost, $mydomain
mynetworks = 127.0.0.0/8, 10.0.0.0/24

small_mail_server is connected on lan ONLY, while big_mail_server is connected to the internet, and also with the small_mail_server.
Maaz
Valued Contributor

Re: smart host in sendmail -- plz help

in big_mail_server /etc/postfix/transport

test.net smtp:local.test.net

becuase my small_mail_server fqdn is "local.test.net"

on big_mail_server I also did the following
in /etc/postfix/access

10.0.0.0 RELAY

please suggest If any thing is missing/wrong.

Regards