How to configure SMTP Relay on IIS7


To totally unlock this section you need to Log-in


Login

Installing the STMP Service

  • From your Server Manager right click on features and click on Add Features menu.
  • Select SMTP Server and click Next.
  • Click on Add required role services (This will also install IIS6.0 Manager which is mandatory for SMTP service)
  • Click Next
  • Check whether IIS 6 metabase compatibility and IIS6 Management Console are checked.

How to configure SMTP Relay on IIS7

Click Next and then click Install.

Configuring SMTP Service

From Administrative Tools run IIS6 Manager and then click on SMTP Server Properties:

How to configure SMTP Relay on IIS7

In the General tab select the IP address of your SMTP Server from the drop down list:

How to configure SMTP Relay on IIS7

Go to Access Tab and click on Relay button. Select Only the list below option and add 127.0.0.1 as IP Address and click OK:

How to configure SMTP Relay on IIS7

Right click on Domains and click on New --> Domain:

How to configure SMTP Relay on IIS7

Select the domain type as Remote and click Next:

How to configure SMTP Relay on IIS7

  • Specify a Name and click Finish.
  • Go to the properties of that newly created domain.
  • Enter your mail server FQDN or IP address (in between [ ]) in the Forward all mail to smart host field.
  • Click on Outbound Security –> select Anonymous access and check TLS encryption.
  • Click OK.
  • Restart SMTP Service.

How to configure SMTP Relay on IIS7

How it works

SMTP utilizes this directory structure to process mail. The folders created in the Inetpub --> Mailroot directory structure (message store) are listed below:

[tweet]

Pickup: The SMTP service processes messages from the Pickup folder as outbound messages or as messages for delivery. If the message is intended for users who are local domain members that the SMTP service manages, the SMTP service moves the message to the Drop folder.

Drop: Incoming messages intended for the local domains are placed in the Drop folder. This is true for all recipients because the SMTP service does not maintain a mailbox for each recipient.

Queue: The SMTP service moves messages that cannot be immediately delivered to the Queue folder from the Pickup folder. The SMTP service repeatedly attempts to deliver messages stored in the Queue folder.

Badmail: The Badmail folder stores messages that could not be forwarded to the recipient, even though a predefined number of attempts were made. Another characteristic of messages in the Badmail folder is that SMTP cannot return the messages to the senders. This means that administrators have to handle messages in the Badmail message store.

Mailbox, Route, SortTemp: Because these folders are not utilized in IIS 6, they can be deleted from the SMTP directory structure.

The events that occur when SMTP processes mail are listed below:

  • The SMTP service, smtpsvc.dll, runs in-process in the Inetinfo.exe IIS process.
  • Smtpsvc.dll monitors TCP port 25 for any incoming messages.
  • It monitors the Pickup folder for all outgoing messages.
  • SMTP places messages for users that are members of the local domain it manages in the Drop folder for delivery.
  • If a message has to be sent to a user that is a member of a different or remote domain, an ASP application has to create and place the outgoing message in the Pickup folder. This is done through the ASP application with CDOSYS (a Microsoft component).
  • The SMTP service then performs a DNS lookup on the name server so that it can find the SMTP host that manages the remote domain. The port used for this process is port 53. The SMTP service checks for the MX record for the remote domain.
  • After the fully qualified domain name (FQDN) of the remote SMTP host is determined, the SMTP service attempts to create a connection with the remote SMTP host to transfer the message for the recipient to it. Port 25 is utilized for the message transfer.
  • If a connection cannot be established with the remote SMTP host, the SMTP service places the message in the Queue folder.
  • If a connection can be established with the remote SMTP host but the remote SMTP host rejects the connection, the SMTP service forwards the message sender a non-delivery report (NDR) and returns the message as well. The message is placed in the Badmail folder if it cannot be returned to the sender.
  • If a connection can be established with the remote SMTP host and the remote SMTP host accepts the connection, the SMTP service transfers the message to the remote SMTP host.
  • After the remote SMTP host receives the message, it is sent to the POP3 or IMAP mail server that contains the intended recipient’s mailbox.
  • The message is downloaded when the client connects to the POP3 or IMAP mail server.

Test SMTP Server

The SMTP service accepts SMTP Request for Comments (RFC)-822 formatted messages for delivery. The service builds the RFC-821 header based on the 822 information in the file. To create an SMTP RFC-822 formatted message, follow these steps:

Create the file using a text editor such as Microsoft Notepad, and then type the message information into the file. Save the file without an extension. To do so in Notepad, insert quotation marks (" ") around the file name, and then save the file.

When the file name includes quotation marks, Notepad saves the document as a .txt file by default. The name of the file is irrelevant, you can name the file to suit your needs. The following text is an example of a basic RFC-822 formatted file:

to:[email protected]

from:[email protected]
subject:This is a test.
this is a test.

When you place this file in the Pickup folder, this file is processed as an outbound message. If the configuration of the SMTP service is correct, the message is delivered to the e-mail address in the "to" line in the .txt file. If the file is displayed in the Queue or Badmail folders, there is a problem with the SMTP service configuration.

1 thought on “How to configure SMTP Relay on IIS7”

  1. During a mail system migration, or even after that, in several common businesses, it’s not so uncommon the need to have availble an internal SMTP relay to deliver internal alerts, triggered by internal systems or servers, to our brand new cloud-based mail system. To do that, we’ll need an SMTP relay…..and we can implement it by using IIS7.

    Read more on HeelpBook:

    How to configure SMTP Relay on IIS7 – http://heelpbook.altervista.org/2014/how-to-configure-smtp-relay-on-iis7/ #howto #microsoft #iis #heelpbook @heelpbook

Comments are closed.