Operating System - Linux
1828990 Members
3459 Online
109986 Solutions
New Discussion

Sendmail config -- plz help

 
SOLVED
Go to solution
Maaz
Valued Contributor

Sendmail config -- plz help

Hello Dear Gurus

test.com, a.test.com, and b.test.com has sendmail as their smtp server. All of these smtp servers are connected via lan, and only "mail.test.com" is connected with Internet.

1, I want to configure that All mails to Internet from mail.a.test.com and mail.b.test.com should be forward/passed to "mail.test.com", and then mail.test.com will forward/passed the mails to Internet.
2, mail.test.com will receive mails from Internet and forward/passed mails to appropriate server i.e either to mail.a.test.com or mail.b.test.com

plz let me know what configuration I have to do

Regards
Maaz
9 REPLIES 9
Steven E. Protter
Exalted Contributor
Solution

Re: Sendmail config -- plz help

Shalom Maaz,

Use the DS directive in sendmail.cf

DSmail.test.com

In the secondary servers.

Add the following to mail.test.com /etc/mail/access file

mail.b.test.com RELAY
mail.a.test.com RELAY

You may need to compile your sendmail databases as well.

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
Vitaly Karasik_1
Honored Contributor

Re: Sendmail config -- plz help

1. you should configure "mail.test.com" as "smart relay host" in sendmail config for your "internal" servers.

just add to your sendmail.mc:
define(SMART_HOST,mail.test.com)

see http://www.rhce2b.com/clublinux/RHCE-17.shtml or
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1019515 for more links

2. Do you have some users on a.test.com, other users on b.test.com and so on?
Maaz
Valued Contributor

Re: Sendmail config -- plz help

>2. Do you have some users on a.test.com, other users on b.test.com and so on?

Yes, user1@b.test.com and user1@a.test.com
Steven E. Protter
Exalted Contributor

Re: Sendmail config -- plz help

Shalom again

mailtest

sendmail -v -d8 -d38 someone@mail.test.com

type some text

.


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
Maaz
Valued Contributor

Re: Sendmail config -- plz help

Dear SEP, and Vitaly Karasik Many Thanks for Prompt help/reply

One more thing to ask .. when to use MAIL_HUB option in sendmail.mc e.g what does the following line means ?
define (`MAIL_HUB', `mail.test.com')

Thanks n Regards
Maaz
Vitaly Karasik_1
Honored Contributor

Re: Sendmail config -- plz help

AFAIK , mail_hub works very similar to "smart host".

As for your second question - you can use virtusertable (if you want to use addresses like username@test.com for all users) or domaintable (if you want to use user@a.test.com, user@b.test.com addresses)
Maaz
Valued Contributor

Re: Sendmail config -- plz help

Dear Vitaly Karasik Thanks
Currently I have to maintain separate addresses like userx@b.test.com and usery@a.test.com, but later on we might switch to addresses like username@test.com.
1, Either I have to edit virtusertable or domaintable, the mail server will "mail.test.com" .. is it ?
2, If us plz write me the syntax of domaintable and virtusertable ?

Thanks n Regards
Maaz
Alexander Chuzhoy
Honored Contributor

Re: Sendmail config -- plz help

below is an example /etc/mail/virtusertable file:
admin@freebsdhelp.org john
dave@freebsdhelp.org dave@yahoo.com
@freebsdhelp.org big@kuwaitnet.net
@mail.test.com %1@a.mail.test.com

You have to read it from left to right.
Thus first line means: mail sent to admin@freebsdhelp.org should be forwarded to local user john.
Second line: mail sent to dave@freebsdhelp.org should be forwarded to dave@yahoo.com
Third line: mail sent to any mailbox in @freebsdhelp.org domain should be forwarded to big@kuwaitnet.net.
Fourth line: mail sent to some user at @mail.test.com domain will be redirected to the same user from a.mail.test.com domain.




The domaintable file is used to force sendmail to perform specific instructions after using DNS. The file, which is almost never used on Linux systems, allows you to provide expansion of short-form names. For example, suppose you often send mail to the host reallylongname.reallybignet.com but donâ t want to type that entry each time. You can place an entry in the domaintable file that looks like

reallylongname.reallybignet.com big.com

so that whenever you send mail to bill@big.com it is expanded by sendmail to bill@reallylongname.reallybignet.com. The domaintable file can also be used to correct common typographic mistakes. For example, if you find many users sending mail to abcdef.com instead of abcdfe.com, you can add a line to the domaintable file that corrects the domain name. Such a line looks like this:

abcdfe.com abcdef.com

The format of the file is always correct domain followed by the incorrect (or shortened) domain name.
Alexander Chuzhoy
Honored Contributor

Re: Sendmail config -- plz help

Forgot to mention that in order for the changes to take place - do: service sendmail restart.


One more thing;
If a.test.com and b.test.com are local to your LAN - it probably means that they aren't registered with world's DNS servers and must be added manually to the DNS server that mail server from mail.test.com domain uses...
Hope it helps,
Cheers.