Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

  • 1 .NET
  • 2 Microsoft Visual Studio Express 2012
  • 3 Configuration Settings
  • 4 Set “ClearCategories” to false
  • 5 Basic Installation Steps
  • 6 Detailed Installation Steps (Optional, use when needed)
  • 7 Agent Logs:
  • 8 Troubleshooting
    • 8.1 Issue of digitally signing
    • 8.2 Issue of access denied
  • 9 Agent Logs
  • 10 Agent Functioning
  • 11 Message Deliver
  • 12 Exchange Logs/tools

...


The source code can be downloaded here: https://dl.dropboxusercontent.com/u/13110611/nuxeo/pi-nuxeo-exchange.zip


When open the source code with Visual Studio, we need to:

1) Change the .Net framework according to the Exchange server version.

...

 In the screen shot below the permissions are given to c:\TransportAgents.

Image Added

4.  Open Exchange management shell as Administrator

 Image Added

5.   Restart IIS via IISRESET command.


6.   Install the Transport Agent (http://technet.microsoft.com/en-us/library/aa997998(v=exchg.141).aspx)


 Install-TransportAgent -Name "PiNuxeoAgent" -TransportAgentFactory "PI.PiNuxeoAgent.MailAgentRoutingFactory" -AssemblyPath "C:\TransportAgents\PI.PiNuxeoAgent.dll"


NOTE:  If the shell does not recognize the command, load Exchange Snapin first.
 
For Exchange Server 2010, execute the following command:


 Add-PSSNapin -Name Microsoft.Exchange.Management.PowerShell.E2010


For Exchange Server 2013, execute the following command:


Add-PSSNapin Microsoft.Exchange.Management.PowerShell.SnapIn

 
 
7.    Enable Transport Agent


 Enable-transportagent “PiNuxeoAgent"


8.       Restart Microsoft Exchange transport service.


9.       Send a sample mail to confirm the behaviour. Use Outlook or send it from Exchange Shell as follows:


Send-MailMessage -To "process@auto.ghfip.com.au" -Subject "Test" -Body "Messageeeeeeee" -SmtpServer "server.ghfex.com.au" -From "process@auto.ghfip.com.au"

 

The script that installs can be found along with the release files (AgentInstall.ps1). This script:

 

  • Takes folder (where the agent dll is), smtp server (through which a sample mail can be sent) and a mail address (which can be used for sending the message) as arguments.
  • It gives Networkservice full permissions on the given folder, installs the agent, restarts the transport service and sends a sample message.
  • The script can be run as follows

AgentInstall.ps1 -folder “C:\TransportAgents” -mail “process@auto.ghfip.com.au” -server “server.ghfex.com.au


-folder is the folder where the transport agent dll is.
-mail is the mail address where the test mail is being sent to.
-server is the server that SMTP server for sending the mail


Agent Logs:

Logging is done through Log4Net. See the following notes on logging:


Logging Notes:

  • Logs are written to the same folder as the all.
  • The files are written to the same directory as the dll.
  • The file is saved as _MailAgent.log.
  • File is rolled over after every 1 GB.
  • Last 10 files are maintained.
  • Logs can be configured to multiple levels - Info, Debug, Error. Info is the default level.

 

 


Troubleshooting


Some of the issues that may occur are (not necessarily because of the agent, but quite often because of Exchange’s interaction with agent, clashes with other agents, some exchange settings etc)

 

    • Agent is not functioning as expected - This would be a bug with the agent.
    • Mail is not getting delivered - Likely cause be another agent or exchange not delivering it correctly.


The first step in resolving this issue is to confirm that the agent is running. To do this:


1. Open Exchange management command shell.
2. Run the command Get-TransportAgent and confirm that PiNuxeo agent is installed and enabled.


Issue of digitally signing

If you got this message:

 

Code Block
languagetext
File C:\ex2010-release-20140605\InstallAgentExch2010.ps1 cannot be loaded. The file C:\ex2010-release-20140605\InstallA

gentExch2010.ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing

" for more details..

At line:1 char:27

+ .\InstallAgentExch2010.ps1 <<<<

    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException

    + FullyQualifiedErrorId : RuntimeException

Then please run the command in the 'Exchange Management Shell'

 

Code Block
languagepowershell
 Set-ExecutionPolicy Unrestricted

 

After the plugin is installed successfully, turn it off:

Code Block
languagepowershell
Set-ExecutionPolicy Restricted


Issue of access denied

If you got this message:

 

 

 

Code Block
languagetext
Could not load file or assembly 'file:///C:\TransportAgents\PI.PiNuxeoAgent.dll' or one of its dependencies. Access is

denied.

    + CategoryInfo          : InvalidArgument: (:) [Install-TransportAgent], FileLoadException

    + FullyQualifiedErrorId : 3A3ADC09,Microsoft.Exchange.Management.AgentTasks.InstallTransportAgent

Transport agent "PiNuxeoAgent" isn't found.

Parameter name: Identity

    + CategoryInfo          : InvalidArgument: (:) [Enable-TransportAgent], ArgumentException

    + FullyQualifiedErrorId : 78732C6B,Microsoft.Exchange.Management.AgentTasks.EnableTransportAgent

 

This may be caused by two reasons:


1) Check if the files in C:\TransportAgents are green, if so, we need to open "Properties" dialog, and then select "Advanced..." and then uncheck "Encrypt contents to secure data". Do the same for all green files.


2) We need to restart the IIS using iisreset command. For more information please see the references.
References:

 

  1. Agent Logs

    If the agent is running, turn on the debug flag in the pinuxeoagentconfig.xml file and restart transport service

    •  

        <root>

          <level value="All"/>

          <appender-ref ref="RollingFileAppender"/>  

        </root>

     

    Set the level flag to all as above. This turns on all levels of logging.

    Agent logs can be found at the same location as the dll. If the debug level is on, it adds detailed trace info to the file which can be used in troubleshooting.

  •  

    Agent Functioning

    In case of error or an exception, details along with where the exception occurred can be found in the log file.

 

Message Deliver

Each message has the following entries at the start and end and a few in between. If the two entries are present, the message is correctly picked up and processed with the agent and any issue with the message delivery has occurred after the agent processed.

  •  

    ProcessMessage(): Start <Message subject>

    ProcessMessage(): End<Message subject>

 

Exchange Logs/tools

If there was an issue with message delivery and the agent logs indicated successful processing by the agent, certain exchange tools and utilities can be used to further diagnose the issue. Some of them are listed here, but an exchange administration is needed to run and analyze these issues.  This is beyond the scope of this document.

  1. Queue Viewer
  2. Message tracking logs
  3. Pipeline tracing logs.

http://technet.microsoft.com/en-us/library/bb125018(v=exchg.150).aspx