配置SQL的report service SMTP認證

Configure Reporting Services to use basic authentication with a SMTP server

 

For anyone that has had the requirement to configure a Reporting Services instance to use a remote SMTP server using basic authentication it is sure a great frustration that basic authentication against a SMTP server is not support. There is however a way to get around this problem.

All of this can be achieved by using your own virtual SMTP server and setting up message relay with basic authentication to the remote SMTP server. Lets go through the steps to achieve this.

First you need to install the SMTP feature on your Windows Server instance. In this example I am using Windows Server 2008 R2. In Server Manager go to the features section and click on Add Features.

p_w_picpath

Select SMTP from the list of feature.

p_w_picpath

Click on “Add Required Role Services” when you are prompted. (This will added IIS and all the other services that are needed to run the SMTP server)

p_w_picpath

Click “Next” until you get the “Confirm Installation Selection” window and then click on “Install”.

p_w_picpath

Click on “Close” after the installation completes.

Next we need to setup our SMTP server to relay our emails via the remote SMTP server. Click on Start, Administrative Tools and then on Internet Information Services (IIS) 6.0 Manager. (Make sure to select the IIS 6.0 Manager)

p_w_picpath

Click on the + sign next to the server name to reveal the virtual SMTP server.

p_w_picpath

Right click on the SMTP Virtual Server and click on Properties. Under the general tab, select the IP address of for the SMTP server.

p_w_picpath

On the Access tab click on “Relay”.  If you wish to limit the computers that are allowed to relay through this virtual SMTP server by specifying them explicitly then keep the “Only the list below” option selected and add the IP addresses, Domain or group of computers to the list by clicking on the “Add” button. If you want to allow all machines except certain ones to relay emails through the virtual SMTP server then you can select the “All except the list below” option and add machines you specifically want to deny access to into the list by click on the “add” button. (Keep in mind this will allow any machine to relay mail through this virtual SMTP server unless it is specifically blocked. As this is a testing Virtual Machine I have selected the second option)

p_w_picpath

Click “OK” and then click on the Delivery tab. On the Delivery tab click on “Outbound security”.

p_w_picpath

Select “Basic authentication” and specify the username and password that you need to use to authenticate to the remote SMTP server.

p_w_picpath

Click on “OK”. Next click on “Outbound connections”.

p_w_picpath

Here we will set the TCP port on which to connect to the SMTP server.

p_w_picpath

Click on “OK”. Next click on “Advanced” on the Delivery tab.

p_w_picpath

Here we will specify the address of the remote SMTP server in the “Smart host” textbox.

p_w_picpath

Click on “OK” twice to complete the setup of the SMTP server. The last thing that remains to be done is to configure Reporting Services to use our virtual SMTP server. You can do that by running the Reporting Services Configuration Manager utility.

p_w_picpath

Connect to you ***S instance and then click on the “Email Settings” option.

p_w_picpath

Type in the email address that will be shown as the sender when ***S sends emails. (This may be over written by the remote SMTP server so check to see if this is the case. In this example the Google SMTP server will replace any address that you enter here with the email address of the account used to authenticate to it and send emails with.)

In the “SMTP Server” textbox type the IP address that you selected for the virtual SMTP server.

p_w_picpath

Click on “Apply” and then “Exit” after the settings have been applied successfully.

Reporting Services is now configured to send emails via the local virtual SMTP server which will relay the emails using the Remote SMTP server using basic authentication

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章