1828582 Members
2396 Online
109982 Solutions
New Discussion

Sendmail configuration

 
SOLVED
Go to solution
Joan Blais
Frequent Advisor

Sendmail configuration

Gurus -
I set up the following in sendmail.cf:

A way to use mailertable to route mail to the specified host on a different port.

NOTE: Any occurence of '940' in this document can be changed to whatever port you want to use.

1. First, you need to specify another listening port in your sendmail.cf on the blocked host. You can do this by adding the
following line:

OOPort=940

This will make sendmail listen on port 940 in addition to port 25.

2. Specify a new 'relay mail header masquerading recipient rewriting' line in the sendmail.cf on the host that will be forwarding
the mail to your blocked host.

This can be done by first copying the Mesmtp rewriter that looks like this:

Mesmtp, P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=TCP $h

Next, modify it to look like this:

Mesmtp940, P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=TCP $h 940

3. Now, you need to add your entry to your mailertable and indicate that you want to use 'esmtp940' instead of just 'esmtp'.

example-domain.com esmtp940:[mx-blocked.example-domain.com]

4. Make sure example-domain.com has been added to your relay-domains file, otherwise the host that will receive mail on port
25 will not accept any mail for that domain.

5. Restart sendmail. Try sendmail some mail and see if your unblocked host will forward mail it receives for the domain to the
blocked host on port 940.

How do I complete step 3? Where/what flags are used with this change? Steps 1,2,4 and 5 were completed.
Thanks,
Joan
1 REPLY 1
Geoff Wild
Honored Contributor
Solution

Re: Sendmail configuration

Did you re-compile sendmail? by default, HP doesn't have mailertable builtin...best to download sendmail from sendmail.org...

Setting up 'mailertable'

To set up 'mailertable', you need to edit your sendmail .mc file and add the following line:

FEATURE(`mailertable')

After doing this, you need to using the script supplied with the Sendmail source to rebuild your configuration file.

Now, open your new Sendmail configuration file and look for this (it should be in the first couple hundred lines of the file):

Kmailertable hash /etc/mail/mailertable


This defines where the 'mailertable' file should be, and in this case it is in /etc/mail.


After that, you need to add to /etc/mail/mailertable :

example-domain.com esmtp940:[mx-blocked.example-domain.com]

After editing this file, you must create a database map of this file for Sendmail to read. Do this by running:

/usr/sbin/makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable

Stop/start sendmail...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.