Operating System - HP-UX
1833777 Members
2266 Online
110063 Solutions
New Discussion

Sendmail Accept Connections from Specified Hosts

 
Ron Brown_2
Frequent Advisor

Sendmail Accept Connections from Specified Hosts

I am using Sendmail version 8.11.1, config V9/Berkeley, on HP-UX 11.0. I would like to configure sendmail, if possible, to accept connections only from a specified set of mail relays to prevent spammers from directly accessing the machine. Is this possible? How?
should work...
4 REPLIES 4
Geoff Wild
Honored Contributor

Re: Sendmail Accept Connections from Specified Hosts

Yes - create an access db:

create /etc/mail/access

tab delimited:

hosta relay
hostb relay

makemap hash /etc/mail/access
then 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.
Ron Brown_2
Frequent Advisor

Re: Sendmail Accept Connections from Specified Hosts

Will the above limit connections to ONLY those hosts I specify? I edit the access db all the time to block specific hosts and addresses; this seems like it will allow relaying from those hosts in addition to any other connections that come in. I am trying to limit connections to this machine to only those hosts that I am using as mail gateways.
should work...
Doug O'Leary
Honored Contributor

Re: Sendmail Accept Connections from Specified Hosts

Hey;

No, it will only limit relaying to those hosts specified. Your best bet would be to use a firewall to prevent any but a select set of hosts from accessing your mail system's port 25. If you're not behind a firewall, you can probably get iptables compiled on HP using gcc pretty easily.

Failing that, you could probably try adding something like the following to the access database:

0.0.0.0 REJECT
$host1 OK
$host2 RELAY
...
$host# OK
$host# RELAY.

I don't have the opportunity to test that out; however, it may be worth a try.

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Geoff Wild
Honored Contributor

Re: Sendmail Accept Connections from Specified Hosts

The only way to really block connections - is through a firewall....on Linux I use iptables...on HP, you can use ipfilter:

http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=B9901AA

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.