LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Sendmail / Mailertable not working! (https://www.linuxquestions.org/questions/linux-networking-3/sendmail-mailertable-not-working-152996/)

topkart94 03-03-2004 09:07 AM

Sendmail / Mailertable not working!
 
Hi,

I installed Redhat Linux 9 with Sendmail. I want to use sendmail as a gateway. All mails that reach sendmail are send directly to the internet (by solving the mx records and being sent directly to the resposible mailserver) and for one particular domain (test.com) should be directed to an internal Ip on the network e.g. 172.16.130.3.
Outgoing emails work fine.
I made an entry in the mailer table (Domain Routing) which are like this:

.test.com. smtp:[172.16.130.3]
test.com. smtp:[172.16.130.3]

though still, all emails sent to the domain test.com, sendmail is still trying to solve the mx records for them instead of forwarding them directly to the smarthost. Any ideas please?

Regards,

linuxxed 03-03-2004 10:48 AM

I hope you've built support for mailer table in the .mc file, compiled using m4 and restarted sendmail.

sorry to point out the obvious but many people commit this mistake.


FEATURE(`mailertable', `dbm /usr/lib/mailertable')

Does the smtp server to which the mail is forwarded recognize itself as test.com?

topkart94 03-03-2004 11:32 AM

"FEATURE(`mailertable', `dbm /usr/lib/mailertable') "

Hi,

sorry but i am a newbie to sendmail. I was making the configuration through webmin. If I edit the .mc file then how can i effect the changes of sendmail in .cf file pleaese? I just run this command "make -C /etc/mail"
could you please guide me?

thanks

linuxxed 03-03-2004 01:20 PM

Hi mate

Make a backup of sendmail.mc and sendmail.cf.

First check your /etc/mail/sendmail.mc for a line like

FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl

If not present then add it.

Compile it.

$ m4 /etc/mail/sendmail.mc>/etc/mail/sendmail.cf

Add your entries to /etc/mail/mailertable.
Generate the database by
$ makemap hash /etc/mail/mailertable </etc/mail/mailertable
This will create mailertable.db file.

Restart sendmail.

$ service sendmail restart



hope this helps

topkart94 03-04-2004 06:54 AM

Hi,

That line you mentioned was in the mc file, therefore there was no need to recompile right?

Also, I edited maileirtable and run the command you gave me, but still without success. I tried deleting mailertable.db and recreating it again by running that command, but the mails are still trying to use DNS Server for delivery. Any ideas?

Btw what is the difference between SMTP and relay when setting up the mailer table?

Thanks in advance for all your valuable help.

linuxxed 03-05-2004 07:44 AM

How are you testing whether it is trying to use DNS?

What happens when you run sendmail in test mode?

sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> 3,0 foo@test.com

http://www.freebsd.org/doc/en_US.ISO...smtp-uucp.html

This link will help.

topkart94 03-05-2004 11:27 AM

Hi Mate,

It worked fine. I tried everything from scratch and it worked. I checked this document http://www.sendmail.org/m4/mailertables.html (as you told me exactly) and it worked. Thanks very much for your help :)


All times are GMT -5. The time now is 09:24 AM.