Add IP range to allowed relay hosts


Apr 5, 2012
cPanel Access Level
Root Administrator
How can I add an IP range to teh /etc/relayhosts file so they can be allowed to relay without out having to enter each address seperately. If a range can't be done is there a way that I can have exim look through multiple files to see who is allowed so that I can create a file for the IP address range that way it would not clutter up our main /etc/relayhosts file. Thank you.


Quality Assurance Analyst
Staff member
Oct 2, 2010
somewhere over the rainbow
cPanel Access Level
Root Administrator
The /etc/relayhosts file can't be manually edited as antirelayd will wipe any changes you make to it.

Instead, you can add a file /etc/alwaysrelay and add the IPs into that file for to allow it to relay through your server. The /usr/sbin/antirelayd script will look for that file and then add the IPs into it into relayhosts file for you.

I am not certain if you can actually add a range to that file. If you cannot get it to work as you'd like, you can always post on's mailing list to see any suggestions they might have.