Help - Search - Members - Calendar
Full Version: How to Prevent the IIS SMTP Virtual Server from Relaying E-mail Messages
The Planet Forums > Operating Systems > Microsoft Windows > Windows HOWTOs
omkars
1:- Start Internet Information Services Manager or open the Internet Information Services (IIS) snap-in.

2:- Expand Server_name, where Server_name is the name of the server, right-click Default SMTP Virtual Server, and then click Properties.

3:- Click the Access tab, and then under Access control, click Authentication.

4:- Click to select either or both the Basic authentication and the Integrated Windows authentication check boxes, click to clear the Anonymous access check box (if it is selected), and then click OK.

By doing so, authentication is required before access is granted to the SMTP virtual server. In this case, if the user or computer does not successfully authenticate, the user or computer cannot send mail to the server.

NOTE: If you click to select the Anonymous access check box and do not click to select the Basic authentication and the Integrated Windows authentication check boxes, all users and computers are able to access the SMTP virtual server.

This disables authentication.

5:- Under Relay restrictions, click Relay.

6:- Note the options that are available in the Relay Restrictions dialog box. By default, the Only the list below option is selected and this list is empty. Additionally, the Allow all computers which successfully authenticate to relay, regardless of the list above option is selected. With this feature, users and computers that can authenticate with the server can relay through the server. All computers are blocked except those that meet the authentication requirements that you configured earlier in the Authentication dialog box of the Access tab.

Note that if you allow only anonymous access, the server does not authenticate users or computers.

7:- Click Add, and then do one of the following to add a single computer, group of computers, or a domain:

Click Single computer.

Type the IP address of the computer that you want in the IP Address box, and then click OK.

Click Group of computers.

Type the subnet address and the Subnet mask of the group into the corresponding boxes, and then click OK.

Click Domain.

Type the domain name that you want in the Name box, and then click OK.

If you do not want to add a computer, group or computers, or a domain, click Cancel.

8:- Click OK, and then click OK.
LighthousePoint
_//_ Thread Moved _//_

To Windows How-To section.
Justin171985
Hello,

Do you know what could be causing this problem?..

QUOTE
Notice: Undefined variable: sentemail in C:Inetpubwwwrootform.php on line 2

Notice: Undefined variable: sentmessage in C:Inetpubwwwrootform.php on line 7

Warning: Cannot modify header information - headers already sent by (output started at C:Inetpubwwwrootform.php:2) in C:Inetpubwwwrootform.php on line 8

Notice: Undefined variable: firstname in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: lastname in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: thereemail in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: username in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: password in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: startingmap in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: timelimit in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: frag_limit in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: gametype in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: mod in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: players in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: public in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: serverpassword in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: referedby in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: referedother in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: commentsinformation in C:Inetpubwwwrootform.php on line 10

Notice: Undefined variable: email in C:Inetpubwwwrootform.php on line 13

Notice: Undefined variable: email in C:Inetpubwwwrootform.php on line 14

Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for justin171985@charter.net in C:Inetpubwwwrootform.php on line 15

Thanks in Advance,
Justin.
LighthousePoint
1st: Possibly you are referencing variables created in an unsupported way. Generally this means turn on Register_Globals, or re-write your code.

2nd: I appears you have secured your mail sever (very good)... but that does break php's mail() function.
Justin171985
Hello,

Thanks a lot..

could you give me an idea on how to go about fixing this?..

Justin.
LighthousePoint
fix how you're referencing variables. If they're from a form, do NOT use $var, instead, use $_POST['var']

As for the mail problem, use something that facilitates authenticated SMTP authentication.

I'll have a how-to up shortly that'll be of help icon_wink.gif
gooberdlx
well first off.. the errors tell you that you are forgetting the $ in front of your variables...

QUOTE
Notice: Undefined variable: sentemail in C:Inetpubwwwrootform.php on line 2


If you go to line 2 in your code, you should place a $ in front of sentemail, if its a local variable... if they are form variables, then
ALWAYS use the $_ variables to reference the predefined variables.. ($_GET , $_POST, $_SERVER, etc..) as LighthousePoint has "pointed out"

It MIGHT not be a problem of authentication, it could be that your relay settings only allow for local users or emails that are hosted within your email server...

Jake
Justin171985
Hello,

The form works correctly, because I have tested it over and over again on my Linux server, but when it's placed on Windows it dont work correctly and I have it set to anonomous for the relay part.

Justin.
Justin171985
Hello,

I also go this error not long after IIS was started..

QUOTE
HTTP 403.9 - Access Forbidden: Too many users are connected
Internet Information Services


Thanks in Advance,
Justin.
Justin171985
Hello,

I figured out that last post of mine, but still can't figure out why it's not doing right...

I tried turning on Register_Globals, and It didnt help.. you do turn that on in the php.ini file, correct.. just to make sure I did that right..

Thanks,
Justin.
LighthousePoint
yep, c:windowsphp.ini. You should restart IIS after changing it.
gooberdlx
well.. FYI. if your program requires Register_Globals to be on, then you arent writing good code! PHP 4+ should NEVER require that to be on! Good luck with your problem, hopefully you can get it worked out

Jake
rubaljain
QUOTE
Originally posted by Justin171985
Hello,

I figured out that last post of mine, but still can't figure out why it's not doing right...

I tried turning on Register_Globals, and It didnt help.. you do turn that on in the php.ini file, correct.. just to make sure I did that right..

Thanks,
Justin.


Hello,

If you modify php.ini there is no need to restart IIS. It will work without restarting IIS or W3SVC services.

Regards,
gooberdlx
True dat!

No restart required when you change your php.ini!

w00t!

Jake
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.