Email Notifications in ILM2
Hi,
I am trying to configure a workflow to notify an Administrator when a new user is provisioned in AD. I added the activity to the workflow, but when it runs, the users are provisioned, but no email is appears in the admin's mailbox.
I've been trying to deteremine where it is going wrong, but I don't know the mechanisms which ILM2 uses to send the mail, and I can't find any documentation that describes email notifications. What are the requirements for sending an email notification from an ILM 2 workflow, and how can I troubleshoot this issue?
Thanks,
Eric
December 4th, 2008 11:48pm
I think that I've determined that a call to the Exchange Web Service is the way that emails are sent. The ResourceManageer configuration file contains the configuration information for the email server. However, it points to the web service address as the "mailServer" attribute, but the calls are going to port 80, which doesn't seem right. Also, is the SyncAccount and SendAsAddress here important, because somehow they are for two different users in my configuration?
Free Windows Admin Tool Kit Click here and download it now
December 5th, 2008 3:25am
Hi
Two thingsto check:
1. The users that should receive the emails must have an email address in the ILM database.
2. Issues with the accounts:
The account used is the ILM Service account
The service account for the ILMService (not the sync engine) needs to be able to pull data from the Exchange web service and is also the account that is designated as the sendAsAddress.
From the install guide:
Exchange Server2007 Web Service (EWS) Configuration
In this procedure, you will ensure that the Exchange 2007 Web Service (EWS) is running and can be accessed as the ILM"2" service account.To ensure that the Exchange2007 Web service (EWS) is running and is accessible as the ILM "2" service account
Open Internet Explorer as the ILM"2" service account.
In the address bar, type https://<mail server>/EWS/Exchange.asmx.
This makes sure that you can access EWS wsdl using the ILM"2" service account.
Exchange Server2007 Certificate installation
On the middle-tier server that runs the ILM"2" server component, install the Microsoft Exchange Server2007 certificate for the ILM"2" domain service account.
Note
You must run the installation of the Microsoft Exchange certificate with elevated rights. If UAC is enabled, installing the Microsoft Exchange certificate without elevated rights will cause the installation to fail.To install the Microsoft Exchange certificate on the middle-tier server running ILM "2"
Open Internet Explorer as the domain service account that you specified when you set up the ILM"2" server components.
In the address bar, type https://mailserver/EWS/exchange.asmx.
Mailserver is the Microsoft Exchange server that you specified when you set up the ILM"2" server components.
In the Security Alert dialog box, click View Certificate.
On the Welcome to the Certificate Import Wizard page, click Next.
In the Certificate dialog box, click Install Certificate.
December 5th, 2008 9:01pm
You are correct that ILM "2" uses Exchange web service (EWS) to send and receive mail. We use the ILM Service's account to authenticate with Exchange. If you are curious, SyncAccount specifies whichWindows account has sync privledges. These privledges enable setting values in ILMwithout triggering some MPRs.
The SendAsAddress is used to set the reply-to address of the mail. It does not affect whichmailbox ILM uses to send mail. Exchange has policies for setting reply-to, so ILM would not be aware if it's valid and this could cause failures.
Two settings to check:
Make sure that theURL to Exchange web service is correct. Use Brjann's post as a guide for what it should look like. I also would make sure that you're using SSL (make sure it's https instead of http). ILM "2" is picky about valid Exchange certificates for security reasons. Usually EWS is on port 80, so that is normal.
Code Snippet<configuration><appSettings><add key="mailServer">https://ExchangeWebServiceURL</add></appSettings></configuration>
Next make sure that the isExchange setting is true. For outgoing mail we support SMTP and EWS, so this option tells us to use EWS.
Code Snippet<configuration><appSettings><add key="isExchange">1</add></appSettings></configuration>
Free Windows Admin Tool Kit Click here and download it now
December 6th, 2008 12:00am
Thanks for the help Brjann and Joe. I have looked at your suggestions and continue to have issues sending emails from ILM2. Per your suggestions I have tried to navigate to the EWS by navigating to https://<mail server>/EWS/Exchange.asmx but I receive a 403 error and I do not see a WSDL. I am also running OWA and was wondering if this could possibly interfere?
I have also verified that I can send and receive mail from within OWA as the ILM service accounts (ILM Admin, ILM Sync Service, ILM MA). Within the Exchange Management Console I am able to run reports that show the only emails that have been sent are the ones I sent manually from OWA. None of the ILM2 generated emails are in this report which leads me to believe that ILM2 is not sending the emails to Exchange at all.
I did notice that after trying multiple things to get my email notifications working that the MSExchangeSyncAppPool service that is tied to EWS stops.
December 9th, 2008 5:21pm
Joe,
Thanks for the help - I was not able to get the mailServer value to utilize a URL, it only worked when I disabled the EWS:
Code Snippet<appSettings><!-- Setup adds entries --><add key="mailServer" value="adlab-ex01"/><add key="isExchange" value="false"/><add key="sendAsAddress" value="svc-ilmws@domain.com"/><add key="synchronizationServerName" value="ADLAB-ILM2-02"/><add key="SyncEngineAccount" value="domain\svc-ilmma"/></appSettings>
This works everytime, but if I switch the values to the EWS URL (https://adlab-ex01/EWS/Exchange.asmx) with the isExchange set to true then it fails with the following error (in the WCF tracing log):
Code Snippet<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>3</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2008-12-10T06:15:03.1431405Z" /><Source Name="Microsoft.ResourceManagement" /><Correlation ActivityID="{a256ed5e-714e-44b9-805a-1a48a8398c88}" /><Execution ProcessName="Microsoft.ResourceManagement.Service" ProcessID="4812" ThreadID="4" /><Channel /><Computer>ADLAB-ILM2-03</Computer></System><ApplicationData>System: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: The remote name could not be resolved: 'https://adlab-ex01/EWS/Exchange.asmx' at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Microsoft.ResourceManagement.Mail.IlmSmtpClient.Microsoft.ResourceManagement.Mail.ISmtpInterop.Send(MailMessage ) at Microsoft.ResourceManagement.Mail.SmtpServer.SendApproval(ApprovalMessage message) at Microsoft.ResourceManagement.Mail.MailServer.SendApproval(ApprovalMessage message) at Microsoft.ResourceManagement.Mail.ApprovalMessage.Send() at Microsoft.ResourceManagement.Workflow.Hosting.EmailNotificationServiceImpl.SendMailMessage(MessageContent messageContent)</ApplicationData></E2ETraceEvent>
I can in fact resolve the address, and I can do so while logged in as the ILM WS and the WSDL displays properly. I followed the instructions for adding the certificate and I don't get any certificate warnings when I browse EWS from the server running the WS.
Any other ideas?
Free Windows Admin Tool Kit Click here and download it now
December 10th, 2008 9:18am
If you can login as the ILM Service account and access the https://servername/EWS/exchange.asmxyou do have the right setting. I would verify 2 things:
1. The recipient has an email address in ILM
2. verify that the ILM Service account is the account you login as when verifying the EWS URL
I have used a tool call Fiddler on the ILM server to trace all HTTP Traffic to verify what calls are being made. this has helped me find issues a couple of times together with plain old Logging inIIS.
Brjann
December 10th, 2008 10:00am
Please note that isExchange must be "1" and not "true". ILM treats the two values differently. I apologize for the mistake.
Free Windows Admin Tool Kit Click here and download it now
December 11th, 2008 8:50pm


