07 May 2009

Setting SMTP RelayIpList from a script.

SMTP service running on IIS 6.0 provides you options to restrict IP addresses of computers that can relay mail messages through this server.

relayrestrictions

The value(list of IP addresses) is stored in the RelayIpList metabase property as an octet string. I was recently contacted by a server administrator to figure out if there is an automatic script that can add IP addresses to this list. He wanted to add around 200 IP address and grant them access.

I have written a script that you can use in such scenarios. It reads IP addresses from a text file and populates them into the RelayIpList.

USAGE : cscript ImportRelayList.vbs

PREREQUISITE : This script needs ip.txt in the same folder.

Store your IP addresses in ip.txt FORMAT: Each line should be IP,MASK

ImportRelayList

I have attached the script to this blog post. Hope it helps.


Bookmark and Share

Filed under: ,
Attachment(s):ImportRelayList.zip
 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Setting SMTP RelayIpList from a script. | Microsoft Share Point said:

PingBack from http://microsoft-sharepoint.simplynetdev.com/setting-smtp-relayiplist-from-a-script/

07 May 09 at 7:29 PM
# Richard said:

I would just like to say thanks for this scr1pt, just saved me some work doing something similar myself.

03 June 09 at 10:51 AM

Leave a Comment

Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Page view tracker