Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relaying quick question.

Status
Not open for further replies.

Stingreen

Technical User
Mar 5, 2001
86
US
Guys,
How can I give relay permission to a specific IP range ?
Let's say I want to be able to give relay between 192.168.1.1 and 192.168.1.20. I don't want to enter all IP's one by one to access database.
Is there any simpler way to do this ?
Thanks in advance..
 
If you have a DNS server on your network then you just only need to specify the names. But if you want all the servers in your network to relay to this server then a simple 192.168.0.0 will do and you wont have to list all.
 
Thank you for the reply,
I don't own all the IP block so I can't just let 192.168.0.0 to relay. I'm sure somebody will find me and send his spam outta my server.
I do have a DNS server in the network, but the point is this time I have to enter the host names 1 by 1. That's what I don't want to do..
All I'm looking for is, 1 line of code in the access db, could be like
192.168.0.1/20 but I don't know the right conf. for it.
Thank you.
 
Do you have your sendmail on Linux? What version of sendmail?

There should be an /etc/mail/access file that you can do stuff like:

192.168 : RELAY
dontwant.com :REJECT
evilevil.com :DISCARD

This configuration will allow Relaying from all IP's within the 192.168 subnet, reject all mail from anyone@dontwant.com, and flat out discard any email from evilevil.com.

Hope this helps.
 
I dont know of any quick way for that. You suggested 192.168.1.1/20 the "/20" linux sees as a subnet mask. (I think /24 means: 255.255.200.0.. I know "/24" is definately 255.255.255.0 though. So dont use the slash.
As long as the ip's of 192.168.1.1 ~ 192.168.1.20 are in the /etc/hosts file, Linux will relay mail for those ip's and serve mail as well.. Whatever ip is missing from the /etc/hosts file Linux should not allow relay or pop service for. Other than that, I dont think theres any way to tell sendmail you want to relay ip addresses by specifying a range, such as 192.168.1.1~192.168.1.20 unless you type each individual IP address in either the access file and/or hosts.
I believe thats true.
Im a newbie still myself ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top