Installing SmtpProxy

The download is a Windows Installer (MSI) file that can be used to install SmtpProxy on any machine that supports the .NET Framework v4 – Client Profile.  You should make sure this is installed on your computer before running the MSI.

Configuring SmtpProxy

SmtpProxy is configured using a config file. This is a plain text file that can be edited with Notepad.

The default location of the config file is:

  • On 32 bit machines: C:\Program Files\SmtpProxy\SmtpProxy.exe.config
  • On 64 bit machines: C:\Program Files (x86)\SmtpProxy\SmtpProxy.exe.config

If you modify this file, you must restart the SmtpProxy for the new settings to take effect.  Use the Restart option from the Windows Services window.  You can also restart a service from a console window by issuing two commands:

  1. NET STOP SmtpProxy
  2. NET START SmtpProxy

SmtpProxy Settings

The following items can be configured with SmtpProxy’s config file:

  • SmtpProxy can write a log of all it’s activities.  The default file to write the log file to is SmtpProxy.trace.log.
  • SmtpProxy can log several different types of activities.  You can control what is written to the log file by setting the log switches.  By default, they are set to Off so nothing is written to the log file.  Valid switch values are Off, Error, Warning, Info, and Verbose with each one providing more information than the last.  Once you have SmtpProxy working, you should turn logging Off.
  • The Url to the SMTP server. Default is smtp.live.com.
  • The SMTP server port. Default is 587.
  • The port to listen on. Default is 25.

Default SmtpProxy.exe.config file

Below is the default SmtpProxy file.

<?xml version="1.0" encoding="UTF-8" ?>
  
<configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="SmtpProxy.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <system.diagnostics>
    <trace autoflush="true" />
    <sources>
      <source name="System.Net">
        <listeners>
          <add name="TraceListener"/>
        </listeners>
      </source>
      <source name="System.Net.Sockets">
        <listeners>
          <add name="TraceListener"/>
        </listeners>
      </source>
      <source name="System.Net.Cache">
        <listeners>
          <add name="TraceListener"/>
        </listeners>
      </source>
      <source name="SmtpProxy">
        <listeners>
          <add name="TraceListener"/>
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <!--By default, trace data is written to the same directory where the EXE is located.
          The default filename is SmtpProxy.trace.log.
          You can change the initializeData value to specify another filename or location.
        -->
      <add
        name="TraceListener"
        type="System.Diagnostics.TextWriterTraceListener"
        initializeData="SmtpProxy.trace.log"
                />
    </sharedListeners>
    <!--Use these switches to turn logging on or off and to set the level of messages written to the log file.
        Valid values are Off, Error, Warning, Info, and Verbose.
      -->
    <switches>
      <add name="System.Net" value="Off" />
      <add name="System.Net.Sockets" value="Off" />
      <add name="System.Net.Cache" value="Off" />
      <add name="SmtpProxy" value="Off" />
    </switches>
  </system.diagnostics>
  <applicationSettings>
    <!--SmtpProxy.Properties.Settings and their default values:
        PortToListenOn - default 25 - The port number that the SmtpProxy program will listen on
        SmtpHostUrl - default smtp.live.com - The URL of the SMTP server that SmtpProxy will connect to
        SmtpPort - default 587 - The port number of the SMTP server that SmtpProxy will connect to
      -->
    <SmtpProxy.Properties.Settings>
      <setting name="PortToListenOn" serializeAs="String">
        <value>25</value>
      </setting>
      <setting name="SmtpHostUrl" serializeAs="String">
        <value>smtp.live.com</value>
      </setting>
      <setting name="SmtpPort" serializeAs="String">
        <value>587</value>
      </setting>
    </SmtpProxy.Properties.Settings>
  </applicationSettings>
</configuration>

Last edited Jun 14, 2011 at 7:59 PM by dougclutter, version 9

Comments

No comments yet.