Issue on SMTP virtual server configuration in IIS 6

G

Gavin Lu

Hi all,

During the setup process of my SMTP sink DLL, I want to configure some
properties of SMTP virtual server. I use ADSI to set them. For many
properties such as "ServerComment", "MaxOutConnections" of
directory entry "IIS://localhost/smtpsvc/1", I could set them all.
But for "IPSecurity" & "RelayIpList" properties, it's a little
different & difficult.

Currently I could set SMTP server IPSecurity/RelayIpList properties in
IIS 6 partly, but not all.

Here's my code in C#:

DirectoryEntry smtpsvc = new
DirectoryEntry("IIS://localhost/smtpsvc/1");
PropertyValueCollection RelayIpListValCollection =
smtpsvc.Properties["RelayIpList"];
IPSecurityClass RelayIpListClass = new IPSecurityClass();
RelayIpListClass.GrantByDefault = false;
RelayIpListClass.IPGrant = "192.13.32.111";
RelayIpListValCollection.Clear();
RelayIpListValCollection.Add( RelayIpListClass);

It works for RelayIpList property, and IpSecurity property. But I
don't know how to add two & more IP for this IPGrant or IPDeny list
in a batch. I could only find an example of
"192.13.32.111,255.255.255.0" for IP/mask, and I failed to replace
it with "192.13,32.111;192.14.32.111"or something like that for two
independent IPs.

Could anyone please give me any hint?

Thanks.

-Gavin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top