In reply to my own post.

I have successfully configured an application to run as a service to map
port 587 to port 25.  I provide instructions below to everyone on the list,
in the hopes that it will help someone else.  I welcome
corrections/additions/etc. to make this document as accurate as possible.  I
believe it is useful because it allows iMail to accept mail on a port other
than 25, so that email clients that are connecting with an ISP that is
blocking port 25 can still utilize your own server for outgoing mail.

Note this has ONLY been tested on Windows 2003 Server, with iMail 7.15.
You'll need to obtain the (free) windows 2003 resource kit tools and the
(free) port mapping software.  No guarantees, use at your own risk, blah
blah blah...

===============================================
Get the port mapping software and "install" it:
===============================================

Obtain the port-mapping application from http://www.kmint21.com.

Unzip and put the contents of the download in C:\Program Files\port-map\


=====================================================
Run the port mapping software using a command prompt:
=====================================================

c:\progra~1\port-map\pm.exe 5587 {imail.box.ip.addy} 25 w h

A window with status information should open for you.

(note the "5587" is not a typo for mapping port 587 -- pm.exe seems to
ignore the first character of  the port number you are mapping to a local
port. Note that the authors of pm.exe may very well fix  this in the future,
and therefore you may need to adjust your parameters in the future if you
obtain a  newer version of pm.exe. The W lets the app write a log file in
the app's own directory, and the H  tells the app to run "hidden".  You may
wish to remove the W parameter after testing is complete,  unless you don't
mind cleaning/removing the log file every now and then.)


==========================================
Test your access to port 587 using telnet:
==========================================

At a command prompt, type:
telnet yourmachine.example.com 587

You should get a response from your server, and be able to issue an ehlo
command and get a normal response from your mail server... just as you would
if you had connected on port 25.


====================================
Since you're already in a telnet session, you might as well test to see if
you can send a message to a local email address.
Enter the following telnet commands one at a time:
====================================

ehlo
mail from: {your email address}
rcpt to: {your email address}
data
test using port 587
.


(The dummy message should be queued at this point, and you should receive
your message fairly immediately).


====================================
Since you're already in a telnet session, you might as well test to see if
implementing port 587 mapping has made you an open relay in some way.
Enter the following telnet commands one at a time:
====================================

ehlo
mail from: [EMAIL PROTECTED]
rcpt to: [EMAIL PROTECTED]

(after submitting the "rcpt to" command you should get a 550 error.  If it
says "ok" and awaits DATA,  then you are an open relay.  Check to make sure
your own iMail server's IP addresses are not in the  "relay for addresses"
list.)


=====================
IF YOU GOT THIS FAR:
=====================

--You are able to run the pm.exe software and properly map port 587 to port
25 using the command line.

--You are able to send yourself a message using telnet on port 587.

--You are NOT able to send a message from a non-local address to another
non-local address using port 587.

--If you specified the W command line switch, you should see a log file in
the same directory as pm.exe, in which you can review the telnet connections
you tried above.

You will now probably want to set up your machine so that pm.exe runs "as a
service" so that you don't have to remember to log in and enter the command
line to start the app/redirector every time you start  the machine... I
therefore provide:


====================================================
Instructions for running the pm.exe app as a service
====================================================

Stop the app that you launched using the command line instructions above.

Go to www.microsoft.com/downloads and enter Windows 2003 Resource Kit Tools
in the keyword search.  Download the Windows 2003 Resource Kit Tools
executeable, and run it to install the apps... This will install a bunch of
little apps, including the two you need:  instsrv.exe and srvany.exe.


==============================
Install a new "blank" service:
==============================

In a command prompt:
CD to C:\Program Files\Windows Resource Kits\Tools

Then type:
instsrv Port587Map "c:\Program Files\Windows Resource Kits\Tools\srvany.exe"


=====================================
RESPONSE FROM THIS COMMAND SHOULD BE:
=====================================

"The service was successfuly added!

Make sure that you go into the Control Panel and use
the Services applet to change the Account Name and
Password that this newly installed service will use
for its Security Context."


Now you have a "blank" service installed (you can confirm this by looking at
the Windows 2003 SERVICES  applet).  Now you need to configure the service
so that it actually does something:


=======================================
To configure the service using RegEdit:
=======================================

Click the Start button, and then click Run.

In the Open box, type regedit, and click OK.

Add a new subkey named Parameters in the following registry location:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\

Right-click the newly created service name, point to New, and then click
Key.

In the console pane, for the name of the new key, type Parameters.

To specify the target application, right-click the Parameters subkey, point
to New, and then click String Value.

Type the name of the new entry as Application.

Right-click Application and then click Modify.

In the Edit String window, in Value Data, type the full path to the
application, including the  application name and extension. For the port-map
application, you'd type:
c:\progra~1\port-map\pm.exe


============================================================================
Now tell it what parameters to use when running the pm.exe app as a service:
============================================================================

Right-click the Parameters subkey, point to New, and then click String
Value.

Type the name of the new entry as AppParameters.

Right-click AppParameters and then click Modify.

In the Edit String window, in Value Data, type the parameters for the
application.
For our purposes, use:
5587 {imail.box.ip.addy) 25 w h

Add a "Description" key to the root service key (folder), and enter "Maps
port 587 (SMTP AUTH) to port 25 for additional SMTP support" as the
description.  (Or whatever the blazes you want.  This is a nice "extra"...
it provides  description text in the Windows 2003 SERVICES applet, so that
if you forget you added the service you won't think you've been hacked or
something.)


============================
RUN IT, TEST IT, ANNOUNCE IT
============================

Close the registry editor, open the services applet, find your new service,
and start it.  It should  start with no difficulties, and if you open Task
Manager, you should see pm.exe as a running process.   At this point, you
should re-run the telnet tests to make sure all is well, and maybe even
reboot the  machine to make sure that the service starts when the machine
boots.  If so, you're all ready to start telling your email users that they
can configure their mail clients to send on port 587 (SMTP AUTH) to bypass
any ISP blocking of port 25.


HTH,

Marc


To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html
List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/

Reply via email to