DBA Tips Archive for Oracle |
Configuring SMTP on Windows
by Jeff Hunter, Sr. Database Administrator
Contents
Overview
Exim - (as part of Cygwin)
On the Welcome screen, click [Next] to continue.
On the "Choose a Download Source" screen, select "Install from the Internet". (downloaded
files will be kept for future re-use)
On the "Select Root Install Directory" screen, the "Root Directory" should be c:\cygwin.
On the "Select Local Package Directory" screen, the "Local Package Directory" should be C:\CygwinInstall.
On the next two screens, select the correct "Internet Connection" and "Download Site"
close to you.
On the "Select Packages", click the "View" button until it shows "Full". Then look for
the line for "exim" and click the word "skip" until it shows an [x] in the "Bin?" column.
Finally, look for the line "cygrunsrv" and do the same - click on the word "skip" on
that line until an [x] appears in the "Bin?" column.
Click [Next] to start the installation.
In the "Systems variables" section (lower section), click the "New" button
to add a new system variables:
Variable name: CYGWIN
Also in the "Systems variables" section, modify the Path variable
(clicking on the "Edit" button) and appending the following
to the end of the existing variable string:
Invoke the "Control Panel" and select the "Security Center" applet.
If the firewall is not enabled (NOT MONITORED), then there is no need to continue with this
section. If however, you have the firewall enabled, click the "Windows Firewall"
in the "Manage Security Sections for:" section.
In the "Exceptions" tab, click the "Add Port" button.
In the dialog box, use a name of "exim" and the
Port Number "25". Also, make sure
to check the TCP radio button. The "Scope" of this rule should be
set to "Any computer" by default.
Microsoft Internet Information Server (IIS)
If not and the splash screen does not come up, navigate to the drive
letter of the CD-ROM and run setup.exe.
Click [Next] to start the installation process.
If everything was successful, you will be presented with a
"Welcome to Windows XP Server Internet Services" page with a message indicating
"Your Web service is now running.".
I first look at the running services:
We can also check that it is running on port 25 by running:
Finally, I like to make sure SMTP is responding to requests. To do this, telnet
to your machine on port 25. I then like to send the HELLO command as follows:
Invoke the "Control Panel" and select the "Security Center" applet.
If the firewall is not enabled (NOT MONITORED), then there is no need to continue with this
section. If however, you have the firewall enabled, click the "Windows Firewall"
in the "Manage Security Sections for:" section.
In the "Exceptions" tab, click the "Add Port" button.
In the dialog box, use a name of "SMTP" and the
Port Number "25". Also, make sure
to check the TCP radio button. The "Scope" of this rule should be
set to "Any computer" by default.
We now need to configure SMTP from within the IIS Console.
At a minimum, we need to configure
the "Relay Restrictions" to allow computers within the network to relay
mail through this virtual server. In this example, I will simply grant
to all computers the ability to relay through this server.
Configuring SMTP (and other IIS services) is done using the "Internet Information Services" console.
This application can be found from the Start menu:
Start / Programs / Administration Tools / Internet Information Services.
Once the "Internet Information Services" console is open you will see any IIS web
services you have running on your machine including the SMTP server and FTP server
(if you chose to install them with IIS).
From the tree, right-click on the item "Default SMTP Virtual Server", and select "Properties".
From the "Default SMTP Virtual Server Properties" dialog, select the "Access" tab. Now,
select the "Relay" button under "Relay Restrictions". By default, the
option "Only the list below" is selected. For my example, I want to grant
everyone access so I click the "All except the list below" radio button and click "OK"
on both open dialog boxes.
After making this change, we need to restart the SMTP server from the main IIS console
application. Again, right-click on the item "Default SMTP Virtual Server" and
select "stop". Then do it again and select "start".
Copyright (c) 1998-2013 Jeffrey M. Hunter. All rights reserved.
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter
and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express,
prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate,
but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from
relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.
This articles presents several ways to configure
a Microsoft Windows machine with the
Simple Mail Transfer Protocol (SMTP).
One method is to install exim, an SMTP server [a GNU (GPL) software, included with Cygwin]
on a Windows 2000 or Windows XP machine. (This is always my preferred method!)
This article assumes that Cygwin is not installed on the Windows
computer. Complete instructions for installing Cygwin and configuring
for Exim is included in this section.
Variable value: ntsec tty
;c:\cygwin\bin
icon),
a black screen pops up, type exim-config. Answer the prompts as
follows:
At this point, the Exim Mail Transfer Agent service (exim) should be running!
Administrator" or
type a user name with Administrator privilege.
mail.mydomain.com)
yes".
15".
no".
yes".
netstat -an | grep 25
You should see a response like:
TCP 0.0.0.0:25 0.0.0.0:0 LISTENING
net start exim
net start exim
hostlist relay_from_hosts = 127.0.0.1
and change it to
hostlist relay_from_hosts = 127.0.0.1 : 192.168.1.0/24
The above modification tells exim to accept emails
(for sending) from any workstation with an IP address of 192.168.1.xx.
This line could be read as "relaying mail for the subnet 192.168.1.0/24". Please
keep in mind that your local network subnet number may be different.
host_lookup = !127.0.0.1/8:*
and change it to
# host_lookup = !127.0.0.1/8:*
rfc1413_query_timeout = 30s
and change it to
rfc1413_query_timeout = 1s
require verify = sender
and change it to
# require verify = sender
net stop exim
net start exim
One easy way is to install
Microsoft's web server, Internet Information Server (IIS). This is faily painless.
If you are running Windows XP Professional on your workstation you can install
Microsoft's web server, Internet Information Server (IIS) from your Windows XP Pro
installation CD. Instruction for installing and configuring IIS on Windows XP Pro,
follow the instructions below:
You can also get to this by opening the "Add/Remove Programs"
applet from from "Control Panel". From the "Add or Remove
Programs" dialog, click the "Add/Remove Windows Components" button (left).
I, however, like to
add other services and options (i.e. FTP). To do this, make sure the "Internet Information Services (IIS)"
option is selected and click the "Details" button. Add or remove any other services
or options, but make sure that the "SMTP Service" stays checked.
http://localhost
You can substitute localhost for the name of your computer!
C:\> net start
and look for the "Simple Mail Transfer Protocol (SMTP)" running.
C:\> netstat -an | grep 25
You should see a response like:
TCP 0.0.0.0:25 0.0.0.0:0 LISTENING
C:\> telnet localhost 25
220 melody Microsoft ESMTP MAIL Service, Version: 6.0.2600.2180 ready at Thu, 15 Sep 2005 19:39:33 -0400
helo
250 melody Hello [127.0.0.1]
quit
221 2.0.0 melody Service closing transmission channel
Thursday, 18-Nov-2010 18:38:21 EST
Page Count: 15606